Blitz: A Fullstack React Framework, Built on Next.js
github.com
github.com
I'm probably just getting old. I see these frameworks by fresh faced frontend developers and I cringe imagining relying on them when you have looming deadlines and complex requirements.
Some have expressed the same concern, but after using it they’ve had zero issues.
Edit: I do not mean to say people should stop making new things or trying to improve upon older ideas; just saying most this stuff needs huge ALPHA/experimental stamps on it.
When you get used to re-learning everything on a monthly basis, it's easy to adopt new approaches. In fact, the Web Components movement, including lit-element, is basically built on the idea that you should write code for the browser, and thus your codebase must evolve as the browser does. If you look at it from the perspective of "this code must work forever," well, I'm not sure the browser is the right place to be. Have you considered shipping an old and outdated copy of a browser, such as Electron? ;-)
Edit: That said, I do agree there's a lot of reinvent-the-wheel in NPM-land, but I don't think the best possible wheel has been invented yet, so I appreciate having options. TypeScript is a great example: they're continuing to rapidly evolve the language with each point release yet they also centrally maintain DefinitelyTyped to be backwards compatible to previous releases. This means maintainers don't have to manually update their types for each point-release of TypeScript. If you look for that, you'll see a lot of "automatic backwards compatibility" in places. JS Codemods for example, can automatically update minor and sometimes major versions of React. Not everything is pre-1.0 and experimental, but the new stuff is definitely shinier.
To me this is actually the big problem. I would love to have a reduced feature set (could be opt-in) in the browser environment. As it stands it's just an ever growing ball of mud that ironically inhibits innovation and makes browsers impossible to develop without a huge amount of effort. It feels like 95% of the APIs are not used on 95% of usage sessions.
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.
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.
That comes across as very condescending, and took all of my attention away from your actual arguments.
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.
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!
But I eventually (after ~3 days) switched away. Blitz does what it says it does well, but when you get to that level of abstraction it feels like you lack control of your project. I assume that this level of abstraction would coincide well with newer or less confident developers.
node[7117]: ../src/node_http_parser.cc:567:static void
node::(anonymous namespace)::Parser::Initialize(const
FunctionCallbackInfo<v8::Value> &): Assertion
`args[3]->IsInt32()' failed.
... which crashed Node. And later: Starting Prisma Studio ...
Generating Prisma Client ... done
Prisma Studio is up on http://localhost:5555
node[9328]: ../src/node_http_parser.cc:567:static void
node::(anonymous namespace)::Parser::Initialize(const
FunctionCallbackInfo<v8::Value> &): Assertion
`args[3]->IsInt32()' failed.
1: 0x107245c85 node::Abort() [/usr/local/bin/node]
Server restart is also slow now I'm used to esbuild. Overall, not at all impressed.We have speed improvements on the way.
> The new Blitz data layer is a novel technology for eliminating the API while retaining client-side rendering.
> In a Blitz app, you can import your server code directly into the frontend so you don't need to build an API and do data fetching from the frontend.
> At build time, Blitz automatically inserts an API call that runs the server code on the server. Essentially, Blitz abstracts your API into a compile step.
It lacks an opinion on backend persistence, and all the supporting framework you'd find in Django/Rails/Laravel/Spring.
It's still pre 1.0, but we already have thousands of production Blitz projects from users all around the world. Many startups are choosing Blitz because of the fast product iteration speed it enables.
We even are seeing adoption in the enterprise. Algolia now has two internal Blitz apps. They first tried to use AWS Amplify for these projects but switched to Blitz and haven't looked back. And there's a big US university going to production with Blitz shortly.
Here’s a thread of things folks are saying after using Blitz: https://twitter.com/flybayer/status/1361334647859384320