Fork me on GitHub

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.


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


heh, oh well