re-natal icon indicating copy to clipboard operation
re-natal copied to clipboard

Accommodate new Closure Library dependency loading strategy

Open mfikes opened this issue 6 years ago • 2 comments

Closure Library has made some internal changes which break clients using internal API. ClosureScript's shipping REPLs use private API, and updates are being made via CLJS-2702.

One such private API change is the removal of goog.writeScriptTag_ (which is used in re-natal here).

If you build a version of ClosureScript that uses the latest Closure Library, and then try to use re-natal with that version, you will see it log "Cannot use default debug loader outside of HTML documents", and if you dismiss this, you will see that it indicates it is still waiting for Figwheel to load files. If you add this to the bottom of shimBaseGoog in figwheel-bridge.js:

goog.global.CLOSURE_IMPORT_SCRIPT = goog.writeScriptTag_;

then you can dismiss the log an the app will launch, but Figwheel will not connect. This change is motivated by a similar change in the patch in CLJS-2702 for the shipping browser REPL, but it is evidently insufficient to get things fully working in re-natal.

So, even though the complete solution is not known yet, I'm logging this ticket so we can gather relevant information so that re-natal has a solution ready if / when the new Closure Library starts being shipped with ClojureScript. If it proves difficult to find a solution, then one expected workaround would be to have re-natal clients override the Closure Library dependency so that the older one is used. (ClojureScript's revisions are being done in a way that can accommodate both the older and newer ClosureLibrary code, conditionally switching at runtime; perhaps re-natal can do the same to maximize flexibility.)

Note: To build ClojureScript with the new Closure Library involves running script/closure-library-release/closure-library-release.sh in that repo, updating project.clj and other files to reflect the newly build version (see this commit as an example), running script/bootstrap and then manually copying the google-closure-library-0.0-20180503-da9add34.jar and google-closure-library-third-party-0.0-20180503-da9add34.jar files into lib (replacing the version numbers as appropriate) and then doing script/build.

mfikes avatar May 06 '18 17:05 mfikes