Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Comprehensive enhancement to the build API #263

Merged
merged 4 commits into from
Sep 17, 2017
Merged

Conversation

anmonteiro
Copy link
Owner

@anmonteiro anmonteiro commented Sep 10, 2017

fixes #244
fixes #98

Copy link
Collaborator

@arichiardi arichiardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course approve!

(:file-min this))]
file-min
(:file this))]
(when (and file (not (js/$$LUMO_GLOBALS.path.isAbsolute file)))
Copy link
Collaborator

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.

@@ -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))
Copy link
Collaborator

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)]
Copy link
Collaborator

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 :)

((if macros?
'#{cljs.core
(if macros?
('#{cljs.core
Copy link
Collaborator

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

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pr welcome

Copy link
Collaborator

@arichiardi arichiardi left a 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))
Copy link
Collaborator

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?

Copy link
Owner Author

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

Copy link
Collaborator

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))))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way better!

@anmonteiro anmonteiro force-pushed the compiler-tweaks branch 2 times, most recently from 3f1292c to 26c1680 Compare September 13, 2017 05:50
@arichiardi
Copy link
Collaborator

I willmention the callback on build in the changelog, tomorrow though 😄

anmonteiro and others added 4 commits September 16, 2017 16:42
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.
@anmonteiro anmonteiro merged commit 937ee92 into master Sep 17, 2017
@anmonteiro anmonteiro deleted the compiler-tweaks branch September 17, 2017 04:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ns form require of npm dependencies does not seem to work Does not resolve clojure.set
2 participants