Moving away from SPAs


There’s probably like 1000 medium posts about how to move towards a single-page-application.

I’m interested in how to move away from that. How would you approach migrating from a large SPA to progressively enhanced server side rendered views without blowing up everything? 🔗

So yeah, I’m seriously looking for advice on this. 🔗

I guess one could slowly remove routes from the SPA and replace them with HTML views until nothing is left.

But that means for example that users would frequently have to re-initialize the SPA everytime they go from a new view to an old one, at great CPU (and battery) cost. 🔗

Like, one of the main promises of SPAs was that only the initial load is heavy and the view transitions are cheap. I don’t think that was ever really true but this approach would make it far worse. 🔗

Also, I definitely wouldn’t want to move the whole view stuff back into the monolithic app that it came from. I think the API/presentation separation is a useful one. I’m thinking more like “Browser talking to a small and fast rendering server that talks to the actual API”. 🔗

You know, kind of like how GraphQL let’s you bundle different data sources (APIs) into one, just that in this case, the last step is just HTML and the client is already on the user’s machine because it’s the browser itself.

(Feeling old already? because I sure am) 🔗