Skip to content

Releases: blitz-js/blitz

v2.0.0-beta.32

17 Aug 18:14
e1bffdf
Compare
Choose a tag to compare

🐞 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 return AuthenticatedCtx
  • 47c6b62: Update examples of generate all in docs to include one column in model.

v2.0.0-beta.31

20 Jul 20:25
8255172
Compare
Choose a tag to compare

🚀 Improvements

  • 90f1741: blitz-auth: Support for Prisma v5

    Internal: Make handle a required paramter while updating the session modal.

  • df3265b: blitz-rpc: Cleanup Event Listeners

    Fix potential memory leak by cleaning up any residual event listeners set by blitz.

v2.0.0-beta.30

05 Jul 15:19
da76acc
Compare
Choose a tag to compare

🐞 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 settings

    logging?: {
      /**
       * 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 the blockList

v2.0.0-beta.29

14 Jun 18:15
831a493
Compare
Choose a tag to compare

🐞 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

v2.0.0-beta.28

09 Jun 18:27
d25c965
Compare
Choose a tag to compare

🚀 Features/Improvements

@blitzjs/auth

  • 1bb3a65: Stop exporting useAuthenticatedBlitzContext from @blitzjs/auth this must be imported from app/blitz-server.ts file in order to work correctly

  • 5166e5e: (feat) upgrade tslog to v4.8.2

@blitzjs/rpc

  • c7ac86b: Fixes enormous memory consumption of the dev server by changing the default import strategy to require instead of import which in webpack causes multiple chunks to be created for each import.

    Blitz Configuration

    To configure this behaviour, you can add the following to your next.config.js:

    /**
     * @type {import('@blitzjs/next').BlitzConfig}
     **/
    const config = {
      blitz: {
        resolversDynamicImport: true,
      },
    }

    When resolversDynamicImport is set to true, the import strategy will be "import" instead of "require".

    On Vercel

    If you are using Vercel, resolversDynamicImport will be set to true by default, since it is better for the separate chunks to be create for serverless lambdas.

🐞 Patches

blitz

  • 5166e5e: (feat) upgrade tslog to v4.8.2

@blitzjs/next

  • 5166e5e: (feat) upgrade tslog to v4.8.2

@blitzjs/rpc

  • 5166e5e: (feat) upgrade tslog to v4.8.2

  • 2533caf: Fix return type of requestMiddlewares in RpcServerPlugin

@blitzjs/generator

  • 5166e5e: (feat) upgrade tslog to v4.8.2

🎉 New Contributors

Full Changelog: v2.0.0-beta.27...v2.0.0-beta.28

v2.0.0-beta.27

01 May 18:06
5a64f1c
Compare
Choose a tag to compare

🚀 Features/Improvements

@blitzjs/next

  • eda14fa: Add ability to format the error on the server before returning it to the client.
  • 3d004dc: Fix the DYNAMIC_SERVER_USAGE error for Next.js 13.3.1+

@blitzjs/rpc

  • eda14fa: Add ability to format the error on the server before returning it to the client.

🐞 Patches

@blitzjs/auth

  • 29c2b02: Fix: Add missing entry to expose next-auth adapter in Blitz Auth

@blitzjs/generator

  • d814c2d: fix: add missing key prop to LabelSelectField

v2.0.0-beta.26

10 Apr 13:57
3e8f04e
Compare
Choose a tag to compare

🐞 Patches

  • e82a79b: Update the version of next in the new template from 13.2 to 13.3.0
  • 38d945a: 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

03 Apr 13:59
9f316d7
Compare
Choose a tag to compare

🐞 Patches

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

v2.0.0-beta.24

31 Mar 18:04
f2da4f1
Compare
Choose a tag to compare

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 #2134 then continued and enhanced by @roesh in #2679 and finally fixed and polished by @siddhsuresh in #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

09 Feb 16:17
6374f2f
Compare
Choose a tag to compare

🔥 Breaking Changes

@blitzjs/auth

  • 42a2cf9: 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

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

@blitzjs/rpc

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

@blitzjs/generator

  • cb63a0e: Guard blitz g input via an allow-list of characters; throw if unwanted characters are found. Prevents to break the blitz command by accident (#4021).
  • 6ec020c: Remove useEffect from reset password templates.
  • d316d0d: Update all links to follow Next 13 format without a child anchor tag.
  • 79c5e86: Add missing Layout.tsx for generated mimimalapp