dev_compiler icon indicating copy to clipboard operation
dev_compiler copied to clipboard

Support in-browser state persistence

Open vsmenon opened this issue 10 years ago • 5 comments

There's a Clojure tool called Figwheel that does the following:

"Basically, as soon as you save the file you are working on (ClojureScript, HTML, or CSS) figwheel will load the changes into the browser, without you having to refresh. This on its own would be handy. But where it goes from being handy to being awesome is that, in most cases, figwheel will maintain your current in-browser state.

This means if you’re half-way through a wizard, or the like, you don’t have to enter all the data again from scratch, with every code change. You get a real-time, super-iterative, development experience that is light years ahead of other transpiling languages and frameworks."

vsmenon avatar Sep 01 '15 16:09 vsmenon

Also, see: http://owenrh.me.uk/blog/2015/08/31/

vsmenon avatar Sep 01 '15 16:09 vsmenon

As the blog link shows - scala.js also has some figwheel support.

vsmenon avatar Sep 01 '15 16:09 vsmenon

:+1:

jmesserly avatar Sep 01 '15 16:09 jmesserly

Worth looking at the Scala.js limitations:

This live splicing is not doable in the general case, but only for some subset of changes:

Changes inside method bodies Adding new defs and lazy vals to classes/objects Creating entirely new classes/objects This means that there are many changes that spliceBrowsers does not support, such as.

Adding new vals and vars to classes/objects Modifying inheritance hierarchies Changing the type of an existing val/var/lazy val Renaming classes

I think this maps to summary-visible changes vs summary-invisible changes.

vsmenon avatar Sep 01 '15 17:09 vsmenon

+1, figwheel is awesome! I use figwheel for clojurescript. And for ES6 I use webpack with react-hot-reloader which gives you the same functionality. https://github.com/webpack/docs/wiki/hot-module-replacement-with-webpack

jonaskello avatar Oct 18 '15 17:10 jonaskello