Releases: blitz-js/blitz
v2.0.0
v2.0.0-beta.37
v2.0.0-beta.36
🐞 Patches
- 09e0c68: Automatically authorize role with usage of
redirectAuthenticatedTo
inuseAuthenticatedBlitzContext
and persist internal function definition ofgetBlitzContext
v2.0.0-beta.35
🚀 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")
🐞 Patches
v2.0.0-beta.34
🔥 Breaking Changes
-
⚠️ Important:
Next.js version 13.5 or above is now required to use@blitzjs/next
Fix
Error: Cannot find module 'next/dist/shared/lib/router/utils/resolve-href'
by updating the location of next.js internal function.
🐞 Patches
v2.0.0-beta.33
v2.0.0-beta.32
🐞 Patches
- 82649f3: Upgrade tslog to
4.9.0
.
This due a tslog issue that causes tslog to crash when attempting to log an error whose constructor expects more than one argument. - 8b01175: Updated
useAuthenticatedBlitzContext
to now returnAuthenticatedCtx
- 47c6b62: Update examples of generate all in docs to include one column in model.
v2.0.0-beta.31
v2.0.0-beta.30
🐞 Patches
- c5572be: blitz-auth: Fix webpack from following next-auth
🚀 New Features
-
7277349: ### Now we can configure Blitz RPC in the following way,
In your
[[...blitz]].ts
api file you can see the following settingslogging?: { /** * allowList Represents the list of routes for which logging should be enabled * If whiteList is defined then only those routes will be logged */ allowList?: string[] /** * blockList Represents the list of routes for which logging should be disabled * If blockList is defined then all routes except those will be logged */ blockList?: string[] /** * verbose Represents the flag to enable/disable logging * If verbose is true then Blitz RPC will log the input and output of each resolver */ verbose?: boolean /** * disablelevel Represents the flag to enable/disable logging for a particular level */ disablelevel?: "debug" | "info" }
import { rpcHandler } from "@blitzjs/rpc" import { api } from "src/blitz-server" export default api( rpcHandler({ onError: console.log, formatError: (error) => { error.message = `FormatError handler: ${error.message}` return error }, logging: { ... } }) )
Example:
export default api( rpcHandler({ onError: console.log, formatError: (error) => { error.message = `FormatError handler: ${error.message}` return error }, logging: { verbose: true, blockList: ["getCurrentUser", ...], //just write the resolver name [which is the resolver file name] }, }) )
This is enable verbose blitz rpc logging for all resolvers except the resolvers
getCurrentUser
and others mentioned in theblockList
v2.0.0-beta.29
🐞 Patches
blitz
- b6b9a1c: Fix Next-Auth integration:
Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
- 61888d1: Fix log formatting to not show the path of blitz rpc
@blitzjs/auth
- b6b9a1c: Fix Next-Auth integration:
Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
@blitzjs/generator
- 7aef610: Make Next.js version stick to 13.4.5 when generating a new app