Fork me on GitHub
#clojurescript
<
2017-12-26
>
deg12:12:26

I'm breaking up a project into multiple libraries and realized that I don't really understand the CLJS compilation model. So, tl;dr - what is a good doc on how all the pieces fit together? Or, less vague: - Assume project main has a dependency on project sub. Both built with lein and using cljsbuild, - Assume, too, that main has a dev build with :optimizations :none and a production build with :optimizations :advanced. What determines how the code of sub will be optimized in main?

dnolen13:12:35

Google Closure is whole program optimization

dnolen13:12:43

so sub will be optimized depending on how main uses it

deg13:12:24

Thanks! I had thought so, but was being faked out by a mistake that suggested otherwise. Now fixing my real problem...

deg13:12:58

Related question: What is goog.DEBUG and who sets it? (Sorry for this dumb question; the answer is buried in too many "goog.debug" by case-insensitive google search). I'm working with a project.clj that sets it to false in production build, but I'd like to be sure I understand why it's true in my dev build.

thheller14:12:05

in CLJS you'd use the goog-define macro to do the same

thheller14:12:19

:closure-defines override the default values

johnjelinek23:12:25

what's a promise / async / await equivalent in cljs?

carkh23:12:21

i want to say core.async

johnjelinek23:12:42

ya, that's prolly the idiomatic way -- but, what's a more rough translation?

johnjelinek23:12:01

something like js/Promise?

johnjelinek23:12:30

but then async/await keywords are sugar -- how would those be referenced in cljs (or would they)?

carkh23:12:56

the promesa library might be closer to what you want ?