-
Notifications
You must be signed in to change notification settings - Fork 85
Add callback to lumo.build.api/build #265
Add callback to lumo.build.api/build #265
Conversation
1fb765c
to
92ba898
Compare
92ba898
to
5522ae0
Compare
src/cljs/bundled/lumo/build/api.cljs
Outdated
([source opts compiler-env] | ||
(build source opts compiler-env (fn [& args] args))) | ||
([source opts compiler-env cb] |
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 was even wondering if we could accept the classic node (fn [err data] ...)
callback so that you could promisify
on it...but then I told myself: "KISS!!"
5522ae0
to
05d3325
Compare
3f1292c
to
26c1680
Compare
075c4a0
to
57b4230
Compare
src/cljs/bundled/lumo/closure.cljs
Outdated
@@ -2152,17 +2152,16 @@ | |||
|
|||
(defn build | |||
"Given a source which can be compiled, produce runnable JavaScript." | |||
([source opts] | |||
([source opts cb] |
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 still needs the 2-arity function
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.
Why? Is it used? Do you prefer it? To avoid duplication, the default callback is passed in.i can add it back if you want to
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.
JVM CLJS has a 2-arity version. I think we should have one too
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.
Ok np will add it back
57b4230
to
0683c36
Compare
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.
0683c36
to
bac34a9
Compare
Ok this should be ok now, no changes in |
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.
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.
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,
but includes a warning if that arity is invoked.