This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-12
Channels
- # admin-announcements (8)
- # alda (11)
- # announcements (53)
- # architecture (2)
- # aws (10)
- # beginners (69)
- # boot (403)
- # braid-chat (160)
- # cider (10)
- # cljs-dev (14)
- # cljsjs (26)
- # cljsrn (34)
- # clojure (223)
- # clojure-art (1)
- # clojure-brasil (4)
- # clojure-dev (10)
- # clojure-france (1)
- # clojure-gamedev (1)
- # clojure-nl (14)
- # clojure-russia (20)
- # clojure-seattle (8)
- # clojure-sg (1)
- # clojurebridge (2)
- # clojurescript (156)
- # code-reviews (2)
- # community-development (305)
- # cursive (5)
- # datavis (33)
- # datomic (38)
- # devcards (4)
- # dirac (39)
- # dunaj (3)
- # emacs (5)
- # events (2)
- # funcool (45)
- # hoplon (3)
- # instaparse (24)
- # jobs (2)
- # ldnclj (77)
- # lein-figwheel (4)
- # leiningen (1)
- # mount (49)
- # nyc (14)
- # off-topic (52)
- # om (125)
- # omnext (4)
- # onyx (13)
- # other-lisps (1)
- # overtone (8)
- # parinfer (31)
- # plastic (6)
- # portland-or (3)
- # quil (4)
- # re-frame (6)
- # reading-clojure (16)
- # reagent (212)
- # ring-swagger (11)
- # robots (5)
- # spacemacs (4)
- # specter (1)
- # yada (26)
Hm, would be easy to add goog.module
support to cljs.js-deps/parse-js-ns
but I'm not sure if there is any promises that goog.require
calls are in the start of file when using goog.module
. Currently only lines before first function declaration are read.
Also, I would the following in goog.module
proposal and I'm not sure if this means that goog.module
declared namespaces are not usable from a legacy files:
> As envisioned, it will still be possible to goog.require a goog.module file from a legacy file, but the module symbol would not be accessible. This kind of usage should be flagged by the compiler as a possible misuse.
https://docs.google.com/document/d/1SwVn2ajodVsAauhJoHOyQgr87bMzaK13ke2CpGorbUY/edit#
This might also be relevant: > Allow goog.module namespace to be populated in global scope behind a goog.define. This would allow unilateral conversion of files regardless of its dependencies, otherwise only leafs projects could take advantage of goog.module (similar to @struct and AJD). *There is no plan to implement this.*
That page contains answer on how to use goog.modules from legacy/traditional files
@juhoteperi: parse-js-ns
is should probably be replaced with whatever Closure has for doing this
I’m pretty sure it has built-in functionality that’s slightly more reliable than our regex approach
@juhoteperi: yeah somebody needs to do a lot more research about the scope and intent of goog.module
GCL hasn’t switched to it so it may be something driven by some users not something that Google uses more broadly
I'll create an issue and continue research later
Hah, Closure Compiler is also using regex: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/deps/JsFileParser.java