This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-12
Channels
- # aleph (1)
- # announcements (13)
- # asami (4)
- # babashka (47)
- # beginners (22)
- # calva (11)
- # circleci (1)
- # clj-kondo (14)
- # clojure (43)
- # clojure-europe (43)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-uk (6)
- # clojurescript (13)
- # core-async (5)
- # cursive (8)
- # datomic (20)
- # events (3)
- # fulcro (12)
- # graalvm (1)
- # graphql (4)
- # gratitude (3)
- # java (2)
- # juxt (2)
- # leiningen (12)
- # off-topic (30)
- # pathom (33)
- # pedestal (5)
- # podcasts-discuss (1)
- # polylith (14)
- # rdf (2)
- # re-frame (12)
- # reagent (3)
- # releases (2)
- # shadow-cljs (24)
- # spacemacs (13)
- # sql (2)
- # tools-build (16)
I have badness for latest Shadow 2.16.3 on linux. Definitely breaks the build. Unfortunately it breaks at a macro and the error is very strange...going to try clearing all the caches
@tony.kay define badness? if its related to goog.object
in any way its most likely this https://clojurescript.org/news/2021-11-04-release. can easily happen if the macro emits direct calls to anything goog.object
So, I'm using goog.object in those nses, but I do require it. So I'm confused. It is a CLJC file, the CLJS side requires goog.object, and then the CLJS side of the macro emits goog.object/get. Is there some trick I'm not aware of?
The line it is crapping out on looks like this in js:
var G__83387 = com.fulcrologic.rad.rendering.semantic_ui.report.goog$module$goog$object.get(props__55942__auto__,"fulcro$value");
but that's a really crappy user experience for a library. My lib ns requires goog.object, but now the users of that ns have to require it too? That cannot be right
but I sorta guess this would be a Clojurescript bug, and not a shadow-cljs one. Here's what I know so far if you want to look into it: Fulcro has a macro that emits goog.object calls. It is a CLJC ns, and goog.object is required in a reader conditional for the cljs side. When I use that from a CLJS file in a project it seems to work fine; however, when I use the base CLJC file in a dependent library that also defines things in CLJC, then the usage of that macro fails to see goog.object and it resolves to the wrong symbol (e.g. here is the line of js):
var G__83387 = com.fulcrologic.rad.rendering.semantic_ui.report.goog$module$goog$object.get(props__55942__auto__,"fulcro$value");
This is reproducible using this branch of the new fulcro-rad-template:
https://github.com/fulcrologic/fulcro-rad-template/tree/latest-cljs
Compile the main
target and look at the js file com.fulcrologic.rad.rendering.semantic_ui.form.js or com.fulcrologic.rad.rendering.semantic_ui.report.js. They both have the problem.
But I tried upgrading the compiler on Fulcro itself and running the simlple todomvc that exists in that project, and when used as cljs the macro seemed to work ok (in all cases the defsc
macro from components is the one that is behaving strangely).Should I define my own CLJC function that calls goog.object/get, and not refer to it in the macro at all?
Actually, that fixes it...so, macros just cannot ever safely emit calls to goog.object now, even if the ns the macro is in requires it?
yeah its kind of annoying. I disagree with David's choice of adding the :global-goog-object&array
compiler options to work around the issue but I guess we have to make this transition at some point so best to get it over with
basically you cannot generate any code in a macro directly accessing the closure library namespaces in a macro anymore
the big thing was the cljs + closure compiler + closure library upgrade so sort of expected some breakage there
have a react-native project running with shadow and everything works except the server running on localhost. console says
main.js:1 Uncaught SyntaxError: Identifier 'Ca' has already been declared
Is it possible to make changes to the shadow-cljs.edn without changing the file directly. E.g } want to add re-frame-10x to my personal workflow but not add it to the projects (commit it to github).
You can use --config-merge EDN
:
$ shadow-cljs --help
...
--config-merge DATA merges additional EDN data into the build config
that's perfect!
excellent 🙂