Raynes / tentacles

An Octocat is nothing without his tentacles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ClojureScript and caching support

lorddoig opened this issue · comments

I'm currently finishing up a half-baked fork with the codebase ported to CLJX so as to support ClojureScript. The motivation was a) to have cljs support; and b) to allow pluggable HTTP clients, which in turn allows caching to be performed at the request level so users (i.e. me) don't have don't have to wrap the whole API.

I'm considering submitting a PR but don't want to spend time tidying this up if the idea is a non-starter for you.

Thoughts?

I'm interested, but only if it doesn't significantly uglify or complicate the codebase because I'm not that interested in ClojureScript.

So, my answer is: probably, yes, please pull request it, I'll almost certainly take it.

Ok, cool. Why don't you take a look at the fork and let me know what you think. It's not done, and has some hairy edges, but I think it's going in a good direction. It's also in dire need of many more tests, and there's fair chance it might blow up under extensive use. The big changes are in core, util and http/* (and project.clj). I'd be grateful for input, especially regarding the builtin requesters which are currently pretty ugly.

Aside from the cljs support, the benefits of pluggable requesters can be seen in this little demo that just spits the request map out to the console. This kind of architecture makes it a breeze in terms of custom caching, logging, testing, etc. It also means that hard dependencies on clj-http, core.async, and even ClojureScript itself can be dropped.

There is additional complexity, but it's warranted (I think) and manageable.

Thoughts?

Oh and I still have to make a requester for nodejs.