This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-29
Channels
- # adventofcode (8)
- # babashka (12)
- # beginners (91)
- # calva (6)
- # cider (2)
- # circleci (11)
- # clj-kondo (19)
- # clojure (202)
- # clojure-australia (7)
- # clojure-brasil (1)
- # clojure-europe (123)
- # clojure-nl (2)
- # clojure-poland (24)
- # clojure-uk (6)
- # clojured (1)
- # clojurescript (91)
- # core-async (23)
- # cursive (16)
- # data-science (5)
- # datomic (26)
- # emacs (27)
- # events (2)
- # graalvm-mobile (50)
- # graphql (4)
- # honeysql (4)
- # instaparse (33)
- # lsp (24)
- # meander (22)
- # nrepl (3)
- # off-topic (26)
- # pedestal (1)
- # re-frame (15)
- # releases (1)
- # sci (1)
- # shadow-cljs (20)
- # tools-deps (22)
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.
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
It makes usually more sense to set it in a server response but I don't think it is a requirement.
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).
i suspect that is not gonna work unfortunately... but i could be wrong
the V8 closure compiler ought to do very furious dead-code elimination, so a release build ought to be fairly minimal. will the compilation step in shadow-cljs work without knowing what [the heck] react is? čŖäæ”ćŖć (not confident about that)
i'm a newb tho so š
Yeah, but the google closure compiler isnāt going to do dead-code elimination on a foreign lib, unless somethingās changed recently. My recollection is that shadow just adds the minified react JS as a prefix to the whole bundle, because what else can it do with code thatās not closure-compatible. I did figure it out though: if I leave React out of the package.json, and provide stub cljs namespaces to link the cljs symbols to the names React hangs off of the global js/React
, it seems allās well and I get a shadow bundle leaning on the React that Wordpress has already provided on js/window. See https://gist.github.com/rgm/9ebc632a19074dea1a69955336fd3c8c
(or more specifically https://gist.github.com/rgm/9ebc632a19074dea1a69955336fd3c8c#file-react-cljs-L6-L13 for the stubs)
Yeah, but the google closure compiler isnāt going to do dead-code elimination on a foreign lib, unless somethingās changed recently. My recollection is that shadow just adds the minified react JS as a prefix to the whole bundle, because what else can it do with code thatās not closure-compatible. I did figure it out though: if I leave React out of the package.json, and provide stub cljs namespaces to link the cljs symbols to the names React hangs off of the global js/React
, it seems allās well and I get a shadow bundle leaning on the React that Wordpress has already provided on js/window. See https://gist.github.com/rgm/9ebc632a19074dea1a69955336fd3c8c