W
Wasp•10mo ago
RichardHpa

Can I split up the main.wasp file into seperate files

Hey Everyone. I am really enjoying learning wasp and can easily see myself using this alot to make some of my web apps. I am just wondering is there anyway to split out the code in the main.wasp file into seperate files as I could easily see this file getting quite large and out of hand. What i mean is there a way to have a seperate file for all the routes (and maybe even break that until into sub routes), queries, jobs, actions, DB schemas. If not that would be a great thing for a future version of wasp to be able to do, would help with making the code abit more readable and manageable
14 Replies
Vinny (@Wasp)
Vinny (@Wasp)•10mo ago
YES this is coming in a future update but isn't possible at the moment 😦
matijash
matijash•10mo ago
100% agree! As @Vinny (@Wasp) mentioned, this is one of the features we'll be tackling next. It sounds straightforward, but it also opens the questions of (sub)modules, imports etc, so that's why we want to take enough time to refine this. Recent changes of v0.12 put the foundations for all this in place 🙂
RichardHpa
RichardHpaOP•10mo ago
amazing that great to hear, just doing some testing with opensaas is already making these files quite bloated
MEE6
MEE6•10mo ago
Wohooo @RichardHpa, you just became a Waspeteer level 1!
fooosieee
fooosieee•4w ago
any update on this?
Filip
Filip•4w ago
Not yet unfortunately. Are you using main.wasp.ts or main.wasp?
martinsos
martinsos•4w ago
We are quite close though
fooosieee
fooosieee•4w ago
ts
Filip
Filip•4w ago
Yeah, that should be coming soon. If it's a major issue for you, I could figure out how to hack it together right now, but I recommend sticking to a single file if not too big of a deal
fooosieee
fooosieee•4w ago
nah with ts amazing can split it amazingly
Filip
Filip•3w ago
You mean it works already?
fooosieee
fooosieee•3w ago
Wasp TypeScript config (*.wasp.ts) | Wasp
This document assumes your app works with Wasp >= 0.15.
martinsos
martinsos•3w ago
Right, you are using Wasp TS config, but did you managed to split it into multiple files? If so, can you maybe share a bit of details how that went, any issues, or was it just simple?
Want results from more Discord servers?
Add your server