Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I was inspired by a video on hotswapping JS files with React + Webpack for the web. I started trying it out with React + Backbone + RequireJS.

Seems to work, as long as I stick to the stateless parts of the code. I get really confused however, when I start thinking about what would happen if I swapped out some JS code that had Backbone Models or Collections. I simply don't understand what would happen if a model file got swapped out - would things work and still reference the same objects in memory? Or could any small tweak completely break everything?

With stateless functional code, a small tweak doesn't matter, because the code is only transforming the data moving through it - the code is not retrieving data in memory?

How might swapping out .js files that represent state work? What are the limitations and when would it work?

share|improve this question
2  
Asking for links to resources on other sites is off-topic here, so I edited out that part of your question. Also, while I think this question is potentially very interesting, it is a bit broad in its current form. Are there any specific problems you're hoping to solve using this technique? –  Ixrec Aug 28 at 21:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.