News for hackers. Stuff that matters.
Re:Your single-page app is now a polyfill by chrismorgan on Thursday October 08, 2020 @03:31AM (#24716788)
The trouble is trailing slashes and inconsistent behaviour between the service worker and the web server.

https://instantmultipageapp.com/images/ loads from the server, and not the service worker. Observe how it lacks the Blog link in the header, which is missing in what the server is rendering—see /images/index.html in the repository.

https://instantmultipageapp.com/images loads from the service worker, and the server serves /index.html for it (which is very wrong) rather than /images/index.html.

This is purely a bug in the demo. Kind of a fundamental bug that leaves me unimpressed, but a simple bug nonetheless. If you were to actually run the service worker on the backend, it’d resolve this kind of problem, and also the inconsistency between what the two platforms render, as seen in the missing Blog link.

Re:Your single-page app is now a polyfill by the_gipsy on Thursday October 08, 2020 @04:11AM (#24717026)
This is just one bug you found. There are more edge cases for sure, serviceworkers intercepting requests and caching is a nightmare.
Re:Your single-page app is now a polyfill by chrismorgan on Thursday October 08, 2020 @10:02AM (#24719155)
I think it’s better characterised in this way: service workers are dangerous because you can break things; so it’s very important that the foundations of your service worker are sound. If the foundations are sound (which takes effort), there’s nothing wrong with them. But ad hoc service workers, like this, are extremely dangerous.
Re:Your single-page app is now a polyfill by dannymoerkerke on Friday October 09, 2020 @01:59AM (#24727257)
Thanks for reporting. There were some problems on the backend but this has now all been solved.