Fork me on GitHub
Martynas Maciulevičius10:04:10

Hey. I've opened the docs and I have an immediate question: Can biff serve a back-end for an app (RN, Android, SPA and not only web)? Are there any diagrams? For instance I tried re-frame some time ago and first thing they show is diagrams: Can biff be compared to re-frame in some way? Because from the docs I feel the same way as "oh hey, I don't know what it is but it's a Ruby app".

Jacob O'Bryant18:04:24

You could use it as a back-end for an app. You'd just need to set up the app code on your own, since Biff only comes with a template project for web--and if you're doing that anyway, setting up the back-end by hand may not be much harder than using Biff anyway. (My own approach has been to just build responsive websites that work for both desktop and mobile, though I understand in a lot of cases you do need a real app.) There's a diagram here: though perhaps not exactly what you're looking for 🙂 Biff is a server-side framework, similar to Rails or Django. Re-frame on the other hand is a front-end framework. Re-frame is useful if you're making a regular SPA, where you have a lot of code on both the back-end and on the front-end. By using htmx, Biff lets you get some of the advantages of a SPA while still keeping the vast majority of your code on the back-end. So with Biff there isn't any need for a front-end framework like Re-frame. (Rails also takes this approach, but with instead of htmx. From a distance it seems like htmx is gaining adoption among Django devs too. I'd also put Phoenix LiveView in this general category. This was a nice post about the movement:

Martynas Maciulevičius18:04:00

I was looking for a diagram of the network. What happens when 🙂 I think it may be useful not only in my case 🙂 Maybe it's trivial to understand but I remember you were talking about pushes and so on. And if that happens then why not have a diagram 🙂

Jacob O'Bryant18:04:43

pushes as in websocket pushes? in any case you're probably right; a diagram might be handy. Could include regular HTMX request/responses, and also websockets + transaction listener. I just made an issue for it:

Martynas Maciulevičius18:04:12

Thanks :)) It could be for the future. Currently I'll watch a video 😄

🎅 1