S
SolidJS6mo ago
Hussein

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
Alex Lohr
Alex Lohr6mo ago
When I last checked, all routes were preloaded via link tag and only evaluated once the location was loaded.
Hussein
HusseinOP6mo ago
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
Hussein
HusseinOP6mo ago
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
Alex Lohr
Alex Lohr6mo ago
Interesting preference.
Hussein
HusseinOP6mo ago
yeah...
Alex Lohr
Alex Lohr6mo ago
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.
Hussein
HusseinOP6mo ago
i can delete <FileRoutes /> and define my own <Route />s it is an ugly solution but it works with ssr and all
Alex Lohr
Alex Lohr6mo ago
yes, 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.
Hussein
HusseinOP6mo ago
that'd be most-optimal
Hussein
HusseinOP6mo ago
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...
Want results from more Discord servers?
Add your server