Fork me on GitHub

So, I just spent some time playing with using node modules from cljs with Fulcro. I tried


The good news: I got something to work (a spinner). The config wasn’t too difficult, there was a bit of a hassle making sure I had the react and react-dom stuff right (I’m still vague on that, but I think I got it). The bad news: It made compiling quite a bit slower.


The promising: no one expected that kind of slowdown, so it is being worked on 🙂


Better news: Antonio just figured the problem out and fixed it bananadance


So, the fix works on the general compile speed. Unfortunately, there is another speedup needed to make figwheel usage good. Right now hot code reload is slow due to the node modules being reprocessed on every hot code reload…making a change to a simple file in a simple project takes 12s on my machine.


According to Antonio, no one has implemented caching for that, so the more node deps you pull in, the slower hot code reload will get.


But, this is all actually good news. It really is pretty easy to use npm js libs from a source and project perspective. So, I think all the hard technical hurdles are mostly complete.


If anyone is interested. here is the project, with a working simple usage in src/main/node_trial/ui/components.cljs on the cards build: It requires a build with Antonio’s patch to compile fast, but if you drop the cljs version back to 908, it will work, just slowly.


Hopefully all node module kinks will get worked out soon


This react blueprint stuff sound great!


What is a good place to do a transact! on startup? Can it be done from :started-callback? My first naive attempt was to pass app to transact! in :started-callback, but that results in the assertion failure: (or (component? x) (reconciler? x)). What should my next attempt be? I'd prefer not use onComponentDidMount or some other React lifecycle method, unless that's the best place...


@cjmurphy you can do at :started-callback, just do as (om/transact! (:reconciler app) [your-tx])


perfect thanks @wilkerlucio


no problem 😉


hm what is this blueprint stuff? Alternative to bootstrap?


you can follow the link 🙂 I mention it because I did an experiment in integrating with external js libs, and used it as an example lib…since a lot of ppl would like pre-built active components


I think I like semantic UI React better, though. All of it’s components have controlled versions (so you can avoid component-local state if you wish).


Unfortunately, I didn’t have as easy of a time getting it to work. I’m still digging into why.