Fork me on GitHub
#fulcro
<
2017-09-18
>
tony.kay03:09:11

So, I just spent some time playing with using node modules from cljs with Fulcro. I tried http://blueprintjs.com/.

tony.kay03:09:02

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.

tony.kay04:09:18

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

tony.kay04:09:29

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

tony.kay04:09:38

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.

tony.kay05:09:25

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.

tony.kay05:09:15

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.

tony.kay05:09:28

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: https://github.com/awkay/node-trial 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.

roklenarcic10:09:40

Hopefully all node module kinks will get worked out soon

currentoor14:09:49

This react blueprint stuff sound great!

cjmurphy18:09:14

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...

wilkerlucio19:09:01

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

cjmurphy19:09:09

perfect thanks @wilkerlucio

wilkerlucio19:09:50

no problem 😉

roklenarcic20:09:16

hm what is this blueprint stuff? Alternative to bootstrap?

tony.kay22:09:14

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

tony.kay22:09:53

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).

tony.kay22:09:15

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