-
Notifications
You must be signed in to change notification settings - Fork 9
refactoring of cljs build system
I suppose there could be two broad approaches:
If the web app is compiled with :advanced, it could perhaps dynamically consume new code if that code itself has known functions that are marked with :export. In that case you’d compile the new :advanced JavaScript and send it to the browser.
Alternatively, you could consider essentially keeping the entire body of code compiled with at most :simple and then either dynamically add new functionality by compiling new :simple code that is shipped to the browser. The main difference here is that all of the function entry points remain available.
Or, alternately, you could arrange to have the browser employ self-hosted ClojureScript and compile new code in the browser. Using self-hosted ClojureScript would result in more code being shipped to the browser, but it results in the most dynamic / flexible environment.
Dmitri Sotnikov was looking into dynamically adding new functionality to a web app written with ClojureScript and I had chatted with him briefly about marking cljs.core functions with :export in order to try to have your cake and eat it too with respect to :advanced and dynamically loaded code. It might be worth checking with him to see if they explored that approach.
- Mike