This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (43)
- # boot (1)
- # cljs-dev (36)
- # clojure (29)
- # clojure-berlin (1)
- # clojure-greece (3)
- # clojure-italy (18)
- # clojure-russia (69)
- # clojure-spec (1)
- # clojure-uk (35)
- # clojurescript (31)
- # cursive (2)
- # data-science (2)
- # datomic (2)
- # emacs (6)
- # fulcro (1)
- # garden (1)
- # hoplon (8)
- # jobs-rus (1)
- # lumo (9)
- # off-topic (43)
- # onyx (8)
- # perun (2)
- # protorepl (5)
- # re-frame (11)
- # reagent (1)
- # shadow-cljs (19)
- # uncomplicate (140)
@dominicm not sure what the CLI flags are, but for ES6 you need to set
:language-in and for commonjs you need
@thheller I was doing something like that. But it wasn't outputting namespaces, just a bundle of everything together.
It seems like the closure library used to provide a python script to do this, closure builder, but it's deprecated and doesn't seem to support cjs namespaces
This is frustrating, because CJS code simply doesn't compile to a good namespace, and is just broke.
Is it perhaps more appropriate for me to officially report this to the cljs team, who can provide the equivalent settings to Google based on what's being done under the hood? I guess I'm moving towards figuring out how cljs uses closure, which might be a few days spelunking to figure out for a beginner to the code.
why do you need the sources? I think for closure the intention is to do as part of the optimization process
they added a new optimization level “BUNDLE” recently maybe that does what you need?
yes, and you want to reproduce a bug? but why do you need separate namespace to reproduce it?
The bug is to do with local vars vs global ones. They do
var in the generated code, which is fine when sharing (or so compilation suggests!), but not when separate.
goog.provide('module$foo'); var module$foo = ...; is that the
var you are talking about?
yeah I noticed that when I looked at https://github.com/google/closure-compiler/commit/3c0fed574dae980f6d32a9637672a7c9f003b3e8#diff-48f2a679dc3425ed572d9645cd98c776R960
not sure, I haven’t used the closure stuff much recently since it was way too unreliable in many cases
I wonder how this can be a problem because I have used Closure successfully with CJS modules
@dominicm are you running in the browser? did a quick test and the extra var definitely is not an issue there
A quick way to repro is to run through the js module sayHello, but port the es6 module to cjs