Fork me on GitHub
#reagent
<
2016-04-02
>
jiangts02:04:59

how do I include external react components into my CLJS compile? Almost all of them are commonjs modules and :foreign-libs isn't working for me

madstap03:04:00

Hi, does anyone know of a relatively maintained example app with a datomic backend and re-frame frontend? Kinda like this I guess https://github.com/bellkev/dacom

mccraigmccraig07:04:36

@jiangts: i've used browserify for this, creating a little shim that requires the module and stashes it on window for easy access

jiangts16:04:11

@mikethompson: yeah, I checked that link as well (similar to what @mccraigmccraig stated). maybe it's because i'm not too familiar with browserify, but unfortunately when I tried that I got some weird error saying I was require-ing two React.js's and it was having a problem

jiangts16:04:52

also it's not super desirable because I care about my build size and if I do it this way, all the code in my shim will have 1 copy of react and all my reagent code has its own copy

jiangts16:04:08

my latest attempt was to study how cljsjs packages were created, but I still haven't gotten it working

adamkowalski20:04:29

@mikethompson: is it recommended to use browserify to use npm modules in the browser with cljs, or have people had luck with something like webpack?

mikethompson23:04:42

@adamkowalski: Sorry, I don't have deep knowledge around all this. I'd suggest asking in #C03S1L9DN channel.