[ANN] quile/component 0.2.2 - ClojureScript port of stuartsierra.com/component

134 views
Skip to first unread message

Kyle Dawkins

unread,
Oct 29, 2014, 9:05:56 PM10/29/14
to clojur...@googlegroups.com
Hey all

A few weeks ago I spent some time porting https://github.com/stuartsierra/component to ClojureScript. The results are here:

github: https://github.com/quile/component-cljs
Clojars: [quile/component "0.2.2"]

My motivation is pretty straightforward: I am keen to make node.js a really pleasant experience for cljs development. I've done a large amount of vanilla node.js dev, and the dependency-injection problem always reared its ugly head at inopportune moments, so making https://github.com/stuartsierra/component work in cljs seemed like a good idea. And it was! It works like a charm.

This port is fairly soft: there are still some failing tests (commented out) due to the differences in exception-handling between clj and cljs. Also, I had to port the underlying "dependency" library too:

github: https://github.com/quile/dependency-cljs

The upshot of all of this is that it's now very easy to create nicely modular node.js apps in ClojureScript, with their dependencies injected correctly. Fun.

Cheers!
Kyle

Daniel Kersten

unread,
Oct 30, 2014, 8:50:56 AM10/30/14
to clojur...@googlegroups.com
This is great! Thanks very much. I will play with this over the coming days.

Kyle

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Dylan Butman

unread,
Oct 30, 2014, 11:46:22 AM10/30/14
to clojur...@googlegroups.com
I was gearing up to have to do this myself in the next coming months! Awesome stuff, really much needed addition to cljs.

I'll dig in next week. point me towards your failing tests and maybe I can try to lend a hand.

Kyle Dawkins

unread,
Oct 30, 2014, 12:41:24 PM10/30/14
to clojur...@googlegroups.com
Hey!

Glad to help out - really we owe Stuart for making it all possible. I'm just stoked to have this facility in node.js now - makes node dev a whole lot more fun.

There are a couple of test failures in the dependency project

https://github.com/quile/dependency-cljs

but on deeper inspection I noticed a couple of things:

1) Tests fail in the same manner (but with slightly different results) in clojure 1.6
2) The tests are regarding topological sorting, and there are actually many valid topological sorts of the same graph, but the tests only check for a specific one - so IMHO the code is producing a valid sort, but the tests are failing because it's not the expected sort.

Also, in the component-cljs project, a lot of the exception-related code doesn't port well because Javascript handles exceptions so differently. This is where the chief problems are on the cljs side, and those tests are marked to only compile in Clojure, not ClojureScript for the time being. If you put them back in, you'll get the failures.

Cheers!
Kyle

Dylan Butman

unread,
Oct 30, 2014, 1:28:26 PM10/30/14
to clojur...@googlegroups.com
Interesting I’ll take a look. That makes sense about a valid but alternative topological sort. Perhaps changing the test to test for validity rather than expected would be a good solution.
> --
> Note that posts from new members are moderated - please be patient with your first post.
> ---
> You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/Yt8zWOpF_zU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages