⚡️ The Missing Fullstack Toolkit for Next.js
db7233db: Bump react, react-dom, @types/react and next versions
This fixes a console warning: Warning: Received
truefor a non-boolean attribute
global.
when using styled-jsx
. Versions bump also fixes React Hydration error that happens on and off when using redirectAuthenticatedTo
.
0936cb38: Patch Next.js Suspense issue in all node environments. Previously we only patched it in the development
environment, but now we make sure it gets patched in the production
env (with the blitz build
command) as well.
3f9fe8f0: Exit the CLI process after blitz new
command is finished
db7233db: Bump react, react-dom, @types/react and next versions
a3b5fdd0: Change ES6 import for withBlitz
during the codemod to the require syntax.
ebfb562b: Add Script
as a default import from next.js during the codemod.
db7233db: Bump react, react-dom, @types/react and next versions
eb971568: Add BlitzPage
types to auth pages in new app template
8ada2c26: Include ResetPasswordPage in new app template
Blitz is no longer an all-in-one framework but a full-stack toolkit for Next.js 🔥
Previously Blitz abstracted Next.js, but Blitz 2.0 is now a modular toolkit that plugs into any new or existing Next.js app. Blitz picks up where Next.js leaves off, providing battle-tested libraries and conventions for shipping and scaling worldwide apps
Going forward, our mission is to be the most trusted technical resource for rapidly building and scaling full-stack TypeScript apps. We're doing that through frontend-agnostic libraries that simplify complex app problems with minimal tradeoffs and through full-stack guides.
If you have an existing Blitz.js app and would like to upgrade it to the Blitz 2.0, you can use our @blitzjs/codemod
package by running the following command in the root of your Blitz application:
npx @blitzjs/codemod upgrade-legacy
After running the command, your Blitz app will be upgraded to the Blitz 2.0 + Next.js setup. If you face any issues with the upgrade — let us know!
You can also check out the manual upgrade guide.
You need Node.js 16 or newer. You can verify this by running node -v
in your terminal.
Run yarn global add blitz
or npm install -g blitz
or pnpm add -g blitz
.
blitz new myAppName
cd myAppName
blitz dev
View your brand new Next.js + Blitz 2.0 app at http://localhost:3000/
.
Blitz 2.0 consist of six packages: blitz
, @blitzjs/next
, @blitzjs/auth
, @blitzjs/rpc
, @blitzjs/codegen
. Read below to learn about each of them.
blitz
blitz
is our core package containing utilities and the base for all the Blitz packages and plugins. Blitz CLI is also a part of this package, including the blitz generate
command for code scaffolding.
Read the Blitz CLI docs. Read the Blitz utilities docs.
@blitzjs/next
The @blitzjs/next
package exposes functions and components specific to the Next.js framework.
@blitzjs/auth
The package provides authentication and authorization. Works with any identity provider, including self-hosted username and password and third parties like Auth0.
@blitzjs/rpc
Blitz "Zero-API" data layer (Blitz RPC) is focused on making the communication between server and client seamless. It lets you import server code directly into your components instead of having to manually add API endpoints and manually do client-side fetching and caching.
@blitzjs/codemod
The @blitzjs/codemod
has an upgrade-legacy
codemod for upgrading the existing Blitz framework application to the new Blitz 2.0 + Next.js setup.
HUGE shout out to everyone who contributed to this release:
@Zeko369 @datner @anteprimorac @iDavidB @andreasasprou @the-bayer @chaiwattsw @prisis @oltdaniel @Trancever @edrickleong @ganeshmani @orionmiz @iojcde @noxify @siddhsuresh @saadaltabari @dillonraphael @flybayer
🙌 🙌 🙌
app/auth/pages
) convert to (eg. pages/
) instead of (eg. pages/auth
)schema.prisma
after running the model generatorBlitzPage
type to Home pages in new app templatesRouteUrlObject
as redirect.destination
in getStaticProps
and getServerSideProps
getQueryData
utility to get an existing query's cached dataBlitzServerMiddleware
function with codemodblitz.config.ts
with the withBlitz
function during the codemod step instead of creating a blank next.config.js
filecookiePrefix
is undefined. Then show an error at the end of the codemod output blitz generate
command to the toolkitnext.config.js
files in new app templatesnext.config.js
file nameCannot find module "generate"
errors when using CLI@blitzjs/rpc
blitz dev
command@blitzjs/rpc
cookiePrefix
is undefined when running upgrade-legacy
DocumentProps
and DocumentContext
to the upgrade-legacy
import mappackage.json
with upgrade-legacy
upgrade-legacy
to accept a self closing DocumentHead
in the _document
pagetsconfig.json
file in the new app templatets-jest
to dependencies in new app templates@testing-library/jest-dom
to new app dependenciesprisma generate
as a blitz codegen
step if "prisma" is found in project's dependenciesblitz new
messaging and fix minor issuesinvalid config detected
warnings by deleting "blitz"
key from next config object.env.test
file to the generator templatesblitz new
messaging and fix minor issues