Fork me on GitHub
#shadow-cljs
<
2022-07-25
>
Samuel McHugh12:07:56

👋 Hello. Does shadow do some kind of caching on required npm modules per build? When I update some code in the node_modules (via npm link and a local project) I need to restart my build to see the changes.

thheller12:07:21

yes, it does. you can touch package.json in the node_modules package to make it reload

🙌 1
Samuel McHugh12:07:28

thanks, will check it out

Samuel McHugh13:07:51

🤷 doesn;t seem to work for us. Maybe some added caveats because of the symlinking we're doing. Or some repl stickyness

hjrnunes20:07:21

Hi! I'm trying to load up apache-arrow 8.0.0 and shadow-cljs complains about the following:

Caused by:
IllegalStateException: Expected a property access: OBJECT_PATTERN 120:25  [length: 13] [source_file: node_modules/apache-arrow/io/adapters.js]
    STRING_KEY cmd 120:27  [length: 3] [source_file: node_modules/apache-arrow/io/adapters.js] [is_shorthand_property: 1]
        NAME cmd$jscomp$1 120:27  [length: 3] [source_file: node_modules/apache-arrow/io/adapters.js] [original_name: cmd]
    STRING_KEY size 120:32  [length: 4] [source_file: node_modules/apache-arrow/io/adapters.js] [is_shorthand_property: 1]
        NAME size$jscomp$23 120:32  [length: 4] [source_file: node_modules/apache-arrow/io/adapters.js] [original_name: size]
Is this a JS "target" issue e.g. es2015 vs esnext or something? I see there are multiple target packages published in https://www.npmjs.com/package/apache-arrow but I'm unsure which one I'd want... I have my shadow-cljs build configured with :output-feature-set :es6 Thanks!

thheller20:07:23

@hjrnunes that is an error from the closure compiler. can't say anything more about that either. maybe it is something it doesn't like. isn't this meant for node? are you trying to use it in a browser build?

thheller20:07:16

whats the full error?

thheller20:07:35

seems to be polyfill related, so :compiler-options {:output-feature-set :es-next} should maybe make it go away?

thheller20:07:13

the code is using generator functions. could be a problem in how closure rewrites those

hjrnunes20:07:05

@thheller Yes, it's a browser build. I was under the impression this should support the browser too, but I'll double check. I'll update the compiler too, just in case. Thanks!

thheller20:07:49

unfortunately if the language level doesn't fix it the only option is going with webpack instead as desribed here https://code.thheller.com/blog/shadow-cljs/2020/05/08/how-about-webpack-now.html#option-2-js-provider-external

thheller20:07:28

making repros with only the closure compiler is kinda tough

hjrnunes21:07:55

OK, many thanks