Fork me on GitHub
#cljs-dev
<
2021-03-05
>
raspasov07:03:45

I have a React Native project with figwheel-main. Bumped ClojureScript to this :sha 715cdc07dbb1d595af91ea12affb6faf0b615d4b I get the following warnings during compilation: https://gist.github.com/raspasov/7e3bdf03d60af47e71a9bc738fb8382e After that, the app launches, but the REPL does not connect.

raspasov07:03:46

Also, once the app launches you get the following error (screenshot attached) which I believe is connected to the warnings during compilation (but you can dismiss the error and the app works, but still no REPL connection): https://gist.github.com/raspasov/7e3bdf03d60af47e71a9bc738fb8382e#gistcomment-3654498

raspasov07:03:32

Did some of the goog.log functions introduce breakage?

thheller07:03:35

the closure-library changed a lot of stuff regarding goog.log. so figwheel seems to use some stuff that they changed and broke

3
raspasov07:03:08

Yeah, it seems they used to take 2 args, but now they don’t.

raspasov07:03:24

“Compile Warning: Wrong number of args (2) passed to goog.log/error” etc, etc and other functions

thheller07:03:25

nah that wouldn't cause breakage, just the warnings

thheller07:03:53

the runtime stuff is calling code that was removed, that is the real issue

mikejcusack13:03:42

The code isn't removed. For some reason the line in question is using a ' at the end of the var, which I've never seen before. https://github.com/bhauman/figwheel-repl/blob/43f3e0dcb11e95f85800d81f795f32d5cc8a38a4/src/figwheel/repl.cljc#L618

mikejcusack13:03:58

Oh, I see. They changed how it works. So it should be (glog/setLevel logger' lvl)

thheller13:03:31

logger' is just a normal CLJS variable name. nothing special regarding that, just looks a bit odd.

mikejcusack13:03:28

Was told that in the other thread. I've never used it so it was just confusing to see. I resolved the actual issue with the above change.

mikejcusack13:03:59

:figwheel {:extra-deps {com.bhauman/figwheel-core {:git/url ""
                                                   :sha "fb1aa3ea465e1b34aaa0b07065b7b0bca2c931c5"}
                        com.bhauman/figwheel-main {:git/url ""
                                                   :sha "9be32e51c72cab21a71b643c350474eec3b55a72"}
                        com.bhauman/figwheel-repl {:git/url ""
                                                   :sha "b155e7631501f90921cf2a7505055fe2c937214c"}}}

raspasov07:03:22

I guess that causes the REPL not to connect?

thheller07:03:40

you can just downgrade the closure-library version used. that should make it work again.

thheller07:03:11

yeah some of the code seems to cause an exception and if that happens during the code load the later code is not executed

thheller07:03:19

so I guess it never gets to the REPL connect part

raspasov07:03:35

@thheller thanks, do you know how I can downgrade easily google closure while staying at the latest :sha ? Via deps.edn or package.json ?

thheller07:03:18

just add a direct dependency in deps.edn to the previous version

👍 3
raspasov07:03:42

Thanks 🙂

raspasov07:03:29

Downgrading to: org.clojure/google-closure-library {:mvn/version “0.0-20191016-6ae1f72f”} … fixes it.

raspasov07:03:22

while staying at:

org.clojure/clojurescript                 {:git/url "" :sha "715cdc07dbb1d595af91ea12affb6faf0b615d4b"}

dnolen12:03:00

I also hit some bumps trying to get the latest ClojureScript work with our React Native project - and yes most of the issues seem Closure Library related. Would like to work through the issues so we can offer some guidance in the release notes.

dnolen12:03:33

Over here they seemed related to the Metro not liking some patterns in ES6 Closure libs

raspasov12:03:54

@dnolen under :advanced or under dev builds ?

raspasov12:03:32

(I haven’t tried :advanced with the new ClojureScript + React Native/metro … )

mfikes12:03:23

Looks like a few Canary projects broke (I haven't looked deeply yet) https://github.com/cljs-oss/canary

raspasov12:03:10

cljs-oss/canary is such a good idea. Didn’t realize it existed 🙂

kommen12:03:47

initial results from Nextjournal: apart from having to fix our logging library due Closure Library changes related to logging, all seems good

kommen12:03:10

these are the the preliminary changes, still have to work through the docs as there are more apis deprecated now it seems https://github.com/nextjournal/glogi/commit/d17e48da78f2ae24938104b7ee2567023b9bc007

raspasov12:03:42

FWIW, my React Native projected built successfully with :advanced with the new ClojureScript + downgraded google-closure (it’s a fairly small project with not too many deps.edn dependencies at the moment)

dnolen12:03:16

@raspasov dev builds

👍 3
dnolen12:03:05

@kommen ok good, we'll add this to the release notes - if people list the other apis that changed that would be useful

dnolen12:03:16

@raspasov that's good to know, that it can work for you

3
dnolen12:03:17

@mfikes that's actually better than I expected

dnolen12:03:42

bumped Closure again - no problems this time

souenzzo13:03:24

I'm looking at canary fulcro issues: WARNING: Use of undeclared Var goog.math.Long/fromBits at line 64 resources/private/js/unit-tests/clojure/test/check/random/longs.cljs This look like a clojure.test issue, right?

borkdude13:03:01

clojure.test.check actually

souenzzo13:03:19

Here a list:

;; clojure.test
"goog.math.Long/fromBits clojure/test/check/random/longs.cljs:64"
"goog.math.Long/fromNumber clojure/test/check/random/longs.cljs:81"
"goog.math.Long/fromNumber clojure/test/check/random/longs.cljs:87"
"goog.math.Long/fromString clojure/test/check/random/longs.cljs:77"
"goog.math.Long/getOne clojure/test/check/random/longs.cljs:92"

dnolen14:03:11

gotta say - adding the goog fn parsing was a good idea 😛

juhoteperi14:03:42

@mfikes Do you remember what was the problem with Reagent tests on Canary? Maybe due to switch to CircleCI from Travis? https://github.com/cljs-oss/canary/commit/16de8e6fb1eb1a32b5ec364dbaad2fd1b2d80676

Alex Miller (Clojure team)15:03:52

@dnolen @mfikes btw, I just released a new version of data.json (1.1.0). has one small bug fix but also updates some of the build infrastructure stuff and defaults to clojure 1.8 dep now, but perhaps of importance to you I enabled direct linking on the aot compiled classifier version you use. It's a bit smaller (81k->75k) and should presumably be slightly faster too.

👍 6