The second case is a common misconception of modern SPA. Code-splitting has been around for a while now. When split across routes it's trivial to implement.
The second case is a common misconception of modern SPA. Code-splitting has been around for a while now. When split across routes it's trivial to implement.
Reddit is probably the most familiar example of this, because it actually has multiple implementations (old.reddit, i.reddit etc) that let you see the difference!
As for whether the initial paint is of value, that comes down to product and implementation. Nothing is faster than offline-first or local cache, which SSR does not have a good narraative for.
For general performance you can cache the modules using a service worker.
In any case they are fine for most use cases.
I haven't personally noticed the vite/esbuild memory consumption, but I also run build only once at the end before deployment or generating the prod artifacts.
We're using typescript so building only once a day isn't an option.
During development vite has HMR and you don't need to run build after every change. This is no different when using SSR.
But I don't want to further argue. If you think that SPA is not suitable for your use case, that's ok.
It does reload changes very quickly so I guess it has some caching somewhere.
> But I don't want to further argue. If you think that SPA is not suitable for your use case, that's ok.
I personally never seen a use case which did not end up the way I'm describing, my 2 previous companies suffered the same issues.
I even warned my current company that there's a good chance that it would end up the same way and sure enough it did.
I don't know what machine you're using, but filling 2.5GB of RAM was already taking less than 200ms back in 2018.
I don't suspect memory usage is an issue here.
And getting more RAM is just delaying the problem anyways since it takes more RAM every week as the product evolves.
That's why I personally don't recommend SPAs, it introduce a whole other class of issues on top of what you usually deal with. Google makes it work with Gmail and Youtube but it's Google, they can throw infinite engineers at any problem and could make those in pretty much anything.