2 ms·
Hi, Biff author here. There's background info + comparison to Firebase in the link, but to briefly summarize: I've been doing Clojure web dev for a while but h
by jacobobryant 6y ago
Hi, Biff author here. There's background info + comparison to Firebase in the link, but to briefly summarize:
I've been doing Clojure web dev for a while but hadn't found a setup that I
really liked yet. My latest approach was using Firebase + ClojureScript (for my
startup[1]) which was really nice but had some significant limitations for my
use case (mostly related to the ephemeral Node backend). At one point I
realized that I could provide Firebase's query subscription feature using
Crux[2] instead without too much effort. So I started working on Biff, and I've
been using it in production for 2.5 months now. It's been a joy to use.
Also, I do think that web dev in Clojure can be a little hard to get into, due
to the (appropriate) community preference for libraries over frameworks. I
think there is a need for more frameworks that curate a set of libraries for
you. I'd love it if Biff eventually became a sort of "Rails for Clojure" that
would let anyone get up to speed quickly but would allow you to switch out the
components easily as you go on.
(About the name: I named it after Biff Tannen from Back to the Future).
[1] https://findka.com https://findka.com
[2] https://opencrux.com https://opencrux.com
- raphar 6y agoI could not find this info in the docs or the faq: Is Biff suitable for a Javascript front end? is there an API for a plain JS frontend to use Biff? (I like clojure backends with boring JS in the front) That's my only question about it. Thank you for sharing it. I found the project very enjoyable to browse and really appreciate that you shared several of your key design decisions. Good Work!
- jacobobryant 6y agoThanks! I haven't used a plain JS backend with it myself, but I think that would work well (the majority of Biff is backend code anyway). I haven't exposed a JS api, but doing so should be pretty easy. All of Biff's frontend code is in the biff.client namespace, and the only function you need is biff.client/init-sub [1], which takes: - an atom, the contents of which describe what data you're subscribing to - another atom, which is populated with the results of your subscriptions - a function for handling server-sent websocket events (if your app uses any) and it returns a function for sending websocket events to the server (which is used for sending transactions + any custom events you define). [1] https://github.com/jacobobryant/biff/blob/98ad188924bee9121d3870d2a3500519ded76eb1/example/src/example/client/app.cljs#L18 https://github.com/jacobobryant/biff/blob/98ad188924bee9121d...