sometimes you really have to wonder what the closure-compiler is doing to the code when this is the "best" pseudo-name it can come up with for a local variable is
$G__37663_G__37667_G__37671_G__37675_G__37682_G__37686_G__37691_anchor_37656_old_coll_37645_old_items_37652$
$G__37664_G__37668_G__37672_G__37676_G__37683_G__37687_G__37692_idx_37657_new_len_37651$$
I mean I know how it comes up with those but it is still kinda spooky to see sometimes
It might be processing it through 7 dimensions 😝 (based on the number of G’s)
@thheller Is there an application level fix I can apply to get around -> https://github.com/thheller/shadow-cljs/issues/846#issuecomment-788183542
you can put a cljs/closure.clj
with just (ns cljs.closure)
on your classpath
then you can update the closure-compiler version which has the fix
(in theory, haven't tried)
maybe this branch of CLJS also works https://github.com/clojure/clojurescript/tree/bump-closure
Being thrown when Closure hits @stitches/react
, required by https://github.com/pmndrs/leva , I’ve tried setting
{:js-options {:resolve {"@stitches/react" {:target :npm
:require "@stitches/react/dist/stitches.react.esm.mjs"}}}})
but that doesnt seem to actually change the file being resolved
as can be seen
#error {
:cause closure errors
:data {:tag :shadow.build.closure/errors, :errors [{:resource-name node_modules/@stitches/react/dist/stitches.react.cjs.cjs, :source-name node_modules/@stitches/react/dist/stitches.react.cjs.cjs, :line 2, :column 1218, :msg Class names defined inside a function cannot be reassigned.} {:resource-name node_modules/@stitches/react/dist/stitches.react.cjs.cjs, :source-name node_modules/@stitches/react/dist/stitches.react.cjs.cjs, :line 2, :column 1229, :msg Class names defined inside a function cannot be reassigned.} {:resource-name node_modules/@stitches/react/dist/stitches.react.cjs.cjs, :source-name node_modules/@stitches/react/dist/stitches.react.cjs.cjs, :line 2, :column 4095, :msg Class names defined inside a function cannot be reassigned.}]}
David is working on this currently
Thanks. Will see what I can get right
Is it possible to view shadow cljs React App on a Mobile Device that is connected to same network?
sure. just open it in the browser. just need to know the IP of your machine.
Perfect thanks man :)
Using bump-closure
I hit
Syntax error (ClassNotFoundException) compiling at (shadow/build/closure.clj:1:1).
com.google.javascript.jscomp.AnonymousFunctionNamingPolicy
Do you see a quick fix? Or should I wait. Seems like David is pretty active on the branchneed to update shadow-cljs too 🙂
oh nevermind. I haven't released the version with the fix yet.
hang on I can do that now
🎉 🙏
@mail024 2.11.19
should fix that
Shweeeet. Will give it a go
The required namespace "goog.result" is not available, it was required by "shadow/xhr.cljs".
might be another removalAgainst bump-closure
don't bump the closure library for now
closure-compiler is enough
Ah, I’m just using David’s branch. Dont really know what you mean by the cljs/closure.clj
thing.
Do i just add an exclude and drop the dep down
org.clojure/google-closure-library {:mvn/version "0.0-20201211-3e6c510d"}
you put the file on the classpath. meaning you take one of your source-paths and put the file there
src/main/cljs/closure.clj
or so
then you can stick with older CLJS version or rather the current 1.10.773
No i get that. But im not sure what to put inside. When i found the file in the clojurescript repo it looked very long
maybe i found the wrong one
as I said ... just (ns cljs.closure)
nothing else
shadow-cljs does not use that file at all, so it can be empty
Oh right.
cool
it is nrepl piggieback loading that file so if you don't need that then you don't need to worry about that at all either
thanks. Will give that a go
but since nrepl is started by default its best to just replace the file temporarily
oh and it might matter which tools.deps version you use too. since older versions didn't put source-paths first this trick might not work there
current version should though
basically by putting it one the :paths
(or :source-paths
if just shadow-cljs.edn
) you are "overwriting" the file in the clojurescript released jar
Yeah. With you on that! Just thought i needed to overwrite the file with something useful.
Thanks!
Whoop whoop!!! It compiled without errors on the new closure compiler!
Thanks @thheller. Appreciate it!