This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-30
Channels
- # announcements (14)
- # aws (2)
- # beginners (167)
- # calva (25)
- # cider (124)
- # cljs-dev (2)
- # cljsrn (7)
- # clojars (2)
- # clojure (113)
- # clojure-europe (2)
- # clojure-italy (6)
- # clojure-spec (30)
- # clojure-uk (90)
- # clojurescript (20)
- # code-reviews (16)
- # cursive (28)
- # data-science (2)
- # datomic (89)
- # duct (97)
- # emacs (4)
- # figwheel-main (12)
- # fulcro (37)
- # graphql (3)
- # java (3)
- # jobs (2)
- # juxt (3)
- # kaocha (37)
- # leiningen (2)
- # luminus (2)
- # off-topic (30)
- # onyx (2)
- # pathom (3)
- # qlkit (1)
- # re-frame (7)
- # reagent (2)
- # reitit (62)
- # remote-jobs (9)
- # shadow-cljs (26)
- # tools-deps (19)
- # vim (1)
- # yada (8)
Hi!
Are build reports supported on :npm-module
targets?
This the output I get with after clearing the cache and node_modules
:
...
[:npm] Build completed. (163 files, 104 compiled, 0 warnings, 35.70s)
shadow-cljs - config: /home/jenkins/jakarta/shadow-cljs.edn cli version: 2.7.22 node: v9.11.2
failed to run function: shadow.cljs.build-report/-main
{:tag :shadow.cljs.devtools.cli/clj-run, :main-sym shadow.cljs.build-report/-main}
ExceptionInfo: failed to run function: shadow.cljs.build-report/-main
clojure.core/ex-info (core.clj:4739)
...
Caused by:
NoSuchFileException: .shadow-cljs/release-snapshots/npm/latest/goog.debug.error.js.map
sun.nio.fs.UnixException.translateToIOException (UnixException.java:86)
sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:102)
sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:107)
sun.nio.fs.UnixFileSystemProvider.newByteChannel (UnixFileSystemProvider.java:214)
java.nio.file.Files.newByteChannel (Files.java:361)
java.nio.file.Files.newByteChannel (Files.java:407)
java.nio.file.Files.readAllBytes (Files.java:3152)
shadow.build.closure.SourceMapReport.getByteMap (SourceMapReport.java:57)
shadow.cljs.build-report/extract-report-data/fn--991/fn--993 (build_report.clj:126)
....
(`.shadow-cljs/release-snapshots/npm/latest/goog.debug.error.js.map` is indeed missing, but out of the 33 goog.* ns's in that folder, only 7 have sourcemaps)
those files were completely removed by DCE and are only there for compatibility reasons
but build report for npm-module isn't very useful since you are going to consume it somewhere else anyways
OK! I was mostly interested on checking whether the fdef's I wrote were leaking into prod, since everything is always on the classpath. (not enabled, since I'm not using orchestra, but present and unnecessarily increasing the payload)
fdefs will never be removed if they are in a namespace that was included in the build
(unless you manually hide them behind some (when ^boolean js/goog.DEBUG (s/fdef ...))
)
Yup, those were my fears... but it's nice to have a confirmation! Thanks for being so helpful!
Hello again!
Is it expected to get a compilation error when using #shadow/env
with an unset var on release builds?
$> npx shadow-cljs release npm
...
-> Closure - Optimizing ...
Closure compilation failed with 1 errors
--- goog/base.js:3
Invalid CLOSURE_DEFINES definition
The compile
task works without issue, and setting the var to nothing or the empty string also works (e.g. $> THE_VAR= npx shadow-cljs release npm
)
The config contains :closure-defines {the.ns/THE_VAR #shadow/env "THE_VAR"}
and the.ns
contains a (goog-define THE_VAR)
I might need it for both, but I can go around it by checking that it exists before calling shadow. Thanks! (yup I believe goog-defines can't be nil)