Fork me on GitHub
#clojurescript
<
2017-11-04
>
ajs00:11:07

what the difference between specifying in project.clj for :cljsbuild {:builds a vector or a map of different build profiles?

ajs00:11:45

different templates do it in different ways, but I'm guessing it's just different syntax for the same things.

thheller08:11:52

@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”.

thheller08:11:06

in dev :main is required since that triggers the include of the actual file, eg. goog.require

thheller08:11:29

in optimized builds everything is in one file, so there is no need to require more files

ajs08:11:07

Thank you

alice20:11:59

Anyone know how to copy text to the clipboard?

alice20:11:12

specifically if I click an element for example, but i could make a button if necc ig

gleisonsilva22:11:20

Hi @smith.adriane! How are you? Yesterday we've talked about jQuery plugin treetable...

gleisonsilva22:11:56

I can use that only on browser console... in cljs code I can't...

gleisonsilva22:11:03

I can't yet figure out how to make it visible to my cljs code

gleisonsilva22:11:59

I'm struggling with foreign-libs option but I can't find any example for a jquery plugin

phronmophobic22:11:33

i think something like (-> (js/jQuery "#treeid) (.treetable))

phronmophobic22:11:53

or without the threading macro

phronmophobic22:11:08

(.treetable (js/jQuery "#treeid"))

gleisonsilva22:11:59

I haven't figure out how "import" the lib to be able to referencing inside cljs

gleisonsilva22:11:11

I've declared foreign-libs

gleisonsilva22:11:50

is it needed (to use foreign-libs)?

gleisonsilva22:11:15

Or do just include the references inside .html?

phronmophobic22:11:02

for compiling without optimizations, it doesn’t matter

phronmophobic22:11:05

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

phronmophobic22:11:30

it might not be working because the treetable script is in your html document after the cljs file

phronmophobic22:11:24

I guess it’s kinda weird because treetable depends on javascript, which is included with your cljs outputfile

phronmophobic22:11:28

maybe foreign libs is the right way to do it

gleisonsilva22:11:37

now i've moved that to before

gleisonsilva22:11:59

because i've found that the cljs/bootstrap was including jquery

phronmophobic22:11:02

well, treetable depends on jquery

phronmophobic22:11:16

which is in the cljs output file

gleisonsilva22:11:25

so it was causing some kind of conflict

phronmophobic22:11:36

and if you reference treetable in your cljs, then it depends on treetable

gleisonsilva22:11:53

so, for tests, i've removed cljsjs/bootstrap

gleisonsilva22:11:14

and have included a script tag in .html to load jquery before treetable

phronmophobic22:11:39

you can also add cljsjs/bootstrap as a dependency and tell it to exclude jquery

phronmophobic23:11:17

anyway, if you have the script tags setup as jquery, then treetable, then your cljs code

phronmophobic23:11:42

then you should be able to use (.treetable (js/jQuery "#treeid")) as above

gleisonsilva23:11:38

I should "require" it in my ns?

gleisonsilva23:11:58

i mean, "require jquery"...

gleisonsilva23:11:36

i will try again with your tips. thank you!

phronmophobic23:11:11

you won’t need to require it in your ns

phronmophobic23:11:49

if you add the treetable plugin into cljsjs

phronmophobic23:11:53

then it’s a lot easier

phronmophobic23:11:01

since you can just add it as a dependency and then require

phronmophobic23:11:08

and then you’re good to go