Hi! I wrote a library using Google Closure and I used the new goog.module
instead of the old goog.provide/require
, but unfortunately it doesn’t work with CLJS. I know that the code cljs emits uses goog.provide
but here https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide#how-do-i-use-a-googmodule-from-a-traditional-closure-file is a method to require goog.module
files in goog.provide
ones which I think would be cool if cljs supported.
If one would like to take a stab at it are the recommendations here https://clojure.atlassian.net/browse/CLJS-1543 valid?
@g7s this would be a pretty big effort I think. CLJS lags the closure library pretty significantly and uses a rather old version where the debug loader doesn't support this I believe
@thheller so you say that a first step would be to update the closure library that cljs uses..
I get that this would be a significant effort by itself
I'm not sure but I think so yes
I think the version currently used only supports loading regular goog.provide/require files
versions after that added a optional transpile step support for modules (es6 or goog)
but depending on the goog.module style you use it might work with the old version
transit uses goog.module and works fine
ah no sorry. not goog.module, goog.scope
you can try shadow-cljs and see if goog.module works. I think it should.
From my little experience trying to make it work, it seems that goog.scope works with current cljs. I will try with shadow or I will have to switch the library to the old style
there is some compatibility mode that should work
plain goog.module without scope requires compilation or a loader that does that
do you mean the goog.module.declareLegacyNamespace thing?
yes
thanks I will see what I can do for the moment