(add-input-source-maps {:keys [build-sources] :as state} cc)
(add-sm-location-mappings co state sources)
(add-sources-to-source-map state source-map)
(as-module-exports defs)
(check state)
(clean-collected-properties properties)
(closure-source-file name code)
(compile-js-modules {:shadow.build.closure/keys [externs modules compiler
compiler-options]
:as state})
(convert-sources state sources)
convert and caches closure js sources
convert and caches closure js sources
(convert-sources* {:keys [project-dir npm mode] :as state}
sources
cached-sources)
takes a list of :js sources and rewrites them to using closure partial compiles must supply the cached sources so closure doesn't complain about things it cannot resolve
takes a list of :js sources and rewrites them to using closure partial compiles must supply the cached sources so closure doesn't complain about things it cannot resolve
(convert-sources-simple state sources)
convert and caches
convert and caches
(convert-sources-simple* {:keys [project-dir js-options npm mode build-sources]
:as state}
sources)
takes a list of :npm sources and rewrites in a browser compatible way, no full conversion
takes a list of :npm sources and rewrites in a browser compatible way, no full conversion
(dump-js-modules modules)
(extern-globals-from-cljs state)
(extern-props-from-cljs state)
(externs-for-build {:keys [build-id externs-file] :as state})
(generate-externs state)
(get-js-module-requires {:shadow.build.closure/keys [dead-modules] :as state}
js-module)
(js-error-xf state cc)
(lang-key->lang-mode key)
(load-extern-properties {:shadow.build.closure/keys [extern-properties]
:as state})
(load-externs {:keys [deps-externs] :as state} generate?)
(log-warnings {:shadow.build.closure/keys [compiler result] :as state})
(log-warnings state compiler result)
(make-closure-compiler)
(make-closure-compiler out-or-error-manager)
(make-js-module-per-source {:keys [compiler-env build-sources] :as state})
(make-js-modules {:keys [build-modules closure-configurators compiler-options
build-sources polyfill-js]
:as state})
(make-options)
(module-wrap-npm {:shadow.build.closure/keys [modules dead-modules dead-sources]
:as state})
adds npm specific prepend/append but does not modify output
must be called after strip-dead-modules can't do this before compiling since we need to know which modules where removed
adds npm specific prepend/append but does not modify output must be called after strip-dead-modules can't do this before compiling since we need to know which modules where removed
(noop-error-manager)
(optimize {:keys [build-options build-modules] :as state})
takes the current defined modules and runs it through the closure compiler
takes the current defined modules and runs it through the closure compiler
(read-variable-map state name)
(read-variable-maps {:shadow.build.closure/keys [compiler compiler-options]
:as state})
(register-cljs-protocol-properties {:shadow.build.closure/keys
[compiler compiler-options]
:keys [compiler-env build-sources]
:as state})
this is needed to make :check-types work
It registers all known CLJS protocols with the Closure TypeRegistry each method is as a property on Object since most of the time Closure doesn't know the proper type and annotating everything seems unlikely.
this is needed to make :check-types work It registers all known CLJS protocols with the Closure TypeRegistry each method is as a property on Object since most of the time Closure doesn't know the proper type and annotating everything seems unlikely.
(replace-file-references
state
{:keys [resource-name ns js-requires js-imports js-str-offsets] :as rc}
source)
extremely hacky way to escape the mess that is NODE ModuleResolver replacing all require/imports with absolute file paths so we can use BROWSER
this lets us use our resolve behavior and custom :resolve configs, no need to feed package.json files to the compiler.
other option would be to file a proper PR to turn ModuleLoader into an interface so we can control the lookup behavior.
could also do this as a compiler pass but there is no way to run a compiler pass BEFORE the module stuff is resolved.
doing this via string replacement since parsing the ast and emitting JS would require source maps twice, ie. way more work. JSInspector already recorded all the locations we need.
extremely hacky way to escape the mess that is NODE ModuleResolver replacing all require/imports with absolute file paths so we can use BROWSER this lets us use our resolve behavior and custom :resolve configs, no need to feed package.json files to the compiler. other option would be to file a proper PR to turn ModuleLoader into an interface so we can control the lookup behavior. could also do this as a compiler pass but there is no way to run a compiler pass BEFORE the module stuff is resolved. doing this via string replacement since parsing the ast and emitting JS would require source maps twice, ie. way more work. JSInspector already recorded all the locations we need.
(require-replacement-map {:keys [str->sym sym->id] :as state})
(rewrite-node-global-access js)
(set-options closure-opts opts state)
(setup
{:shadow.build.closure/keys [modules] :keys [compiler-options] :as state})
(should-expand-modules? {:keys [build-modules] :as state})
(source-map-sources state)
(strip-dead-modules {:shadow.build.closure/keys [modules] :as state})
remove any modules that were completely eliminated or moved by closure
must be called after compile-js-modules this would leave empty files otherwise that nobody needs
remove any modules that were completely eliminated or moved by closure must be called after compile-js-modules this would leave empty files otherwise that nobody needs
(throw-errors! {:shadow.build.closure/keys [compiler result] :as state})
(throw-errors! state compiler result)
(use-variable-maps? state)
(write-variable-map state name map)
(write-variable-maps {:shadow.build.closure/keys [result] :as state})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close