Blitz Versions Save

⚡️ The Missing Fullstack Toolkit for Next.js

v2.0.0-beta.26

1 year ago

🐞 Patches

  • e82a79be5: Update the version of next in the new template from 13.2 to 13.3.0
  • 38d945a3f: The issue is that the version provided, "13.2", is not a valid SemVer version. A valid SemVer version must have three components: major, minor, and patch (e.g., "13.2.0").

v2.0.0-beta.25

1 year ago

🐞 Patches

  • f84d77a42: Fix return type of the invoke method from returning type function to return the type of resolved data

v2.0.0-beta.24

1 year ago

Blitz Toolkit Beta v24

Support for Next 13

Blitz does not require any breaking changes with the major upgrade of Next 12Next 13 for usage with the pages directory. You can even continue to use the old blitz layout with all your files in app. But you'll need to rename that directory if you want to use the new Next.js app router.

Read More about usage of Blitz Toolkit with Next 13

cadefb8 & 37aeaa7: Support for Next 13 App directory (beta)

From this release, the blitz toolkit will work out of the box with react server components.

Here are the highlights:

  • New Blitz Auth Function getBlitzCtx to access the auth context in server components
  • New Blitz Auth Function useAuthenticatedBlitzContext to provide authorization utilities for server components
  • New wrapper BlitzProvider to be wrapped in the RootLayout present in the (root)/layout.ts file.
  • Overload the invoke method to work when called inside a React Server Component

Patch for Next 13.2 Suspense Error

acc07ce: This updates the suspense patch to work with Next.js 13.2+. Hopefully, soon we can stop patching once Next.js catches up with all the other frameworks and properly exposes the onRecoverableError react hook.

🔨 Breaking Changes

Blitz Auth

9529dbd: Introducing a new import path for the Blitz wrapper SecurePassword to fully decouple the library from @blitzjs/auth

Change to be made

-import {SecurePassword} from "@blitzjs/auth"
+import {SecurePassword} from "@blitzjs/auth/secure-password"

Automatic Upgrade

Automatically upgrade using codemod (Make sure to git commit before running this command to avoid losing changes)

npx @blitzjs/codemod secure-password

🚀 New Features

6f18cbd: Next Auth Adapter

Blitz now provides an adapter that allows you to use any NextAuth Provider with Blitz session management in any Nextjs application. Blitz session management gives you a lot more flexibility & control than NextAuth does.

Usage

// src/pages/api/auth/[...nextauth].ts
import { api } from "src/blitz-server"
import { NextAuthAdapter } from "@blitzjs/auth/next-auth"
import GithubProvider from "next-auth/providers/github"
import db, { User } from "db"
import { Role } from "types"

// Has to be defined separately for `profile` to be correctly typed below
const providers = [
  GithubProvider({
    clientId: process.env.GITHUB_CLIENT_ID as string,
    clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
  }),
]

export default api(
  NextAuthAdapter({
    successRedirectUrl: "/",
    errorRedirectUrl: "/error",
    providers,
    callback: async (user, account, profile, session) => {
      ...
    },
  })
)

Read More here

ea7561b: Blitz Generator Overhaul

The Blitz generator has been completely overhauled to be more flexible, customizable and easier to use.

Credits

The comes as a cumulative effort from the work started by @Maastrich in https://github.com/blitz-js/blitz/pull/2134 then continued and enhanced by @Roesh in https://github.com/blitz-js/blitz/pull/2679 and finally fixed and polished by @siddhsuresh in https://github.com/blitz-js/blitz/pull/3869 .

Changes/Features

  • Model Fields can now be specified in the generator command
> blitz generate model [fieldName]:[type]:[attribute]

Usage

> blitz generate all project name
> blitz generate all project name:string description:string? active:boolean
# with parent
> blitz generate model task \
       name \
       completed:boolean:default=false \
       belongsTo:project?
  • The generate command can also be run multiple times to add more fields to the model. The generator will then mention the changes that will be made to the model and ask for confirmation before proceeding.

  • ea7561b: New schema.ts file will be generated with the required zod schemas that can be used independently with the mutations, queries and components. This fixes the problem of not being able to import the schemas defined in the mutations due to the RPC compilation

Security Fixes

6e88a84: Fixed security vulnerabilities in passport-adapter by upgrading passport and jsonwebtoken.

Testing Utility Fixes

cadefb8: Fix failing tests due to the error NextRouter is not mounted in next 13 blitz apps.

Template Fixes

  • e228ba5: Fix a type error in reset password templates.
  • 430f0b5: For new applications, update Prisma (prisma and @prisma/client) from 4.6.0 to 4.6.1 to solve enum issue with postgresql Prisma 4.6.0 drops and recreates enum field when running db push even if the field has not changed prisma/prisma#16180

Credits

This release was made possible by the following contributors:

@flybayer, @siddhsuresh, @noxify, @tordans, @Vandivier, @exKAZUu

v2.0.0-beta.23

1 year ago

🔥 Breaking Changes

@blitzjs/auth

  • 42a2cf951: BREAKING CHANGE: secure-password is now an optional peerDependency, if you are using SecurePassword api, you need to now install secure-password in your application.

    npm install secure-password
    

    This helps users who do not use SecurePassword from having native package build issues.

🐞 Patches

blitz

  • c3c789740: Updates internal functions and tests to support blitz apps that run tests with vitest

@blitzjs/rpc

  • c3c789740: Updates internal functions and tests to support blitz apps that run tests with vitest

@blitzjs/generator

  • cb63a0ea5: Guard blitz g input via an allow-list of characters; throw if unwanted characters are found. Prevents to break the blitz command by accident (https://github.com/blitz-js/blitz/issues/4021).
  • 6ec020c6d: Remove useEffect from reset password templates.
  • d316d0db7: Update all links to follow Next 13 format without a child anchor tag.
  • 79c5e86d7: Add missing Layout.tsx for generated mimimalapp

v2.0.0-beta.22

1 year ago

🚀 Features/Improvements

blitz

  • 8aa22a0b2: Add currentPassword to the default fields that are masked in the logger

@blitzjs/rpc

  • 270361886: Change rpc route basepath to be one folder higher when using includeRPC in monorepos

@blitzjs/generator

  • 7abfb9086: Redesign the index page for newly generated blitz projects

🐞 Patches

blitz

  • 989691ec8: Use src instead of app folder for blitz generate custom-template

@blitzjs/auth

  • 145d5a02b: Fix failed localStorage access to not crash the application

@blitzjs/generator

  • bcef81fad: Fix missing MockRouter prop in test utils

v2.0.0-beta.21

1 year ago

🚀 Features/Improvements

blitz

  • d692b4c1d: Fix suspense error codegen patch for nextjs versions 13-13.0.6
  • 10f98c681: Add an href property to the generated route manifest that will return a string of the pathname and include query params.
  • d5b8faa86: Add regex to support inline and non-inline codebase and proper next.js package version check

@blitzjs/auth

  • 82e8b64f5: Fixes adding authError query param in Passport adapter.

@blitzjs/next

  • 10f98c681: Add an href property to the generated route manifest that will return a string of the pathname and include query params.

@blitzjs/rpc

  • d692b4c1d: Fix suspense error codegen patch for nextjs versions 13-13.0.6
  • 0025856b9: Support full api of tanstack invalidateQueries

🐞 Patches

@blitzjs/generator

  • 77b7da0f3: Remove husky pre-push hook & update pre-commit hook to only run prettier

v2.0.0-beta.20

1 year ago

🚀 Features/Improvements

blitz

  • 74a14b70: When db.$reset() rejects, reject with an Error object
  • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
  • a0596279: Fix blitz install for recipes that use the path helper to check if ./src/pages directory is available, otherwise use ./pages

@blitzjs/auth

  • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
  • 03bad317: fix Cannot read properties of null (reading 'isReady') for pnpm/yarn v3

@blitzjs/next

  • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
  • 03bad317: fix Cannot read properties of null (reading 'isReady') for pnpm/yarn v3

@blitzjs/rpc

  • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
  • 03bad317: fix Cannot read properties of null (reading 'isReady') for pnpm/yarn v3
  • 8c247e26: Switch from jest to vitest in new app templates
  • 650a157e: fix: allow GET requests without params and meta keys

🐞 Patches

@blitzjs/generator

  • 8c247e26: Switch from jest to vitest in new app templates

v2.0.0-beta.19

1 year ago

🚀 Features/Improvements

blitz

  • 942536d9: update paginate.ts, return more params for more complex pagination control
  • c1e00406: transpile packages to es2015 to support older browsers
  • 696f48c4: some providers need extra attributes, update for wrapAppWithProvider
  • a6f32d1d: Export enhancePrisma for client again (Fixes #3964)
  • c126b819: fix for when using "blitz install" inside recipe with addRunCommandStep causes hangs up
  • b33db082: Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

@blitzjs/auth

  • c1e00406: transpile packages to es2015 to support older browsers

@blitzjs/next

  • c1e00406: transpile packages to es2015 to support older browsers
  • b33db082: Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

@blitzjs/rpc

  • c1e00406: transpile packages to es2015 to support older browsers
  • b493c93f: fix resolverPath:root and make it work with monorepo resolver
  • b33db082: Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

🐞 Patches

@blitzjs/generator

  • b80c3d92: Fix form paths when running blitz generate all

v2.0.0-beta.18

1 year ago

🚀 Features/Improvements

@blitzjs/rpc

  • 72a4e594: internal: remove unneeed useSession from useQuery hooks
  • c0a3b1ee: Fix mutability bug in RPC configuration
  • ed2b0e22: Add ability to put your query and mutation resolvers in a separate monorepo folder, allowing you to use them in multiple apps.

v2.0.0-beta.17

1 year ago

🐞 Patches

blitz

  • 5ea068b2: Check if blitz-server & blitz-client is located in either the app or src directory and return the correct path for blitz recipes.
  • 8b4bf999: Update dependencies
  • 88caa18e: Patch next13 for suspense error

@blitzjs/auth

  • 8b4bf999: Update dependencies
  • 97469a12: Added option role to authenticate property of BlitzPage to authenticate page with respect to the role of the user. String value or Array of strings can be passed to authorize users.

@blitzjs/next

  • 8b4bf999: Update dependencies
  • 97469a12: Added option role to authenticate property of BlitzPage to authenticate page with respect to the role of the user. String value or Array of strings can be passed to authorize users.

@blitzjs/rpc

  • 8b4bf999: Update dependencies

@blitzjs/generator

  • 2a81af7b: Update generator templates to use the src directory instead of app
  • 8b4bf999: Update dependencies