Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous deployment of a single-page app?

Here's the only solutions I've come up with (don't know if they're the adequate though):

Server-side updates:

Version every client request and have the proxy route to the appropriate server version.

Cient-side updates:

Notify the client over a websocket connection to re-inject the script/style tags after X number of idle minutes thereby invoking 2 ajax requests for updated JS/CSS files and refresh the HTML of the page.

I don't know if this is something that shouldn't be a priority in the early stages of the app and I should just take the entire app down for "scheduled maintenance" in the early hours of the morning.

For SEO purposes, the front page's HTML is sent by the server along with the single JS/CSS file.

like image 584
paulkon Avatar asked Sep 03 '13 21:09

paulkon


1 Answers

I think the Right Thing (tm) is to make build your single page application in a way where it consumes RESTful API which is public quality. In other words, think about it as if you are publishing your API to the world and when making changes make them backwards compatible. I think this is not as hard as it might think and will leave you with a cleaner system. Certainly better than building a complex versioning and live patching scheme!

like image 155
MK. Avatar answered Sep 30 '22 09:09

MK.