News for hackers. Stuff that matters.
Re:The future of web software is HTML over WebSockets by cogman10 on Thursday February 25, 2021 @03:34PM (#26267897)
Here's another one. How do you deploy a new version of your service?

Imagine a few customers open up your site and leave for lunch. Or maybe just a random crawler or bot sitting watching for some piece of information they are scraping.

These sorts of issues can be challenging with stateless connections. I can only imagine how daunting they are with persistent connections.

Re:The future of web software is HTML over WebSockets by meheleventyone on Thursday February 25, 2021 @04:59PM (#26268875)
The nice thing about persistent connections is that you know when they’ve been closed so you could literally signal that the connection was going down for a deployment and close everyone’s connection. Clients can retry the connection until it comes back up or use another service to monitor the status.

Games basically do this routinely.

Re:The future of web software is HTML over WebSockets by rootusrootus on Thursday February 25, 2021 @05:58PM (#26269423)
But you can do that sort of communication already with existing websockets, without trying to add the complexity of pushing all your regular traffic over that link.
Re:The future of web software is HTML over WebSockets by madeofpalk on Thursday February 25, 2021 @06:29PM (#26269715)
Well, this problem exists at the moment. To be honest sockets is one approach to fix it.

What happens if a webpage is loaded over plain old HTTP and then over lunch a breaking change is deployed. The page the user loaded before lunch is now no longer compatible.

Re:The future of web software is HTML over WebSockets by mikeryan on Thursday February 25, 2021 @11:15PM (#26271303)
Compatible with what?

It’s stateless. If the api changes from underneath and you’re polling or something, then just show an error, have the user refresh the page and move on. Or use any of the various api version mechanisms for backward compatibility. It’s not an easy problem but it’s a fairly well understood and managed one. Solving this kind of known problem isn’t, to me, a very compelling case for HTML over sockets.

Re:The future of web software is HTML over WebSockets by bitsen on Thursday February 25, 2021 @05:43PM (#26269271)
I bet your ass that at least half of the developers reading HN don’t have caching of JS fully figured out such that when the JS changes server-side and immediately needs reloading on the client side that it does then and there instead of on the next request, the next page refresh, or never because they’ve f’d it up.

With server-fed, event-driven pages, you could potentially force refresh.

Re:The future of web software is HTML over WebSockets by galaxyLogic on Friday February 26, 2021 @02:01AM (#26272051)
I leave the browser waiting for a fetch-response from the server. The server responds only later when the page that is open in the browser was updated on server. Seems to work much of the time, but sometimes it seems Chrome closes the connection after a timeout and shows a network error in the dev-tools. FireFox not.

I assume web-sockets could make it work more robustly.

Re:The future of web software is HTML over WebSockets by lootsauce on Thursday February 25, 2021 @10:45PM (#26271167)
my solution to version changes in a rest api is to sent a version header with every response, the app checks it and if it does not match reloads the page, thus loading the new js.
Re:The future of web software is HTML over WebSockets by mikeryan on Thursday February 25, 2021 @11:17PM (#26271317)
I would not accept your wager. That being said if this was a “really big problem” I’d bet you that most developers on HN would have an idea how to address it.
Re:The future of web software is HTML over WebSockets by m00dy on Thursday February 25, 2021 @04:32PM (#26268597)
it is called hot-reload.