DEV Community

Discussion on: Routing: I’m not smart enough for a SPA

Collapse
 
jon49 profile image
Jon Nyman

Your post inspired me to rewrite my app in an MPA style with minimal JS. Granted it is an offline app so it is all JS but it is written from a service worker. It really simplifies things. Make a post on a form - no problem, just refresh the page! I still get the occasional white flash on the page when going between pages, which is annoying. But the simplicity is amazing.

I'm excited for your next posts!

github.com/jon49/WeightTracker/tre...

Collapse
 
tigt profile image
Taylor Hunt

Oh damn! I am going to be reading the heck out of this code — you may have pulled off what I was trying to demonstrate for the next post faster than I could!

Collapse
 
jon49 profile image
Jon Nyman • Edited

lol, Thanks. Yeah, it isn't the first time that I've attempted this. That's why I was able to do it so fast. I've been fascinated about running an app from a service worker ever since I heard Chris Love say that service workers are the death of SPAs.

I have actually created a module loader to load JS on-the-fly from a service worker so you can have a pretty large app. But it was too much work and I just wanted to finish the app. So, I ended up making it with HTMF and Razor Pages (C#).

github.com/jon49/MealPlanner/blob/...

Chris Love's website: love2dev.com/