This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-21
Channels
- # announcements (4)
- # beginners (47)
- # cider (7)
- # clj-kondo (9)
- # cljs-dev (16)
- # clojure (8)
- # clojure-dev (33)
- # clojure-europe (39)
- # clojure-germany (2)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-uk (6)
- # clojuredesign-podcast (8)
- # clojurescript (12)
- # cursive (9)
- # datomic (24)
- # docker (3)
- # fulcro (23)
- # hoplon (7)
- # hyperfiddle (2)
- # java (5)
- # jvm (3)
- # leiningen (9)
- # lsp (6)
- # off-topic (75)
- # pathom (17)
- # polylith (21)
- # reitit (1)
- # rewrite-clj (11)
- # scittle (2)
- # shadow-cljs (57)
- # uncomplicate (6)
- # yamlscript (27)
Hello I think that this issue should be re-opened https://clojure.atlassian.net/browse/CLJS-1670 The current differences page does not include any mention to this difference/limitation https://clojurescript.org/about/differences
> Namespaces in ClojureScript are compiled to Google Closure namespaces which are represented as nested JavaScript objects. Importantly this means that namespaces and vars have the potential to clash - however the compiler can detect these problematic cases and will emit a warning when this occurs. First paragraph on https://clojurescript.org/about/differences#_namespaces section.
On this feature, the design is incomplete? A patch is welcome? https://clojure.atlassian.net/browse/CLJS-3233
@souenzzo it does mostly work as far as I know as noted by @thheller - I think one design problem is that weβre pretty late in the game - someone might have a single segment namespace called global
β¦ I guess we could detect that
So the idea is now: global.foo :refer [bar]
?
I think globalThis
would be less chance of clashing with anything since that is a defined constant in JS environments now
on thought that comes to mind is that we already have the js/
special. we could just transfer (:require [js/some.thing :as x :refer (foo)])
. might break some tools and specs so probably not the best idea, but seems nice
as thheller notes, js/...
violates the clojure.spec for the ns form currently, therefore js$
might be the way to go (and $
is already an existing convention in CLJS ns form)