This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-18
Channels
- # aleph (45)
- # aws (4)
- # beginners (56)
- # boot (2)
- # cider (45)
- # clara (2)
- # cljs-dev (9)
- # cljsrn (31)
- # clojure (71)
- # clojure-dusseldorf (8)
- # clojure-gamedev (1)
- # clojure-italy (22)
- # clojure-nl (1)
- # clojure-russia (46)
- # clojure-sg (1)
- # clojure-spec (5)
- # clojure-uk (40)
- # clojurescript (30)
- # community-development (3)
- # cursive (17)
- # data-science (1)
- # datomic (18)
- # emacs (3)
- # figwheel (1)
- # fulcro (19)
- # hoplon (12)
- # jobs (5)
- # leiningen (42)
- # off-topic (12)
- # om (2)
- # onyx (41)
- # re-frame (19)
- # ring-swagger (1)
- # rum (3)
- # shadow-cljs (4)
- # specter (7)
- # unrepl (2)
- # vim (25)
- # yada (24)
So, I just spent some time playing with using node modules from cljs with Fulcro. I tried http://blueprintjs.com/.
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.
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:
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.
sounds great
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