dev_compiler
dev_compiler copied to clipboard
Support in-browser state persistence
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."
Also, see: http://owenrh.me.uk/blog/2015/08/31/
As the blog link shows - scala.js also has some figwheel support.
:+1:
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.
+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