Future of Blitz
blitzjs.com
blitzjs.com
The internals are significantly less complex now. Before, Blitz was a fork of Next.js, and dealing with that was a nightmare. Contributions dropped off significantly because of that.
Now features are nicely packaged and isolated. Much easier to reason about and contribute too.
I'm looking forward to this change and using Blitz again, as the frontend experience was super nice.
By default (through `next start`) Next.js uses a Node.js server. You don't need to use Next.js serverless: https://nextjs.org/docs/deployment#self-hosting
Most large applications don't use API Routes for large workloads. These teams likely have a completely separate backend/API, and Next.js is the connecting piece for their frontend. For smaller teams, or solo devs, it's more common to see their entire backend built with API Routes (most commonly used with something like Prisma): https://github.com/vercel/nextjs-subscription-payments
But I'm tired of the react ecosystem, and I was disappointed I had to give up Blitz's features.
But thanks to the pivot, I'm excited to use blitz-auth and their Prisma codegen with other projects.
The complexity of web pages has increased. Development is not harder. We're making complex apps and not just styled documents now. What you made 10 years ago is much easier to do today.
I'm really hoping for some kind of Rust/WebAssembly kit for write-once manage-state everywhere bundles that you can deploy to native presentational applications on every platform. Kind of like grpc but also tying in authentication and intuitive hooks into component logic.
Hacking together HTML today with React, Angular, and VueJS just seems like no one wants to admit that HTML needs to be rebuilt and JS deserves to be replaced.
Yeah it's a hack on top of HTML, but there's React Native too. Which is kind of a hack too, but it's going towards the right direction IMHO.
Also, new Blitz includes a plugin system, that allows you to easily integrate multiple modules, for example auth and RPC and have them work together seamlessly. And have things just work like you’d expect, such as query cache being deleted on log out, and queries refetched on log in.
/**
* Add new survey answer.
*/
// prettier-ignore
export type AddSurveyAnswer = PostEndpoint<`/survey/survey-answer/${string}`, never, Validators.SurveyAnswerBody, ResponseDataType<typeof SurveyController, "addSurveyAnswer">>;
But really the only duplicated information is the HTTP verb and the path. And those won't change very often - if at all.Then in the front end you import the file containing all of the endpoint types:
import * as API from "@copy-ai/endpoints";
And you're good to make requests: const response = await request<API.AddSurveyAnswer>({
url: `/survey/survey-answer/${questionId}`,
method: "post",
data: surveyAnswerBody,
});
You might wonder - why are you making me retype the URL/method? You don't really have to. Your editor will auto-fill that as the method can be extracted from the endpoint type as the type "post". Not a string - "post". Same for the path, but we use parameterized string types.There's no magic here. What's happening is pretty transparent to the programmer. We just tuck away the PostEndpoint etc. types as those don't ever need to get changed. You can even easily YOLO an API request by passing in the any type.
What is "full-stack mode" specifically? Do you mean the fact that each dev needs to run all parts of the application locally? You'd want that for most small and medium size web projects anyway, even if it e.g. consisted of stricly separated SPA and REST backend parts.
With very large projects/teams there are obviously challenges. My gut feeling is that a project started with a framework like Blitz would probably naturally evolve into some kind of a monorepo, which of course comes with both strengths and challenges. If you get that far though it'd seem to me that the full-stack architecture worked really well for the problem.
Can you provide more details about this? In what way is it a downgrade?
The only downside are missing UI libraries like RadixUI. Tried out everything and just "wasted" 2 weeks to build a component library on top of TailwindCSS inspired by Material UI.
Its reactivity features are simpler.
And it is much more performant on the browser.
Plus React has steeper learning curve.