This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-04
Channels
- # beginners (56)
- # boot (11)
- # cider (1)
- # clojure (112)
- # clojure-denmark (4)
- # clojure-russia (7)
- # clojurescript (45)
- # component (1)
- # cursive (19)
- # data-science (10)
- # datacrypt (1)
- # datascript (22)
- # datomic (3)
- # defnpodcast (2)
- # emacs (4)
- # fulcro (26)
- # hoplon (21)
- # jobs-discuss (5)
- # klipse (5)
- # onyx (8)
- # portkey (1)
- # re-frame (8)
- # reagent (17)
- # ring (7)
- # shadow-cljs (14)
- # spacemacs (9)
- # vim (4)
what the difference between specifying in project.clj
for :cljsbuild {:builds
a vector or a map of different build profiles?
Took quite a while to track down an explanation of this, but I think I found it: https://numergent.com/2015-07/cljs-build-configuration-tip-prefer-maps-over-a-vector.html
different templates do it in different ways, but I'm guessing it's just different syntax for the same things.
@ajs the order of :source-paths
rarely matters, code is sorted in dependency order based on the :require
. since nothing depends on the entry it will be loaded “last”.
in dev :main
is required since that triggers the include of the actual file, eg. goog.require
in optimized builds everything is in one file, so there is no need to require more files
Took quite a while to track down an explanation of this, but I think I found it: https://numergent.com/2015-07/cljs-build-configuration-tip-prefer-maps-over-a-vector.html
Hi @smith.adriane! How are you? Yesterday we've talked about jQuery plugin treetable...
I can use that only on browser console... in cljs code I can't...
I can't yet figure out how to make it visible to my cljs code
I'm struggling with foreign-libs
option but I can't find any example for a jquery plugin
i think something like (-> (js/jQuery "#treeid) (.treetable))
or without the threading macro
(.treetable (js/jQuery "#treeid"))
I haven't figure out how "import" the lib to be able to referencing inside cljs
I've declared foreign-libs
is it needed (to use foreign-libs)?
Or do just include the references inside .html?
for compiling without optimizations, it doesn’t matter
once you start building with advanced optimizations, I think you just need to 1) have the script included before the cljs file 2) setup the externs correctly
it might not be working because the treetable script is in your html document after the cljs file
I guess it’s kinda weird because treetable depends on javascript, which is included with your cljs outputfile
maybe foreign libs is the right way to do it
now i've moved that to before
because i've found that the cljs/bootstrap was including jquery
well, treetable depends on jquery
which is in the cljs output file
so it was causing some kind of conflict
and if you reference treetable in your cljs, then it depends on treetable
so, for tests, i've removed cljsjs/bootstrap
and have included a script tag in .html to load jquery before treetable
you can also add cljsjs/bootstrap as a dependency and tell it to exclude jquery
anyway, if you have the script tags setup as jquery, then treetable, then your cljs code
then you should be able to use (.treetable (js/jQuery "#treeid"))
as above
I should "require" it in my ns?
i mean, "require jquery"...
i will try again with your tips. thank you!
you won’t need to require
it in your ns
if you add the treetable plugin into cljsjs
then it’s a lot easier
since you can just add it as a dependency and then require
and then you’re good to go