4 ms·
> the framework should do automatic code-splitting at the route level, and support dynamic import(...) for more granular manual control I disagree! Code-splitt
by _greim_ 9y ago
> the framework should do automatic code-splitting at the route level, and support dynamic import(...) for more granular manual control
I disagree! Code-splitting is arguably an architectural dead-end for SPAs:
1) It adds a non-trivial layer of complexity to both your application logic and your tooling. SPAs (and the JS ecosystem in general) are already complicated enough without this extra layer of indirection, and that complexity carries a higher cost than most people realize, especially when it's blindly accepted across the industry as best practice.
2) It's based on the conflation of apps with collections of hypertext documents, whereas in reality these are different architectures with different trade-offs. We're under no such delusions for apps in the app store for example, and thus nobody bats an eye if one takes a full minute to download.
I guess this isn't what people want to hear, but the web is more than apps, and we need to stop pushing SPA as the default way to build every new website. Code-splitting is merely the by-product of choosing the wrong architecture. In cases where SPA is the right tool for the job, we need to make users aware that they're downloading an actual app. I.e. a one-time install screen implemented via some kind of service-worker-driven bootstrapper: "Just a moment while we install your app..."
- lfischer 9y agoIt’s an interesting idea. From the case studies you’ll find on the web, it looks like Progressive Web Apps want to play minimal bootstrap time as as card against native apps, but it’s true that re-use of existing web know-how could be enough arguments in their, although native app developers are getting almost as easy to find as web developers these days.