Hacker News new | ask | show | jobs
by quechimba 1106 days ago
Nice! I believe this is a really good approach for making web apps. Best part is probably that you save time by not having to implement some sort of JSON API for your frontend to communicate with your backend.

I've been working on a similar thing in Ruby. https://github.com/mayu-live/framework

1 comments

Nowdays, with automatic api generation for your API, there's no difference in backend/frontend communication in type-safe way.
Curious what automatic generation you have in mind?
Say you have a function in the backend, for example in typescript:

function handler(a: A, b: B) {}

With a suitable tooling, you can generate the type for frontend to call handler(a, b) in a type-safe way, which could be validated on the backend and frontend.

So you're just a "generation" step away from bluring BE/FE communication.

Apologies, I know what generation is. But the ABI that is the wire between the front and the back is notorious for not being stable. Such that I was asking if you have experience with a generation stack that is favorable. Most folks I know do not have favorable experience in this realm. Best I know of, are those that drop down to something like protobuff to describe the messages.