cljsjs

jiangts 2016-06-26T08:18:03.000196Z

this is a noob question, but how do you package react components into UMD modules (to be consumed by cljsjs)? I'm having trouble navigating through babel + webpack builds in libraries such as https://github.com/andreypopp/react-fa

jiangts 2016-06-26T08:18:41.000198Z

in that repo, they give an example of how to use webpack to package an example app using the library but not the library itself.

juhoteperi 2016-06-26T08:25:46.000199Z

@jiangts: That library uses webpack to bundle styles from JSX into CSS bundle etc.

juhoteperi 2016-06-26T08:25:54.000200Z

That won't be possible with Cljsjs/Cljs

juhoteperi 2016-06-26T08:26:25.000201Z

Or something

juhoteperi 2016-06-26T08:26:34.000202Z

I don't really understand why they use Webpack there

juhoteperi 2016-06-26T08:27:00.000203Z

Also, the implementation of Icon component is 10 lines in Cljs

juhoteperi 2016-06-26T08:33:14.000204Z

@jiangts: Not worth using JS lib for this, I think: https://gist.github.com/Deraen/8b631c587335a71f9862b744c65ac37b

jiangts 2016-06-26T08:42:07.000205Z

@juhoteperi right -- it was trivial to do in reagent, but in general I'd like to figure out how to package arbitrary react components to use in my project, rather than only be able to use pre-packaged ones

jiangts 2016-06-26T08:42:50.000206Z

@juhoteperi: also, is it really impossible? can't we get webpack to emit a UMD js file and a css file and just include those into the html?

jiangts 2016-06-26T08:43:11.000207Z

perhaps not really possible to distribute the css in cljsjs, but the js should work right?

juhoteperi 2016-06-26T10:05:53.000208Z

I have no idea about UMD modules

juhoteperi 2016-06-26T10:06:54.000211Z

Some packages call webpack to build something