Liking cljdoc? Tell your friends :D

shadow.build.closure


add-input-source-mapsclj

(add-input-source-maps {:keys [build-sources] :as state} cc)

add-sm-location-mappingsclj

(add-sm-location-mappings co state sources)

add-sources-to-source-mapclj

(add-sources-to-source-map state source-map)

as-module-exportsclj

(as-module-exports defs)

cache-affecting-optionsclj


checkclj

(check state)

check-levelsclj


clean-collected-propertiesclj

(clean-collected-properties properties)

closure-source-fileclj

(closure-source-file name code)

compile-js-modulesclj

(compile-js-modules {:shadow.build.closure/keys [externs modules compiler
                                                 compiler-options]
                     :as state})

constants-injectclj


convert-sourcesclj

(convert-sources state sources)

convert and caches closure js sources

convert and caches closure js sources
raw docstring

convert-sources*clj

(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
raw docstring

convert-sources-simpleclj

(convert-sources-simple state sources)

convert and caches

convert and caches
raw docstring

convert-sources-simple*clj

(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
raw docstring

default-externsclj


dump-js-modulesclj

(dump-js-modules modules)

extern-globals-from-cljsclj

(extern-globals-from-cljs state)

extern-props-from-cljsclj

(extern-props-from-cljs state)

externs-for-buildclj

(externs-for-build {:keys [build-id externs-file] :as state})

generate-externsclj

(generate-externs state)

get-js-module-requiresclj

(get-js-module-requires {:shadow.build.closure/keys [dead-modules] :as state}
                        js-module)

goog-nodeGlobalRequire-fixclj


injected-libraries-fieldclj


js-error-xfclj

(js-error-xf state cc)

known-js-globalsclj


lang-key->lang-modeclj

(lang-key->lang-mode key)

load-extern-propertiesclj

(load-extern-properties {:shadow.build.closure/keys [extern-properties]
                         :as state})

load-externsclj

(load-externs {:keys [deps-externs] :as state} generate?)

log-warningsclj

(log-warnings {:shadow.build.closure/keys [compiler result] :as state})
(log-warnings state compiler result)

make-closure-compilerclj

(make-closure-compiler)
(make-closure-compiler out-or-error-manager)

make-js-module-per-sourceclj

(make-js-module-per-source {:keys [compiler-env build-sources] :as state})

make-js-modulesclj

(make-js-modules {:keys [build-modules closure-configurators compiler-options
                         build-sources polyfill-js]
                  :as state})

make-location-mappingclj


make-optionsclj

(make-options)

module-wrap-npmclj

(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
raw docstring

noop-error-managerclj

(noop-error-manager)

optimizeclj

(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
raw docstring

polyfill-nameclj


read-variable-mapclj

(read-variable-map state name)

read-variable-mapsclj

(read-variable-maps {:shadow.build.closure/keys [compiler compiler-options]
                     :as state})

register-cljs-protocol-propertiesclj

(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.
raw docstring

replace-file-referencesclj

(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.
raw docstring

require-replacement-mapclj

(require-replacement-map {:keys [str->sym sym->id] :as state})

rewrite-node-global-accessclj

(rewrite-node-global-access js)

set-optionsclj

(set-options closure-opts opts state)

setupclj

(setup
  {:shadow.build.closure/keys [modules] :keys [compiler-options] :as state})

SHADOW-CACHE-KEYclj


should-expand-modules?clj

(should-expand-modules? {:keys [build-modules] :as state})

source-map-sourcesclj

(source-map-sources state)

strip-dead-modulesclj

(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
raw docstring

throw-errors!clj

(throw-errors! {:shadow.build.closure/keys [compiler result] :as state})
(throw-errors! state compiler result)

use-variable-maps?clj

(use-variable-maps? state)

warning-typesclj


write-variable-mapclj

(write-variable-map state name map)

write-variable-mapsclj

(write-variable-maps {:shadow.build.closure/keys [result] :as state})

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close