Giter Club home page Giter Club logo

requirejs-reload's People

Contributors

lddubeau avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kafkaforks

requirejs-reload's Issues

reloading requirejs

hey Sr. Louis

I saw your answer on SO here:
http://stackoverflow.com/questions/19966133/how-to-reload-a-file-via-require-js-triggered-from-the-browsers-js-console

I saw a video of some folks doing hot-reloading with React + Webpack. Thought it could possible with RequireJS, at least with views (not stores).

I have a question though. Say I reload all the .js files for a view.
I assume I would have to call .render() again after loading the views (whether react or backbone) so that the html in the view is actually updated, right? If I don't call render(), nothing visible will happen, right?

The nice thing about all this is it avoids refreshing the page and losing state.

It would be really cool if you could describe a detailed step-by-step workflow on how this functionality is intended to be used.

I will make an attempt here and now, please correct me:

(1) make a globally defined (window.reload) function that will take arguments in the form of paths to files
(2) create some mechanism to invoke that function given an event (a button that gets clicked)*
(3) you click that button and the reload function will undef the current files and then request those files from the server and put the new files in the same places as the old files
(4) you will need some further action to actually show the difference between the old and new JS, and think that means you will have to call .render() again

can you please correct this? thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.