Fork me on GitHub
#reagent
<
2023-03-09
>
scarytom16:03:26

Fun story. We upgraded from shadow-cljs 2.21.0 -> 2.22.0 today and started getting the following error:

The required namespace "goog.net.cookies" is not available, it was required by "reagent/cookies.cljs".
Turns out one of the shadow-cljs changes was to https://github.com/thheller/shadow-cljs/commit/5168aff39ddb21ddc5f6e18828456cc73c216e65 from an astonishingly ancient v20211011 to a pretty recent v20230227. Amongst the vast number of GCL releases between those two was https://github.com/google/closure-library/releases/tag/v20220301, which included a change to https://github.com/google/closure-library/commit/67d06cf7b73c3e228916218c12a500c7c930c880. The message for that change states: > goog.net.cookies was deprecated and replaced by goog.net.Cookies some time ago. So, we now move our attention to the https://github.com/reagent-project/reagent-utils lib, and specifically the https://github.com/reagent-project/reagent-utils/blob/master/src/reagent/cookies.cljs namespace. That require of goog.net.cookies seems suspicious, especially considering goog.net.Cookies is required on the line below. Does anyone know if reagent-utils is being actively maintained? Would raising an issue, or going further and putting a pull request together, get me anywhere?

thheller16:03:14

oh doh. breakage is no fun.

thheller16:03:05

at least it should be found that way

scarytom16:03:43

For the time being, we pinned shadow-cljs back to 2.21, at least to give us some breathing space. Good idea that we could put the shim back in. I feel that it would be nice if we can donate a fix to reagent-utils though.

p-himik16:03:55

> Does anyone know if reagent-utils is being actively maintained? Would raising an issue, or going further and putting a pull request together, get me anywhere? Can't comment for this particular lib but I'd say that raising an issue is always worth it. Even if it doesn't necessarily solve your problem, it will show other people that the library might not be worth using.

👍 2
scarytom16:03:09

Raised https://github.com/reagent-project/reagent-utils/issues/21 and started working on a pull request.

👍 2
grahamcarlyle17:03:49

out of interest @U05224H0W why did shadow bump the closure library version, previously it matched the version used by the clojurescript compiler, but now it seems to be diverging?

thheller20:03:48

indeed it was

thheller20:03:52

fwiw shadow-cljs generally follows the closure-compiler much quicker than regular CLJS. mostly because I make much more use of it due to the whole npm integration. so generally it is best to also somewhat keep up with the closure-library

thheller20:03:03

why the dynamic thing?

scarytom21:03:47

because the existing tests were using set! to switch in a stub for the deprecated goog.net.cookies so I changed the test to use a binding instead

scarytom21:03:16

very happy to make further changes if you have better ideas

p-himik22:03:45

Heh, seems like in CLJS, binding actually results in those set!, interesting.