github blitz-js/blitz v2.0.0-beta.35

latest releases: v2.1.3, blitz@2.1.3, @blitzjs/rpc@2.1.3...
12 months ago

🚀 Features

  • 3bcbad1: - Introduce Blitz RPC's logging system to the invoke function which is the recommended way to call resolvers in nextjs app directory's react server components.

    • This refactor also removes the re-introduced dependency between blitz-auth and blitz-rpc, allowing independent usage of blitz-rpc

You can now configure the usage of invoke in the app directory with custom error handling logic and controlling the verbosity of the logger in the following way:

// blitz-server.ts
import { notFound } from "next/navigation"
...
RpcServerPlugin({
  logging: {
    allowList: [] // if allowList is defined then only those routes will be logged
    blockList: [] // If blockList is defined then all routes except those will be logged
    disablelevel: "info|debug" // Represents the flag to enable/disable logging for a particular level
    verbose: true, // enable/disable logging If verbose is true then Blitz RPC will log the input and output of each resolver
  },
  onInvokeError(error) {
    if(error instanceof NotFoundError) {
      notFound()
    }
  },
}),

⚠️ Breaking Change

  • b97366c: Remove unintended dependency on next-auth by removing it from the core build of @blitzjs/auth

    Update your import in next.config.js in the following way

    -const { withNextAuthAdapter } = require("@blitzjs/auth")
    +const { withNextAuthAdapter } = require("@blitzjs/auth/next-auth")

🐞 Patches

  • cee2dec: Fix bug that did not allow Page.authenicate = {role: "" } to correctly work

  • aec1bb0: blitz-next: Fix next/head used in app directory warning

  • c89cb94: Upgrade next, prisma and zod to latest versions in a newly created app

Don't miss a new blitz release

NewReleases is sending notifications on new releases.