This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-04
Channels
- # announcements (9)
- # bangalore-clj (1)
- # beginners (164)
- # calva (7)
- # clj-kondo (12)
- # cljs-dev (5)
- # cljsrn (7)
- # clojure (100)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (9)
- # conjure (22)
- # datomic (53)
- # fulcro (62)
- # graalvm (27)
- # helix (10)
- # joker (6)
- # malli (1)
- # mount (4)
- # nrepl (3)
- # off-topic (8)
- # quil (1)
- # releases (1)
- # sci (42)
- # shadow-cljs (1)
- # testing (7)
- # tools-deps (26)
- # vim (24)
Hi. I am trying to load a js file from the classpath with cljs, like this:
goog.declareModuleId('jstest.es6demo');
...
export {Foo}
but I see that clojurescript's grepping doesn't include one for declareModuleId
https://github.com/clojure/clojurescript/blob/a19f8e04dc0971f13316a8dd584156e2ffb67b96/src/main/clojure/cljs/js_deps.cljc#L119
I'm planning to have a go changing cljs compiler locally to see if adding a new regex gets the compile working, but anyone knows why that wouldn't work etc please let me know.
FYI I have a demo repo showing compiling this with Closure directly and attempt at using it from cljs https://github.com/henryw374/cljs-using-non-foreign-es6I have now got the example in the demo repo compiling, having added this commit to the compiler: https://github.com/henryw374/clojurescript/commit/745fe924a43f426a4eb86f6b9df04fc463320b27
@henryw374 why don't you just use goog.module? why does it have to be es6?
@thheller I've got some existing es6 code that I want to get the full Closure advanced compilation treatment (and I have tested that Closure dead code elim works on it by compiling with Closure directly). I can modify the es6 files, but want to change as little as possible. So it looks like just prepending goog.declareModuleId
will suffice ... with small cljs compiler change (see my reply to my prev. message)