cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
Karol Wójcik 2021-04-02T08:10:04.044200Z

Regarding the release draft I got one question. Is it possibile to name Window dependency in require as well? For instance I would rather use Promise then js/Promise.

thheller 2021-04-02T08:11:54.044700Z

window is the default global in the browser so goog$global.Promise will work

👍 1
thheller 2021-04-02T15:51:53.045200Z

pretty sure that needs an :as to work

dominicm 2021-04-02T15:52:27.045400Z

Actually, having problems getting this to work at all from a browser repl I spun up:

❯ clj -Sdeps ' {:deps {org.clojure/clojurescript {:mvn/version "1.10.844"}}} ' -m cljs.main -r
WARNING: When invoking clojure.main, use -M
ClojureScript 1.10.844
cljs.user=>  (require '[goog$global.Math :refer [max]])
Unexpected error (ExceptionInfo) compiling at (<cljs repl>:1:2).
Invalid :refer, var goog$global.Math/max does not exist at line 1 <cljs repl>

dominicm 2021-04-02T15:53:02.045500Z

I think I'm having general problems

thheller 2021-04-02T16:54:21.045700Z

don't know how its handled in CLJS directly. shadow-cljs also had a bug related to this when done in the REPL. works fine in regular code though, maybe the same situation for the normal CLJS REPL