🚀 Features
-
3bcbad1: - Introduce Blitz RPC's logging system to the
invoke
function which is the recommended way to call resolvers in nextjsapp
directory's react server components.- This refactor also removes the re-introduced dependency between
blitz-auth
andblitz-rpc
, allowing independent usage ofblitz-rpc
- This refactor also removes the re-introduced dependency between
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")