is there a way to disable default lazy loading for routes in solidstart?
it seems routes are download when a link to them is clicked and then cached. is there a way to just download all routes on any route like solid spa?
11 Replies
When I last checked, all routes were preloaded via link tag and only evaluated once the location was loaded.
go to the network tab and click on a link
you'll see the routename.js downloaded
i want it to be download even before clicking the link
It works if you choose to prerender your routes: https://docs.solidjs.com/solid-start/building-your-application/route-prerendering
it still downloads routename.js
i want it be pre-downloaded like the vite solid template
get it?
basically FileRoutes is lazy loading all routes
which i don't like
Interesting preference.
yeah...
let me check something
You could attempt to write your own middleWare that uses require to load the routes synchronously, but that's a rather ugly solution.
i can delete
<FileRoutes />
and define my own <Route />
s
it is an ugly solution but it works
with ssr and allyes, that's currently the only viable solution, I'm afraid. Maybe you can convince Nikhil or Ryan to provide a
sync
option to FileRoutes at some point.that'd be most-optimal
GitHub
[Feature?]: Add an option to disable lazy loading in `` · Issue #15...
Duplicates I have searched the existing issues Latest version I have tested the latest version Summary 💡 currently, FileRoutes lazy-loades all routes by default which is sometimes undesired. Adding...