Fork me on GitHub

is there a way to write this more elegantly? I want to have appear only once in all this requires...?


looks fine to me. and no there is no way to make it "shorter".


I have seen in some project a shorter syntax... just cannot find it anymore


that likely was CLJ. CLJS doesn't support that syntax.


I wonder why it doesnt...


Do you remember the syntax for clj ?


Does not help me in cljs cleanup,


but this thigs are impossible to google for


dunno what that syntax is called either ... require lists or something. its basically just nested vectors (:require [ [palette kernel [message :as m] doc]])


I personally hate that syntax so I never bothered asking why it wasn't added


way harder to refactor those nested lists and stuff


The undesired namespace syntax is "prefix list"

👍 4

any idea how to properly reference goog.debug/Console? new clojurescript is giving me a warning, had to escape into js/ land:

paul a17:12:20

i have two cljs files, index.cljs and foo.cljs, which are independent of one another and only used on their respective html pages, index.html and bar.html. i'm having trouble configuring a clojurescript build to generate separate and independent index.js and foo.js files. can anyone here suggest some advice/examples/documentation?

paul a17:12:41

for some context, i'm using lein-cljsbuild.

paul a18:12:49

i managed to make a little more progress - i can get the js files to build now:

{:cljsbuild {:builds [{:id :index
                       :source-paths ["src/cljs/my_app"]
                       :main "my-app.index"
                       :jar true
                       :compiler {:modules {:main {:entries [my-app.index]
                                                   :output-to "resources/public/assets/js/main.js"}}
                                  :optimizations :advanced}}
                      {:id :foo
                       :source-paths ["src/cljs/my_app"]
                       :main ""
                       :jar true
                       :compiler {:modules {:main {:entries []
                                                   :output-to "resources/public/assets/js/foo.js"}}
                                  :optimizations :advanced}}]}}

paul a18:12:43

but the resulting js files are missing something: ReferenceError: lx is not defined

paul a18:12:22

i was trying this without modules earlier - that way, i was generating two JS files, but each one seemed to contain all of my cljs

paul a18:12:45

well, i think i managed it, finally, after a few hours of this

paul a18:12:22

:cljs-base helped

paul a18:12:25

here's what i've got:

paul a18:12:26

:cljsbuild {:builds [{:id :frontend
                      :source-paths ["src/cljs/my_app"]
                      :main "my-app.index"
                      :jar true
                      :compiler {:modules {:main
                                           {:entries [my-app.index]
                                            :output-to "resources/public/assets/js/index.js"}

                                           {:entries []
                                            :output-to "resources/public/assets/js/foo.js"}

                                           {:output-to "resources/public/assets/js/cljs_base.js"}}
                                 :optimizations :advanced}}]}

paul a19:12:11

and then i load cljs_base.js on my html pages, alongside either index.js or foo.js