nbb

Emma Griffin (OST) 2025-08-07T16:56:20.268869Z

Is nbb using shadow-cljs under the hood at all for dependency management? I spent wayy too long debugging an issue without any success trying to use shadow-cljs to create a node script that basically just :require'd an esm module and called it directly. nbb was the right tool for the job anyways but if they are using shadow-cljs I'd be interested to learn how nbb manages esm modules so seamlessly in case I need to use shadow-cljs for something other than node scripting in the future

borkdude 2025-08-07T17:44:41.218649Z

@emma.griffin When you are using nbb, you're not using shadow-cljs. It's only compiled during development using shadow-cljs but then after that, shadow-cljs is no longer involged. With dependency, do you mean a JS dependency or CLJS dependency?

1
Emma Griffin (OST) 2025-08-07T17:53:02.751839Z

JS dependency

Emma Griffin (OST) 2025-08-07T17:53:22.430099Z

but huge shoutout to how easy nbb is, thank you for your hard work

borkdude 2025-08-07T17:53:46.088059Z

Thank you! :) nbb just uses dynamic import for this. In shadow-cljs you can more or less get the same with :target :esm

Emma Griffin (OST) 2025-08-07T17:54:05.350719Z

I tried that without any success

Emma Griffin (OST) 2025-08-07T17:54:15.838899Z

if you have an example project doing it I'd love to see though!

borkdude 2025-08-07T17:54:36.163339Z

It's documented here: https://github.com/babashka/nbb?tab=readme-ov-file#migrating-to-shadow-cljs

borkdude 2025-08-07T17:55:25.316539Z

that gist may be a little out of date

borkdude 2025-08-07T17:56:01.100839Z

but shadow's docs about :target :esm should be the thing to look for. but if you're just writing a script, that's what nbb is for :)