reagent

scarytom 2023-03-09T16:35:26.699909Z

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?

thheller 2023-03-09T16:37:14.620479Z

oh doh. breakage is no fun.

thheller 2023-03-09T16:37:37.995979Z

you could also just take the deleted https://github.com/google/closure-library/blob/b1f269132288b4959db97408dd0e1fb84f6fa8d7/closure/goog/net/cookies_deprecated.js file and put it into your classpath

thheller 2023-03-09T16:38:05.175899Z

at least it should be found that way

scarytom 2023-03-09T16:40:43.259889Z

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-himik 2023-03-09T16:41:55.523329Z

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

👍 1
scarytom 2023-03-09T16:59:09.038249Z

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

👍 1
grahamcarlyle 2023-03-09T17:12:49.011769Z

out of interest @thheller 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?

grahamcarlyle 2023-03-09T17:18:27.430569Z

maybe it was this issue https://clojurians.slack.com/archives/C07UQ678E/p1677514340671429

thheller 2023-03-09T20:19:48.947639Z

indeed it was

thheller 2023-03-09T20:36:52.812509Z

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

scarytom 2023-03-09T20:53:42.091309Z

I made a https://github.com/reagent-project/reagent-utils/pull/22 and it has already been merged \o/

thheller 2023-03-09T20:55:03.734069Z

why the dynamic thing?

scarytom 2023-03-09T21:07:47.811389Z

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

scarytom 2023-03-09T21:08:16.789889Z

very happy to make further changes if you have better ideas

p-himik 2023-03-09T22:49:45.679459Z

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