News for hackers. Stuff that matters.
Re:Blitz: A Fullstack React Framework, Built on Next.js by vikingcaffiene on Sunday June 06, 2021 @09:23PM (#27418016)
> ““Zero-API” data layer lets you import server code directly into your React components instead of having to manually add API endpoints and do client-side fetching and caching.“

Sigh… I’m sure the author(s) of this framework mean well and sincerely believe this to be a good thing. I can tell you from having experienced php templates that did stuff like this that this is a terrible idea in practice. Worse, you won’t know it is until you’ve built quite a mess.

Consider for example needing to make a change to a view but your existing view has tons of data access logic embedded right in it. Now consider if there was tons of mission critical data access code inside sub components. Right there you’ve got to do a pretty risky rewrite just to change some UI.

I’m sure it’s possible to use this framework and speak to server concerns in such a way as to keep presentation and business logic concerns separate? but it’s way harder to do at scale. Thin clients are the way to go in pretty much every case I’ve ever encountered.

Re:Blitz: A Fullstack React Framework, Built on Next.js by flybayer on Sunday June 06, 2021 @09:30PM (#27418055)
> your existing view has tons of data access logic embedded right in it.

This is not at all how Blitz is set up to function. Your data access logic is clearly separated into query resolvers that run on the server.

What the "Zero-API" does is in practice is handle all the HTTP stuff for you. So as a developer all you are thinking about is "function calls". The function call happens to occur over the network, but as the dev you don't have to think about the details of how that happens.

Re:Blitz: A Fullstack React Framework, Built on Next.js by kfajdsl on Monday June 07, 2021 @10:44AM (#27423211)
> Consider for example needing to make a change to a view but your existing view has tons of data access logic embedded right in it.

You can separate these out. Treat public functions from your data/business logic layer as if they were an API in terms of organization. Your views shouldn't be doing any logic, they should be dumb. Overall, we've found switching to a MVC framework for new applications (React/Express -> Phoenix) has increased productivity a lot, especially with a tiny team.

Then again, I'm pretty green, so if there are cases where that kind of separation isn't possible, please let me know!

Re:Blitz: A Fullstack React Framework, Built on Next.js by atraac on Monday June 07, 2021 @04:46AM (#27420404)
> I can tell you from having experienced php templates that did stuff like this that this is a terrible idea in practice. Worse, you won’t know it is until you’ve built quite a mess.

We use Blazor in production(admittedly for internal facing app) and it works wonders for us. We mainly share models with frontend part, it's an insane productivity boost. You don't have to embed data access or server business logic into your views. You can, but you don't have to(and you shouldn't). Even just sharing models and calling endpoints like you would call a service is just... convenient.

Re:Blitz: A Fullstack React Framework, Built on Next.js by elygre on Monday June 07, 2021 @12:30AM (#27419008)
> Sigh…

That comes across as very condescending, and took all of my attention away from your actual arguments.

Re:Blitz: A Fullstack React Framework, Built on Next.js by brundolf on Monday June 07, 2021 @12:55AM (#27419125)
In the space of all the dismissive/abrasive comments on HN, I think the GP ranked pretty low