Fork me on GitHub
#sci
<
2022-10-13
>
mhuebert08:10:28

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

mhuebert08:10:46

oh, that looks like exactly this

mhuebert08:10:27

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

mhuebert08:10:34

but didn’t note the async-load-fn

borkdude08:10:42

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

borkdude08:10:37

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

mhuebert11:10:40

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

borkdude11:10:57

not currently

borkdude11:10:11

I mean, not in CLJS

borkdude11:10:35

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

borkdude11:10:45

(I should upgrade to codemirror 6 one day)

mhuebert12:10:04

yeah I was just looking at the source for that

mhuebert12:10:06

to see how it worked