Using fetch with just ring/compojure (as opposed to noir)?

152 views
Skip to first unread message

Tim Galebach

unread,
Oct 9, 2012, 2:58:36 AM10/9/12
to clj-...@googlegroups.com
Hey, I generally use some of noir's pieces as little plugins to my app, but I generally prefer to set things up using compojure more explicitly.

I am having a bit of trouble fitting fetch into that framework, since defremote seems to hook into noir the same way that defpage does. Are there any examples of integrating fetch into compojure routes/using it standalone?

Jan Doms

unread,
Dec 30, 2012, 12:55:19 PM12/30/12
to clj-...@googlegroups.com
I wanted the same thing ... so I turned fetch into lib-fetch.
The result is available at https://github.com/domsj/lib-fetchhttps://github.com/domsj/lib-fetch . Example usage is shown in https://github.com/domsj/lib-fetch-example .
Any suggestion (or pull requests) are welcome.

Jan

Jan Doms

unread,
Dec 30, 2012, 12:56:20 PM12/30/12
to clj-...@googlegroups.com

Frank Siebenlist

unread,
Dec 31, 2012, 12:49:48 AM12/31/12
to clj-...@googlegroups.com, Frank Siebenlist
Could anyone compare this approach to: "https://github.com/shoreleave/shoreleave-remote-ring" ?

Thanks, FrankS.

Jan Doms

unread,
Dec 31, 2012, 4:22:50 AM12/31/12
to clj-...@googlegroups.com, Frank Siebenlist
Thanks for pointing out the shoreleave-remote-ring repository, I didn't know it existed!

Looking at the code the major difference is that in lib-fetch there is both server side and client side code included.
With shoreleave-remote-ring you'll also have to include shoreleave-remote, but that shouldn't be a problem.
Also shoreleave-remote-ring only requires ring while mine requires compojure too.

Truth be told, I don't want to be maintaining anything when a good solution already exists (aside from my lazyness there is no need to add more libraries causing more confusion)... so eh, feeling kinda dumb about it, but I'm going to remove mine.

Well at least Tim, me and other mailinglist readers have a good answer now :-).

Thanks again for pointing that out,
Jan.

Frank Siebenlist

unread,
Dec 31, 2012, 1:26:10 PM12/31/12
to Jan Doms, Frank Siebenlist, clj-...@googlegroups.com
I was looking for exactly the same "fetch-for-ring-compojure" solution after the noir death-announcement.

It is a true challenge to find all the usefull libraries out there in the clojure-universe - wish that we had a better clearing house - google is less than perfect.

Not sure how well the shoreleave libraries are maintained though… doesn't seem to see a lot of action lately and those libs need to be updated for the latest cljs-features…

Regards, FrankS.
Reply all
Reply to author
Forward
0 new messages