Skip to content

ZenStack Release v2.0.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@ymc9 ymc9 released this 18 Mar 02:01
· 116 commits to v2 since this release
aa8b182

Breaking Changes

  • [TanStack Query] hooks signature is cleaned up and extra parameters are merged into query/mutation options.
  • [SWR] legacy mutation function generation is removed. Use mutation hooks instead.
  • [SWR] removed the deprecated initialData option. Use fallbackData instead.
  • [Server Adapter] the deprecated useSuperJSON flag is removed.
  • [Zod] generated model schemas now follows field optionality as defined in ZModel schema.

Features

  • The enhance API now generates strong typing for the user context, based on the fields access from auth() in access policies.
  • [TanStack Query/SWR] a new optimisticDataProvider callback option is added. You can use it to fully control how optimistic update data is computed for each query cache entry.
  • [Polymorphism] the generated enhance API now respects the client extension's typing of the prisma parameter.

Fixes and Improvements

  • [Polymorphism] fixed the problem generated prisma schema may have foreign key constraint ambiguity issue.
  • [Polymorphism] fixed the problem that generated auxiliary relations can cause naming conflict.
  • [Polymorphism] fixed the problem that fields in base models cannot be used in orderBy.
  • [Polymorphism] return full entity data when queried with a base model.
  • [Polymorphism] disallow inheriting from multiple delegate models.
  • Fields with @default with auth() are properly generated as TypeScript optional.
  • More robustly calculate the default location for code generation.

Full Changelog: v2.0.0-alpha.2...v2.0.0-beta.1