Fork me on GitHub
#reagent
<
2018-12-11
>
Whiskas12:12:21

Can you recommend me some material explaining the best way to integrate these things into a reagent/re-frame project?

Whiskas12:12:39

Like, how to compile, and reference the JSX files from Reagent

bmills16:12:52

@mateus.pimentel.w You can include JS libs using CLSJ's foreign libs configuration. I suggest consulting your build tools docs (such as figwheel or shadow) to figure that out.

Whiskas16:12:34

JSX compiled modules are also optimized by closure?

Whiskas16:12:52

with shadow-cljs for example

justinlee16:12:08

you’ll need to compile the jsx to es6 at least. surely material-ui comes with a umd bundle?

bmills16:12:54

I create a bundle with webpack that gets imported via fighweel. Not sure how shadow would do it, since you can import directly. But yea, I imagine everything is in es5/6 by the time it hit closure

justinlee16:12:45

@mateus.pimentel.w if material ui really don’t come with es6 sources (weird), then you either need to webpack it or you can configure shadow-cljs to perform the jsx babel transform on it directly. https://shadow-cljs.github.io/docs/UsersGuide.html#_javascript_dialects

bmills17:12:07

also, FYI @material-ui/core is HUGE (like 6-8MB). So even if the tree-shaking would work, I would suggest still using per-component imports.