ZenStack Release v2.0.0-beta.1
Pre-release
Pre-release
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
initialDataoption. UsefallbackDatainstead. - [Server Adapter] the deprecated
useSuperJSONflag is removed. - [Zod] generated model schemas now follows field optionality as defined in ZModel schema.
Features
- The
enhanceAPI now generates strong typing for theusercontext, based on the fields access fromauth()in access policies. - [TanStack Query/SWR] a new
optimisticDataProvidercallback option is added. You can use it to fully control how optimistic update data is computed for each query cache entry. - [Polymorphism] the generated
enhanceAPI now respects the client extension's typing of theprismaparameter.
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
@defaultwithauth()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