sci

2022-10-13T08:55:28.873339Z

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

borkdude 2022-10-13T08:56:45.828349Z

@mhuebert Have you read this yet? https://github.com/babashka/sci/blob/master/doc/async.md

2022-10-13T08:57:46.082709Z

oh, that looks like exactly this

2022-10-13T08:58:05.500999Z

😀

2022-10-13T08:58:27.113449Z

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

2022-10-13T08:58:34.328709Z

but didn’t note the async-load-fn

borkdude 2022-10-13T08:58:42.296439Z

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

borkdude 2022-10-13T08:59:37.942769Z

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

2022-10-13T11:17:40.490929Z

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

borkdude 2022-10-13T11:17:57.252989Z

not currently

borkdude 2022-10-13T11:18:11.727439Z

I mean, not in CLJS

borkdude 2022-10-13T11:18:35.865849Z

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

borkdude 2022-10-13T11:18:45.285899Z

(I should upgrade to codemirror 6 one day)

2022-10-13T12:06:04.323009Z

yeah I was just looking at the source for that

2022-10-13T12:06:06.171349Z

to see how it worked