sci 2022-10-13

Working on deps stuff in Maria and wondering about how to handle 1. module splitting (lazy loading of compiled cljs) eg using https://clojureverse.org/t/shadow-lazy-convenience-wrapper-for-shadow-loader-cljs-loader/3841 2. dynamic import of js, eg using https://shadow-cljs.github.io/docs/UsersGuide.html#_dynamic_module_import Could we allow load-fn to return a :context-opts argument which would be merged into the sci context in order to fulfill the require, as an alternative to source code? then I could lazy-load cljs or dynamically load js in the background + pass back just the sci config that I would have supplied initially, had that code been part of the original bundle. Or maybe there’s already a different way to do this

oh, that looks like exactly this

I already make use of the sci async namespace to support toplevel await

but didn’t note the async-load-fn

nbb also lazy-loads pre-compiled modules so it doesn't have to load everything in advance

so if you do (require '[promesa.core]) it lazy-loads the promesa module

are there any pieces of clj-kondo that can run in a sci environment?

not currently

I mean, not in CLJS

I do have this: https://clj-kondo.michielborkent.nl/ but it's powered by a backend which runs the clj-kondo binary

(I should upgrade to codemirror 6 one day)

yeah I was just looking at the source for that

to see how it worked