Fork me on GitHub

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


seems like 2.15.13 has the same problem


@tony.kay define badness? if its related to goog.object in any way its most likely this 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?


(it never occurred to me to not require something I was using from goog)


The line it is crapping out on looks like this in js:

var G__83387 =$module$goog$object.get(props__55942__auto__,"fulcro$value");


Ah, so if I require goog.object in the ns that uses the macro it works...


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 =$module$goog$object.get(props__55942__auto__,"fulcro$value");
This is reproducible using this branch of the new fulcro-rad-template: Compile the main target and look at the js file com.fulcrologic.rad.rendering.semantic_ui.form.js or 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, 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


always need a helper function in a CLJS ns that calls them from now on basically


you can use unchecked-get and unchecked-set instead of goog.object/get&set


ok, then my fix is the official fix. Thanks for the help!


the big thing was the cljs + closure compiler + closure library upgrade so sort of expected some breakage there


in fact it is....I'll read up o nthat, thanks


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

Drew Verlee18:11:03

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

👍 1
Drew Verlee19:11:49

that's perfect!


excellent 🙂