cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
raspasov 2021-03-05T07:40:45.039200Z

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.

raspasov 2021-03-05T07:46:46.040300Z

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

raspasov 2021-03-05T07:47:32.041Z

Did some of the goog.log functions introduce breakage?

thheller 2021-03-05T07:47:35.041200Z

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

✅ 1
raspasov 2021-03-05T07:48:08.041700Z

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

raspasov 2021-03-05T07:48:24.042200Z

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

thheller 2021-03-05T07:48:25.042300Z

nah that wouldn't cause breakage, just the warnings

thheller 2021-03-05T07:48:53.042900Z

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

mikejcusack 2021-03-05T13:05:42.060900Z

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

mikejcusack 2021-03-05T13:10:58.062500Z

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

thheller 2021-03-05T13:45:31.063400Z

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

mikejcusack 2021-03-05T13:46:28.063600Z

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.

mikejcusack 2021-03-05T13:46:59.063800Z

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

raspasov 2021-03-05T07:49:22.043200Z

I guess that causes the REPL not to connect?

thheller 2021-03-05T07:49:40.043700Z

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

thheller 2021-03-05T07:50:11.044300Z

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

thheller 2021-03-05T07:50:19.044700Z

so I guess it never gets to the REPL connect part

raspasov 2021-03-05T07:51:35.045700Z

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

thheller 2021-03-05T07:52:18.046Z

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

👍 1
raspasov 2021-03-05T07:52:42.046300Z

Thanks 🙂

2021-03-05T07:53:18.046400Z

Seems like shadow requires a certain version of cljs, how do I test cljs with git deps in a project using shadow?

thheller 2021-03-05T07:54:39.046600Z

it doesn't require a specific version in general but certain combinations of shadow-cljs/CLJS/closure-compiler/closure-library have issues

thheller 2021-03-05T07:55:01.046800Z

current master shadow-cljs + CLJS master + latest closure-compiler/library work

thheller 2021-03-05T07:55:19.047Z

git deps you can't do with pure shadow-cljs.edn. deps.edn works as usual, nothing special there.

raspasov 2021-03-05T07:57:29.047500Z

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

raspasov 2021-03-05T07:58:22.047900Z

while staying at:

org.clojure/clojurescript                 {:git/url "<https://github.com/clojure/clojurescript>" :sha "715cdc07dbb1d595af91ea12affb6faf0b615d4b"}

dnolen 2021-03-05T12:00:00.050600Z

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.

dnolen 2021-03-05T12:00:33.051400Z

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

raspasov 2021-03-05T12:01:54.051800Z

@dnolen under :advanced or under dev builds ?

raspasov 2021-03-05T12:02:32.052300Z

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

mfikes 2021-03-05T12:11:23.052800Z

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

kommen 2021-03-05T12:17:47.055400Z

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

raspasov 2021-03-05T12:18:10.055900Z

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

kommen 2021-03-05T12:19:10.057800Z

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

raspasov 2021-03-05T12:19:42.058200Z

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)

dnolen 2021-03-05T12:25:16.058700Z

@raspasov dev builds

👍 1
dnolen 2021-03-05T12:26:05.059300Z

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

dnolen 2021-03-05T12:26:16.059600Z

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

✅ 1
dnolen 2021-03-05T12:29:17.060100Z

@mfikes that's actually better than I expected

dnolen 2021-03-05T12:37:42.060400Z

bumped Closure again - no problems this time

souenzzo 2021-03-05T13:11:24.062700Z

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?

borkdude 2021-03-05T13:23:01.062900Z

clojure.test.check actually

souenzzo 2021-03-05T13:56:19.064500Z

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"

dnolen 2021-03-05T14:30:11.065400Z

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

juhoteperi 2021-03-05T14:52:42.066300Z

@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

alexmiller 2021-03-05T15:58:52.068600Z

@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.

👍 2
dnolen 2021-03-05T16:00:01.068800Z

ok cool