We can do better by keeping the majority of the app inside a webworker, and publishing state to the outer context. When a change is detected (probably a POST to some route from the gruntfile) a message is sent up to the browser basically saying "attention! your code is stale"
The webworker immediately notifies the outer context that it should begin fetching the new worker bundle.
Once pending requests have all been resolved, and the state has propagated to the outer context, then the outer context is notified that the worker is ready to be "rebooted"
A new webworker is spawned up and state is pushed into it to, while the machinery to the old webworker is removed.
We can do better by keeping the majority of the app inside a webworker, and publishing state to the outer context. When a change is detected (probably a POST to some route from the gruntfile) a message is sent up to the browser basically saying "attention! your code is stale"
The webworker immediately notifies the outer context that it should begin fetching the new worker bundle.
Once pending requests have all been resolved, and the state has propagated to the outer context, then the outer context is notified that the worker is ready to be "rebooted"
A new webworker is spawned up and state is pushed into it to, while the machinery to the old webworker is removed.