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 manageable14 Replies
YES this is coming in a future update but isn't possible at the moment 😦
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 🙂
amazing that great to hear, just doing some testing with opensaas is already making these files quite bloated
Wohooo @RichardHpa, you just became a Waspeteer level 1!
any update on this?
Not yet unfortunately. Are you using
main.wasp.ts
or main.wasp
?We are quite close though
ts
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
nah with ts
amazing
can split it amazingly
You mean it works already?
Wasp TypeScript config (*.wasp.ts) | Wasp
This document assumes your app works with Wasp >= 0.15.
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?