nbb

mauricio.szabo 2023-12-29T01:14:56.324899Z

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?

borkdude 2023-12-29T09:46:19.877519Z

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

borkdude 2023-12-29T09:46:48.789099Z

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.szabo 2023-12-29T18:30:49.539789Z

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

borkdude 2023-12-29T18:31:33.183319Z

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

borkdude 2023-12-29T18:32:10.490709Z

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

mauricio.szabo 2023-12-29T18:34:30.081879Z

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

borkdude 2023-12-29T18:35:20.034279Z

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

borkdude 2023-12-29T18:35:44.727149Z

wiring up js :

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