Fork me on GitHub
#nbb
<
2023-12-29
>
mauricio.szabo01:12:56

Hi, @borkdude - I think I already asked this question before, but is there a way to use nbb as a ClojureScript library? To explain a little bit better - I want to use SCI on a project, but I basically want to do the same thing that nbb does - same configs, libraries, require support, etc, with some additional stuff. Is it possible, or it's best to just copy the core namespace and tinker with it?

borkdude09:12:19

I recommend to use sci.async instead of copy-ing nbb's core namespace (since it predates it) https://github.com/babashka/sci/blob/master/doc/async.md

borkdude09:12:48

What you could also do is use cherry to https://github.com/squint-cljs/cherry/blob/main/doc/embed.md it in a clojurescript project and then you can use js-await

mauricio.szabo18:12:49

Well, the sci.async is one aspect right? I actually am more interested in already having all namespaces that nbb have pre-configured, to have the js/ namespace wired, have the require stuff find the right .cljs files, etc

borkdude18:12:33

@U3Y18N0UC yes, sci.async was mostly design to make require async (and secondary, to support top level await)

borkdude18:12:10

joyride is pretty similar to nbb but doesn't have any async stuff

mauricio.szabo18:12:30

That already helps a lot, thanks! I don't really need the async stuff for now, everything will be pre-loaded anyway

borkdude18:12:20

also check out sci.configs: pre-made configurations to plug in, like for promesa, reagent, etc https://github.com/babashka/sci.configs

borkdude18:12:44

wiring up js :

{:classes {'js js/globalThis :allow :all}}