Hacker News new | ask | show | jobs
by k__ 3446 days ago
I tried the dynamic import/require once and it was really nice.

I could just write a normal SPA and require some stuff in every route, so the client only downloads the code that is used for the current page and things worked fine without extras needed.

1 comments

That almost sounds like server-side rendering :)
But SSR means you send everything around the content again and again.
If each page has different dependencies, you're not sending much duplicate content. Also, SSR supports incremental rendering (due to HTTP streaming), something that is currently impossible to do with SPAs.

See this article for more detail: https://jakearchibald.com/2016/fun-hacks-faster-content/