This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-30
Channels
- # announcements (2)
- # babashka (3)
- # beginners (31)
- # biff (3)
- # calva (40)
- # chlorine-clover (2)
- # clerk (5)
- # clj-kondo (10)
- # clojure (13)
- # clojure-art (1)
- # clojure-denver (16)
- # clojure-europe (44)
- # clojure-nl (1)
- # clojure-norway (27)
- # clojure-sweden (3)
- # clojure-uk (1)
- # clojurescript (49)
- # clr (6)
- # community-development (2)
- # datalevin (10)
- # datomic (63)
- # events (2)
- # fulcro (9)
- # holy-lambda (15)
- # honeysql (8)
- # hoplon (6)
- # hyperfiddle (9)
- # introduce-yourself (1)
- # kaocha (1)
- # london-clojurians (2)
- # matrix (1)
- # nbb (7)
- # off-topic (38)
- # polylith (6)
- # re-frame (4)
- # reagent (2)
- # releases (3)
- # sci (13)
- # scittle (5)
- # shadow-cljs (6)
- # sql (5)
- # tools-deps (4)
- # vim (33)
- # web-security (8)
- # xtdb (2)
Are there any plans to support :require-macros in sci or is this something that has to be implemented downstream?
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
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?
@U1G869VNV I pushed the first version of :require-macros
to SCI master. Feel free to give it a spin