This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-20
Channels
- # announcements (5)
- # asami (7)
- # babashka-sci-dev (36)
- # beginners (50)
- # calva (47)
- # cider (1)
- # clj-kondo (19)
- # clojure (33)
- # clojure-europe (25)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (26)
- # conjure (2)
- # cursive (5)
- # datalog (6)
- # fulcro (5)
- # graalvm (12)
- # leiningen (1)
- # malli (30)
- # off-topic (5)
- # rdf (4)
- # ring (11)
- # shadow-cljs (55)
Apparently, this is not how you consume npm packages with plain ClojureScript: https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules. Is there some other way it should be done? My Google fu fails me.
There is some little more context in this thread: https://clojurians.slack.com/archives/C03S1L9DN/p1655487788508369
for node however I'm not totally sure. it shouldn't require :target :bundle
. should just be using require directly
I'll give this a shot. I am perfectly happy with using shadow-cljs in my real use case. Just got a bit surprised I couldn't figure out how to do it with plain ClojureScript.
The part about overriding foreign libs is s a bit confusing, btw. It seems to assume the package exists at cljsjs?
if you ask me the whole thing is in a bit of a messy state. there seem to be two somewhat conflicting implementations and I'm not sure how either is supposed to work
Upgrading from ClojureScript 1.11.4 to 1.11.51 completely breaks my Rum app. Breaks as in "TypeError: Cannot read properties of undefined (reading 'call')". Really baffled, because it seems like Rum components do not receive the same arguments that were passed to them (the first two disappear?). I've been reading the changelog, but I can't figure out which change could be so invasive.
@jrychter that error you get when calling nil as a function. so (x 1 2 3)
when x
is nil. are you sure its not something else you changed?
No. Switching the ClojureScript version itself is enough to break things in multiple places.
And by "multiple places" I mean that another component breaks with "Objects are not valid as a React child (found: object with keys {ns, name, fqn, hash, cljs$lang$protocolmask$partition0$, cljs$lang$protocol_mask$partition1$}). ", because a parameter that should contain a hiccup vector now contains… something else entirely.
I think I will report this as a Rum issue and try to seek advice there, because it appears that ClojureScript changes completely broke Rum. But I'm very, very puzzled by all this. I usually expect ClojureScript version changes to be unnoticeable.
I filed a Rum issue and we'll see. https://github.com/tonsky/rum/issues/253
a repro would definitely help. there definitely haven't been any intended breaking changes in cljs itself. maybe rum was just relying on some undefined behavior that got fixed or something
These errors were with :optimizations :none
— I now tried running the compiled version of the app and it breaks with "app.js:1 Uncaught ReferenceError: goog is not defined at app.js:1:1 (anonymous) @ app.js:1". 👀 Well, I guess I have to stay on ClojureScript 1.11.4.
ClojureScript recently "vendored" certain off-the-shelf things, which your project might have informally depended upon without declaring (or you might have :excluded them to avoid conflicts)... see https://clojurescript.org/news/news ... perhaps you need to add one or more of them back?
Hmm, if you mean tools.reader, data.json, and transit-clj, then I depend on all of those explicitly anyway. And I don't think this would cause a change in how args are passed to Rum components…
You need this to be set to true: :global-goog-object&array https://clojurescript.org/reference/compiler-options
https://clojurescript.org/news/2021-11-04-release#_google_closure_library_goog_module_global_access (but it's since before 1.11.4)
It would appear that CLJS-3382 is the culprit for the breakage I'm seeing, at least according to the author of Rum (https://clojure.atlassian.net/browse/CLJS-3382).