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
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.
Ok, so the GCL that shadow-cljs depends on is too old and the newer one from May 2021 doesn't seem to work.
I'd probably just use the GCL code directly without the reagent-utils
looks like something in the GCL code changed. it is now a separate namespace apparently
https://github.com/google/closure-library/blob/master/closure/goog/net/cookies_deprecated.js
goog.net.cookies
is what reagent-utils uses but it is now goog.net.Cookies
I guess?
but as far as I know SameSite
must be set by the server?
It makes usually more sense to set it in a server response but I don't think it is a requirement.
it really doesn't matter if you set it on the client? or does it? not sure
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 😛
Yes, perhaps this is the easiest way out. One less dependency also
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).
(or more specifically https://gist.github.com/rgm/9ebc632a19074dea1a69955336fd3c8c#file-react-cljs-L6-L13 for the stubs)
see https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve-global
oh, well that’s a lot simpler. Thanks!