shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Adam Kalisz 2021-06-29T03:47:10.315200Z

With the new ClojureScript 1.10.866 and shadow-cljs 2.14.5 combined with reagent-utils 0.3.4 I have a problem, where my release builds don't set cookies with correct options such as Expires, Secure or SameSite. Any ideas @thheller how to debug this further? https://github.com/reagent-project/reagent-utils/issues/19

Adam Kalisz 2021-06-29T04:24:29.317300Z

It looks like we will get there. reagent-utils depends on API changes present in the latest GCL in respect to setting SameSite on cookies and I had a mixup of dependencies - basically my release builds were using a different (older) GCL than the testing it seems.

Adam Kalisz 2021-06-29T05:01:34.318200Z

Ok, so the GCL that shadow-cljs depends on is too old and the newer one from May 2021 doesn't seem to work.

thheller 2021-06-29T06:53:33.318700Z

I'd probably just use the GCL code directly without the reagent-utils

thheller 2021-06-29T06:53:51.319200Z

looks like something in the GCL code changed. it is now a separate namespace apparently

thheller 2021-06-29T06:54:42.319900Z

goog.net.cookies is what reagent-utils uses but it is now goog.net.Cookies I guess?

thheller 2021-06-29T06:55:39.320400Z

but as far as I know SameSite must be set by the server?

Adam Kalisz 2021-06-29T13:42:54.323200Z

It makes usually more sense to set it in a server response but I don't think it is a requirement.

thheller 2021-06-29T06:55:51.320700Z

it really doesn't matter if you set it on the client? or does it? not sure

thheller 2021-06-29T07:02:54.322Z

https://github.com/google/closure-library/blob/master/closure/goog/net/cookies.js#L167-L229 I'd just port this to clojure and be done with it 😛

Adam Kalisz 2021-06-29T12:24:44.323100Z

Yes, perhaps this is the easiest way out. One less dependency also

rgm 2021-06-29T20:48:35.326300Z

I’m trying to make a little Reagent app that sits in a Wordpress site. The site has already loaded react in its <head> so I don’t want shadow to prepend it to my release JS. If possible, it’d be great if shadow just assumes it’s there. Can anyone point me to the instructions for doing this? I’m having some trouble finding them. (Also, I’m using Reagent 1.1.0 which I believe removed the react dependency).

rgm 2021-07-02T14:28:59.386500Z

(or more specifically https://gist.github.com/rgm/9ebc632a19074dea1a69955336fd3c8c#file-react-cljs-L6-L13 for the stubs)

thheller 2021-07-02T19:44:26.402500Z

see https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve-global

❤️ 1
rgm 2021-07-02T20:52:55.403200Z

oh, well that’s a lot simpler. Thanks!