Fork me on GitHub
#shadow-cljs
<
2021-03-01
>
thheller14:03:54

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$$ 

🎯 3
raspasov14:03:57

It might be processing it through 7 dimensions 😝 (based on the number of G’s)

thheller14:03:30

I mean I know how it comes up with those but it is still kinda spooky to see sometimes

thheller18:03:52

you can put a cljs/closure.clj with just (ns cljs.closure) on your classpath

thheller18:03:04

then you can update the closure-compiler version which has the fix

thheller18:03:12

(in theory, haven't tried)

Alexis Vincent18:03:47

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.}]}

thheller18:03:49

David is working on this currently

Alexis Vincent18:03:14

Thanks. Will see what I can get right

fsd19:03:51

Is it possible to view shadow cljs React App on a Mobile Device that is connected to same network?

thheller19:03:36

sure. just open it in the browser. just need to know the IP of your machine.

fsd19:03:14

Perfect thanks man :)

Alexis Vincent19:03:10

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 branch

thheller19:03:22

need to update shadow-cljs too 🙂

thheller19:03:03

oh nevermind. I haven't released the version with the fix yet.

thheller19:03:06

hang on I can do that now

thheller19:03:33

@mail024 2.11.19 should fix that

Alexis Vincent19:03:48

Shweeeet. Will give it a go

Alexis Vincent19:03:00

The required namespace "goog.result" is not available, it was required by "shadow/xhr.cljs".
might be another removal

Alexis Vincent19:03:36

Against bump-closure

thheller19:03:29

don't bump the closure library for now

thheller19:03:32

closure-compiler is enough

Alexis Vincent19:03:41

Ah, I’m just using David’s branch. Dont really know what you mean by the cljs/closure.clj thing.

Alexis Vincent19:03:35

Do i just add an exclude and drop the dep down

Alexis Vincent19:03:39

org.clojure/google-closure-library {:mvn/version "0.0-20201211-3e6c510d"}

thheller19:03:00

you put the file on the classpath. meaning you take one of your source-paths and put the file there

thheller19:03:08

src/main/cljs/closure.clj or so

thheller19:03:23

then you can stick with older CLJS version or rather the current 1.10.773

Alexis Vincent19:03:31

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

Alexis Vincent19:03:42

maybe i found the wrong one

thheller19:03:49

as I said ... just (ns cljs.closure) nothing else

thheller19:03:59

shadow-cljs does not use that file at all, so it can be empty

thheller19:03:18

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

Alexis Vincent19:03:40

thanks. Will give that a go

thheller19:03:53

but since nrepl is started by default its best to just replace the file temporarily

thheller19:03:17

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

thheller19:03:21

current version should though

thheller19:03:40

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

Alexis Vincent19:03:21

Yeah. With you on that! Just thought i needed to overwrite the file with something useful.

Alexis Vincent19:03:56

Whoop whoop!!! It compiled without errors on the new closure compiler!

Alexis Vincent19:03:10

Thanks @thheller. Appreciate it!