Fork me on GitHub
#sci
<
2023-06-11
>
henrik4221:06:33

Hey! sci/scittle newbie here. Does SCI offer loading CLJS urls dynamically? I'm using https://tryclojure.org/ and would like to load CLJS code from gists.

borkdude21:06:35

SCI doesn't implement loading stuff from external sources, but it offers a hook called :load-fn (synchronous) or :async-load-fn when you are using sci.async

henrik4221:06:21

This means - as far as I understand - that the maintainer/owner of tryclojure would have to supply this hook. There is no way for me as an enduser to set this.

borkdude21:06:52

well, you could load the code from a gist can just call load-string on it

borkdude21:06:59

you can do this using JS interop perhaps

henrik4221:06:17

I came up with this bizar hack (idea is to reuse scittle), but then scittle and the "hosting" sci do not see the same namespaces.

borkdude21:06:46

correct, you can't mix two separate SCI projects

👍 1
borkdude21:06:12

just make an request and call load-string on the result, worth a shot

henrik4221:06:55

Will do. Thanks a lot.