lemonad
Loading screen for app
@andi Just wanted to get back to you with an update. I have managed to progress quite a bit, only thing I haven't managed is to split out vendor stuff for the main chunk (which is now > 1MB). Something I would like to do as that changes rarely compared to the application code. These are some of the things I did:
I removed all code splitting from the vite config (
manualChunks
, splitVendorChunkPlugin
) as that was putting things in my index.html
to be immediately loaded.
I made some changes to index.html
such as adding basic styling for the body and a div
showing "Loading..." which is hidden once the solid app loads. This is pretty much only shown if the network is super slow.
In my index.tsx
, I lazy load App
and then use
I don't really remember why I set it up this way but I think it was to make the initial chunk to load as small as possible.
In App
, I lazy load my main routes and then use
The first thing I do in MainRoutes
is set the signal mainRoutesLoaded
so that I can progress to the main app from the Hello
loading screen.
Thanks for the help on the way!14 replies
Loading screen for app
Ah, didn't think about imports being promises. I tried some stuff now but I have to figure out how to create a minimal chunk for the routing as well as a minimal chunk for the initial page that doesn't depend on the entire vendor chunk.
14 replies
Loading screen for app
@andi Thanks so much for the tip! I'm actually already using manualChunks already but the problem I don't know how to solve with separating it into two chunks like I think you suggest is that I don't know how to lazy load (or similar) the entire second, major chunk. I don't want to lazy load each component separately because then parts of the app might become unavailable when offline.
14 replies
createStore array containing arrays
Thanks @mdynnl, just confirming it should work made me solve it. I was setting the values properly but I had a For that was misrepresented above, it was actually more like
<For each={item.nested}>
{(item2) => {
...
const currentClass = props.classes.find((x) => x.name === item2.data.classification.class);
...
return <li>...</li>;
where item2.data.classification.class was what I updated. Not sure if it was the find that broke reactivity or something else there.
8 replies