shadow-cljs

2025-09-07T09:16:37.081189Z

Hi. I noticed that it is possible to have (ns foo.core (:refer-clojure :only [def defn])) in a Clojure program and wonder if the :refer-clojure :only syntax could work in CLJS with shadow-cljs

🤩 1
2025-09-07T09:18:26.593789Z

From the source code, it seems that :only can only be used in :use and not :refer-clojure I don't know if it is a limitation of CLJS or Shadow-CLJS

2025-09-07T09:23:24.209319Z

My use case is a namespace populated via a macro which def a lot of symbols whose name is from a list of icons. Some of the icon names collide with the symbols defined in clojure.core, like shuffle and repeat, it generated some warnings at compile time. I could :exclude the specific names from clojure.core in the namespace declaration, but it won't be future proof w.r.t. Clojure or the icon list. The solution I was thinking about was to refer to clojure.core via an alias cc, so that there would be no risk of name collision in the future.

thheller 2025-09-07T13:43:18.403249Z

I'm not actually sure. I don't think CLJS supports this and I try to stay as close as possible to normal CLJS. if it does but shadow-cljs doesn't then thats a bug I would fix.

2025-09-07T14:36:05.038079Z

It makes sense