3 ms·
If I control both the backend and the frontend, yes. Server-only async components on top of layout/page component hierarchy, components -> DTO layer -> Prisma.
by berekuk 10mo ago
If I control both the backend and the frontend, yes. Server-only async components on top of layout/page component hierarchy, components -> DTO layer -> Prisma. Similar to this: https://nextjs.org/blog/security-nextjs-server-components-actions https://nextjs.org/blog/security-nextjs-server-components-ac...
You still need API routes for stuff like data-heavy async dropdowns, or anything else that's hard to express as a pure URL -> HTML, but it cuts down the number of routes you need by 90% or more.
- skydhash 10mo agoYou’re just shifting the problem from HTTP to an adhoc protocol on top of it.
- afavour 10mo agoYes but they’re also shifting the problem from one they explicitly have to deal with themselves to one the framework handles for them. Personally I don’t like it but I do understand the appeal.
- skydhash 10mo agoMaybe, but you go from one of the most tested protocol with a lot of tooling to another with not even a specification.