-
Notifications
You must be signed in to change notification settings - Fork 85
Comprehensive enhancement to the build API #263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course approve!
src/cljs/bundled/lumo/closure.cljs
Outdated
(:file-min this))] | ||
file-min | ||
(:file this))] | ||
(when (and file (not (js/$$LUMO_GLOBALS.path.isAbsolute file))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this guy can become just path now.
src/cljs/bundled/lumo/closure.cljs
Outdated
@@ -1518,10 +1574,13 @@ | |||
{:url (js/$$LUMO_GLOBALS.path.resolve out-file) | |||
:out-file (.toString out-file)}))] | |||
(when (and (not js-module?) | |||
(or (not (js/$$LUMO_GLOBALS.fs.existsSync out-file)) | |||
(and res (util/changed? out-file res)))) | |||
(or (not (js/$$LUMO_GLOBALS.fs.existsSync out-file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too can change (minor of course, just marking)
(ex-info (str "Preprocess symbol " preprocess " is not fully qualified") | ||
{:file (:file js-module) | ||
:preprocess preprocess}))) | ||
preprocess-ns (symbol ns)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL you can do this :)
src/cljs/snapshot/lumo/repl.cljs
Outdated
((if macros? | ||
'#{cljs.core | ||
(if macros? | ||
('#{cljs.core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A contains?
would probably make this more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pr welcome
4dc6021
to
3234870
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you are having a lot of fun! 😄
(contains? (:js-dependency-index cenv) (name dep)) | ||
(ana/node-module-dep? dep) | ||
(ana/js-module-exists? (name dep)) | ||
(deps/find-classpath-lib dep)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, was there a problem with the old load?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cljs.js/analyze-deps
will try to load stuff that we don't know how to load (e.g. "module$...$left_pad"
) but it's safe to assume they exist.
same thing that's done here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool thanks for explaining that
(jar-resource? x) | ||
(str "jar:file:" (.-jarPath x) "!/" (.-src x)) | ||
|
||
:else (throw (js/Error. (str "Expected file, url, or string. Got " (pr-str x)))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way better!
3f1292c
to
26c1680
Compare
I willmention the callback on build in the changelog, tomorrow though 😄 |
This change was made necessary by the fact that the bootstrap compiler is asynchronous by default. Therefore, it does not make sense to call lumo.build.api/build without a callback. The patch does not break old code, so it still contains the arity without cb, in which case it hooks a default callback that just returns the input.
c2fa3fd
to
0f58073
Compare
fixes #244
fixes #98