3 ms·
> Automatic code splitting, routing and client-side rendering are necessities to provide websites that don't require a full screen repaint and server request to
by Touche 10y ago
> Automatic code splitting, routing and client-side rendering are necessities to provide websites that don't require a full screen repaint and server request to change small stuff.
Client-side routing is rarely used to change small stuff. It's usually used to replicate an entire page transition.
> When well-executed, it provides a better experience to the average user.
It's rarely well-executed. Client-side routing means you have to replicate every feature of browser routing, and most frameworks get it wrong. Numerous issues like not supporting cmd/ctrl+click to open in a new tab, ext, are common.
> Hot code reloading is a way to test changes without dropping current state, something that's extremely handy during development to avoid wasting time replicating said state every time.
Like the GP said, this is a self-created problem. Separate development pages to test out small parts of an application is how you avoid replicating state. But today's web development environment is so wrapped up in tooling and build complexity that creating a new page to test out a small part of the application is actually really hard to do.
- NoGravitas 10y agoYou are so absolutely right. For content focused sites (specifically excluding things that really have to be done all client-side), it is practically always better to use pjax/hijax to enhance a server-rendered app. As far as what's available now, I find that intercooler.js provides the right balance. So much of the SPA ecosystem seems to exist to solve self-created problems.
- always_good 10y ago> Separate development pages to test out small parts > of an application is how you avoid replicating state. > But today's web development environment is so wrapped > up in tooling and build complexity that creating a new > page to test out a small part of the application is > actually really hard to do. I don't think you understand what "hot code reloading" means, because isolating a widget on a separate page isn't a solution to what hot code reloading solves. It's not just a browser auto-refresh when you save a file. It's the browser refreshing with the same state that was on the page. Even if you isolate a somewhat complicated <form> on its own /form-test-page, you still don't want to drill down into the form state you're testing as you make changes to the UI. For example, it would remember that you had the datepicker open with Jan 2017 - Oct 2018 selected as you fix a bug regarding the cross-year boundary. Stuff like that, useful any time you have some Javascript on the page.