Settings

Theme

Dealing with releases of single page applications

beepsend.com

10 points by xintron 10 years ago · 12 comments

Reader

swalsh 10 years ago

If this was a problem I was truly concerned about, i'd attack it with discipline and tinkle bit of versioning. If you're making a breaking change to the API perhaps you should increment the major version, and support both, and then sail away the old API when you feel comfortable doing so.

yoursite.com/api/v1/call

yoursite.com/api/v2/call

  • hankeypancake 10 years ago

    Yes, api versioning would be nice. However, with limited resources (as always) this takes you very far without it. Api versioning also only handles breaking api changes (which this doesn't really protect you from, depending on how the users act to the notification), this also notifies the users to refresh their browsers for hotpatches regarding the frontend, and also regular feature releases. So even if you have api versioning in place, I still see benefits from having this in place

davidjnelson 10 years ago

Cool idea and article.

Hot reloading deployed production applications is a really intriguing feature of meteor.

I'll bet something similar could be built if someone was using react and redux. Sort of like the local development hot reloading with react-transform-hmr, but running in production. This would make it automatic instead of requiring a browser reload and erasing the users current ui state. The trick would be in optimizing the performance. Using a websocket instead of polling would be a bit more efficient too.

  • hankeypancake 10 years ago

    Agree on all points. We don't automatically reload the browser though, so it's up to the user to actually get the new version, otherwise people would be very angry with us..

    The main reason we did it this way, is that it is really really simple and quick to implement.

    Thanks for the input!

takno 10 years ago

Does anybody have any good solution to this when caching offline services through a service worker? Obviously in this scenario even a page refresh doesn't help.

ChemicalWarfare 10 years ago

Sounds like a workable solution.

That said, the way I would've architected this is I'd include a build version # into the distro and provided a checkVersion backend service that would return the current build version # for the client side logic to compare it's build # to.

And if you want to go an extra mile maybe a shouldRefresh service that would only return "true" if the changes that were made require a refresh on the client side.

  • hankeypancake 10 years ago

    That crossed my mind as well. Though, that would require both frontend and backend code. This takes around 20-40 lines of javascript and works exactly as intended, and doesn't require maintenance in two or more different places

lossolo 10 years ago

Or you could use framework like for example ember.js and have it out of the box.

th0br0 10 years ago

Why not simply edit the HTML5 appcache manifest? (i.e. add a commented-out timestamp)

  • hankeypancake 10 years ago

    I'm not very familiar with appcache, but reading a bit about the specifics it looks like it would work fine as long as you don't need IE<=9 support. Thanks for the input!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection