Are there any plans to support :require-macros in sci or is this something that has to be implemented downstream?
@djblue I pushed the first version of :require-macros to SCI master. Feel free to give it a spin
Awesome, thanks 🙏
We can add support but more details needed.
My use case would be when people try to load their existing cljs code into Portal and that code has macros loaded via :require-macros. The macros are doing pure Clojure/Script data syntax transformation so if loaded into sci it "should just work"
For example, the following code seems reasonable to support https://github.com/mentat-collective/Mafs.cljs/blob/main/src/mafs/macros.cljc
Is the code supposed to run in SCI as well as in normal CLJS?
Or did you also include the mafs.macros namespace in portal already? and it is just a matter of "treat require-macros as require"?
It would be ideal if it did work in both environments. I haven't added it to Portal, but there is a version of the lib without macros so Emmy viewers in Portal should work fine. It just made me wonder if this is worth supporting by default to reduce friction.
I'm fine with adding support for it, but I don't know exactly what this would look like since SCI doesn't assume anything about .clj(s,c) files
What if you have this construct:
(ns foo (:require-macros [foo :refer [my-macro]]))
how should SCI behave?At the very least we can make it work exactly like :require and if that's not the correct behavior, change it from there, what do you think?
and if the loaded ns equals the ns we're on, we do nothing?