This page is not created by, affiliated with, or supported by Slack Technologies, Inc.


@dnolen: Your talk from ClojuTRE was fantastic! 2 questions from it: - For individual improvements or issues I know that Jira has a lot of info, is there anywhere that has a sort of long term or wider view on the future possibilities of ClojureScript? Sort of the next 5 years in text form or a long term desired roadmap. The no externs and DCE on React in particular are pretty awesome possibilities that I've never thought of before. - Based on your experience and seeing the amount of work and time for ClojureScript to get where it is today, do you have any thoughts on what it would take to target another platform with the same approach (such as Swift or Erlang)? This question is way more related to curiosity than any need to do such a thing, but seeing the amount of work that goes into ClojureCLR for such little reach or usage makes me wonder if the ClojureScript path would make something like that more possible - I really would love to be able to use Clojure everywhere for everything and that's still a bit out of reach.


having issues with deps order under :whitespace mode, due to security restriction of chrome extensions, for content scripts I have to build one static js file, that is why I’m using :whitespace mode during development. Looks like under :whitespace the the sources of deps are concatenated. But this order might not sort deps in the the proper order where goog.provides go before goog.require calls. I ended up with a file where goog.require(“goog.labs.userAgent.util”) is called prior goog.provide(“goog.labs.userAgent.util”) call. Is this a known issue? Quick skimming through JIRA didn’t really give me anything like that.


@darwin FWIW I also don’t recall having seen that in JIRA. Can you repro using latest CLJS?


yes, using the latest, I will try to shrink it for more palatable repo case, definitely hit the problem by relying on some goog-related namespaces


@darwin can you repro it using advanced compilation?


testing it with advanced build right now, but I guess whole goog.require thing will be stripped there


I could maybe give you cljs_deps from :none build, where we will probably see the order :whitespace build


I assume :whitespace simply emits sources in the order it builds cljs_deps table


and that might not be correct


I need a confirmation for a behavior, I noticed that in replumb:

(def a 0)
(defmacro m [] `(println "hey"))
(keys (:defs (get-in [:cljs.analyzer/namespaces 'cljs.user]))) ;;=> (a m)


is it expected? because I remember I had to use the :macros key to inspect macros' ast before


@richiardiandrea it is if you define a macro at the REPL


because it’s defined in the same compilation stage


ok, so not if I return code from load-fn right? If so, I have a failing test in replumb that might show a bug (maybe?)


@anmonteiro FYI, under :advanced build all works as expected, there are no goog.require or goog.provide calls (using pseudonames, so I would spot it even after renaming)


@darwin I’ve also spotted subtle issues in :simple optimizations with cljs.pprint


it seems those compilation modes haven’t been given the same love as :advanced


I’m going to investigate the cljs_deps.js file under :none mode now


I think it will give us clue about the order


@richiardiandrea if we’re talking about the same thing, you can also reproduce that behavior in JVM ClojureScript


to recap, if we are talking about stages: if the load-fn actually returns a defmacro right there, I should see the macro symbol in :defs whereas if it uses require-macros it should appear under :macros, am I right?


I think quick solution would be to have post-process step for :whitespace/:simple modes and move all goog.provide calls at the beginning of the file, that would solve it


@richiardiandrea the following is in ./script/noderepljs

cljs.user=> (defmacro m [] `(println "key"))
cljs.user=> m
#object[cljs$user$m "function cljs$user$m(_AMPERSAND_form,_AMPERSAND_env){
return,,,,cljs.core.List.EMPTY,new cljs.core.Symbol("cljs.core","println","cljs.core/println",-331834442,null)),,cljs.core.List.EMPTY,"key"))));
cljs.user=> (m nil nil)
(cljs.core/println "key")


I think what you’re saying above is correct, yes


the thing to note is that the macro should be defined in cljs.user$macros


yes that part was clear, but replumb also tries to fetch things from the ast directly


I have been using this :whitespace setup for a while without problems. Today I reconfigured it and started using cljs-devtools via :preloads. This is probably the reason, either it triggered the bug or the bug is only related to preloads.


so a question (sorry, long) again for the new things, if I return:

(cb {:lang :clj
                             :file "fake-source/bar/core.cljs"
                             :source "(ns bar.core)
                                      (def foo 42)
                                      (def bar 42)
                                      (def baz 42)
                                      (defmacro unless [pred a b]
                                        `(if (not ~pred)
                                      (defmacro abs [x]
                                        `(unless (neg? ~x)
                                          (- ~x)))
                                      (defmacro sqrt [x]
                                        `(unless (neg? x)
                                          (Math/sqrt x)
                                            (ex-info \"Real plz\" {}))))"})
and then:
(require '[bar.core :refer [foo bar]])
(require-macros '[bar.core :refer [abs sqrt]])
is this correct?
(keys (get-in <@U07E9BBBN> [:cljs.analyzer/namespaces requirer-ns :use-macros])) ;; => (sqrt abs bar foo)
I am asking because before I use to receive only (sqrt abs)...


I have a test in replumb and it is the only one failing:


so I found the problem in the previous piece of code. By doing:

(require '[bar.core :refer [foo bar]])
(require-macros '[bar.core :refer [abs sqrt]])
and returning the same ns from the load function it looks like I am invoking code in the two different "stages" manually, and foo and bar are included in :use-macros together with abs and sqrt. Instead, with a normal:
(require '[bar.core :refer [foo bar] :require-macros [abs sqrt]])
The :use-macros key in the ast correctly contains only abs and sqrt


mmm...still something weird going on...I'll try to figure it out