How to use SolidStart on existing SolidJs project in order to benefit of File Based Routing ?
PS: I use SolidJs only for SPA, so only client-side ? Is it possible to use SolidStart only for client Side ?
My goal is to benefit from the organization of SolidStart, i'm used to SolidJs router on client side, but I think it's a little bit messy, so that's why I would like to try SolidStart for Client SIde only rendering (SPA)
9 Replies
yes, disable (seems unsupported atm) you can wrap the client parts with
solid-start-static
can be used for this ssr
to make it behave like a SPA. if you need to render some pages as static, you can use ssr
and ClientOnly
helper which is just
I don't need SSR, it's a pure SPA
So no need for
ClientOnly
?
And do I need the entry-server.tsx
file since I do not use SSR ? Can I delete it ??i've updated my reply,
ssr: false
isn't supported for static adapter but default adapter (solid-start-node) can be compiled with ssr: false
which spits out both client + server, but serving the client build should work i thinkoh ok, so i still need
entry-server.tsx
i think you can delete both entry files but you could confirm by yourself to be sure 😆
they are mostly there so you could put up some environment specific logic
yes, I'm testing, and I'll provide you some feedback 😉
i don't think the build supports full SPA mode though so you'll have to import some client side only stuff with dynamic import
especially if the stuff have some side effect code that does some client side things when imported
@mdynnl I got Solid Start working with the node adapter and SSR to false, I don't need any entry-* file indeed, and it works great 🙂 thx for your help 😉
Oh and if you have any idea why I can't use script in the head tag, I'll be very happy to get an answer 😅
https://discord.com/channels/722131463138705510/1137902556912296056
cool