This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-09
Channels
- # beginners (140)
- # boot (163)
- # cider (43)
- # cljs-dev (50)
- # cljsjs (5)
- # cljsrn (38)
- # clojure (152)
- # clojure-austria (10)
- # clojure-berlin (9)
- # clojure-dev (11)
- # clojure-japan (1)
- # clojure-miami (2)
- # clojure-russia (147)
- # clojure-sg (12)
- # clojurescript (244)
- # code-reviews (3)
- # cursive (104)
- # data-science (5)
- # datavis (15)
- # datomic (35)
- # editors (4)
- # hoplon (1)
- # ldnclj (11)
- # lein-figwheel (14)
- # leiningen (22)
- # off-topic (53)
- # om (373)
- # omnext (2)
- # onyx (67)
- # parinfer (193)
- # re-frame (23)
- # reagent (89)
- # yada (7)
if you want to reference the component directly, my instinct is to reference it without the vector, and put it into a vector in app-bar
. but i'd consider abstracting that a bit, using a keyword value for :icon-element-right
and letting app-bar
decide how to use that param
you may want something like [ui/app-bar {:icon-element-right (my-component)}]
but that feels gross
does it really expect components as params, rather than as children?
i've never really used react outside of cljs, but that SEEMS unidiomatic to me
no that that helps you here
@eyelidlessness: thx anyway
digging through reagent rendering flow, it appears that they use reagent.impl.template/as-element
to convert the vector into react dom
@eyelidlessness, @jaen Thanks!
cheers
granted going into impl
is not necessarily advised
@eyelidlessness: it’s publicly exposed
@jaen: made a macro that calls reagent.core/adapt-react-class
on a list of MaterialUI components i want
adapted from https://github.com/tuhlmann/reagent-material/blob/master/src/clj/material_ui/core.clj
I was so crazy that once time I actually started hacking on Clojurescript compiler so it accepted Common JS libraries as-is.
It would be excellent, if we ultimately moved past having to specify externs -- I just went through it for the first time, with a fairly complex JS library, and while it's fairly easy once you understand it, it definitely requires some time to understand in the first place.
LOL, I should set up a consultancy to write people's externs files for them, save other people the hassle 😉
I like cljsjs fine, but there are so many libs that aren't in it yet...although it was gratifying to add on and chip away slightly at that list 😉
I'm not sure if there's anything on the externs generation front in the Clojurescript compiler right now.
@eggsyntax: she didn’t really talk about it at the Conj. i just recall seeing some of the work a couple of months ago
:module-option
option as described here - https://github.com/clojure/clojurescript/wiki/Compiler-Options#foreign-libs - is about the only 100% finished part.
I'm a bit disappointed it stopped at this point - hence why I started hacking on it - but it feels as if upstream isn't really all that interested in it : V
Well, there's probably more interest in that, I was talking about incorporating module conversion into the compiler. But I don't think there was any work done on that since either.
there’s a little on other module systems at https://github.com/google/closure-compiler/wiki/Working-With-Multiple-Module-Systems
Heh, it's all a bit tricky in practice - for example you can't really translate module names to usual.clojure.module.namespaces
because due to how GClosure modules work it will overwrite Javascript module structures and such.
@eggsyntax, @jaen: http://blog.dotnetwise.com/2009/11/closure-compiler-externs-extractor.html
I gave that a shot at one point, but couldn't get it to work for me. Note the 2009 date. I didn't try that hard, though. Looking at the last link @jaen posted, though,, I saw it mentioned this lein plugin, which I hadn't run across before: https://github.com/ejlo/lein-externs