Releases: zenstackhq/zenstack
ZenStack Release v2.0.0-beta.3
Breaking Changes
- Server adapters now return HTTP 422 when the request is rejected due to validation errors.
What's Changed
- Removed prettier dependency. The generated code is now directly formatted with ts-morph.
- Fixed the issue that
@@mapattribute is incorrectly inherited from base models. - Disallow
thisin collection predicate expressions.
Full Changelog: v1.11.0...v2.0.0-beta.3
ZenStack Release v2.0.0-beta.1
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
ZenStack Release v1.11.0
New Features
-
You can now import ZModel from packages in
node_modules! Very useful if you want to manage and share ZModel files in a component-based setup. By @TGTGamerimport "@myorg/foo/bar" import "mypackage/base" ...
Fixes and Improvements
This release gives a minor version bump for several fixes made in the "1.10.x" patch releases.
- Fixed the issue that
@@validatemodel-level rules cause incorrect runtime validation error for updates #1078 - Fixed the issue that
upsertwith array-form input results in a partial write #1080 - Fixed the issue that compound ids inherited from abstract models are not properly handled #1129
Full Changelog: v1.10.0...v1.11.0
ZenStack Release v1.10.0
Fixes and Improvements
- Fixed typing issue in generated query hooks for TanStack Query (for Vue) #1056
- Fixed
zenstackCLI errors when running bun/bunx in non-tty environment by @ErikMCM - Allows enum types for id fields by @Ustice
- Fixed missing parameters for a few built-in attributes (
@@fulltext,@@db.VarBinary) by @Ustice - Fixed the problem that transformation attributes (
@trim,@lower,@upper) are not effective for update operations #1005 - Fixed the incorrect policy rejection when field-level policy specifies override but no model-level policy is defined #1014
- Improved ZModel checking for nullability consistency between relation field and foreign key field #177
- Generated Zod schemas now include coercion (
z.coerce.date()) forDateTimetyped fields #1067 - Improved typing of
errorfield of the TanStack Query mutation hooks #1062
Docs
New quick start guide for NextJS app router.
New Contributors
Welcome @ErikMCM @Ustice and @TGTGamer to becoming our new contributors!
Full Changelog: v1.9.0...v1.10.0
v2.0.0-alpha.2
ZenStack Release v1.9.0
What's Changed
- New data transformation attributes
@trim,@upper,@lower- they make sure values are transformed before storing into the database, and are also generated as corresponding Zod calls by the@core/zodplugin. By @simonedelmann docs - The parameters of Prisma transactions (
timeout,maxWait, etc.) used internally by ZenStack are configurable #986 docs - Fixed several issues related to validating multi-level inheritance from abstract models #965 #971 #983
- Fixed the issue the
@omitattribute doesn't trim fields included in a nested one-to-many #984 - Support for complex usage of
@@index#987 - Tanstack-query plugin now generates
useSuspenseanduseSuspenseInfinitequery hooks when generating for version "v5" and targeting "react" #857
New Contributors
- Welcome @simonedelmann as our new contributor!
Full Changelog: v1.8.1...v1.9.0
ZenStack Release v2.0.0-alpha.1
New Features
Breaking Changes
Check here for a list of breaking changes.
Please make sure to check out the Upgrading to V2 documentation for more details.
ZenStack Release v1.8.1
Features and Improvements
- Fixed "hostname not found" error when deploying to Vercel #931 by @Azzerty23
- Fixed CLI crash when package.json is not found in the current dir #960
- Fixed typing of tanstack-query code generation to properly support "select" options #963
- Optimized typing of the generated TRPC code (to prepare for supporting trpc v11 down the road)
Thanks to @Azzerty23 for the contribution!
Full Changelog: v1.7.1...v1.8.0
ZenStack Release v1.7.1
What's Changed
- Fixed an incorrect access policy injection when
updateManyordelegeManyare nested insideupdateoperation in certain cases #961
Full Changelog: v1.7.0...v1.7.1
ZenStack Release v1.7.0
New Features
-
VSCode extension and JetBrains plugin now support better auto-completion
There's auto-completion inside attributes now. It's not perfect, but it should be a pretty big improvement compared to previous versions. Having accurate contextual auto-completion still requires quite some work, and we'll continue improving it down the road. Please let use know your pain points!
What's Changed
- Fixed type generation error for tanstack-query plugin when targeting Svelt #945 by @bbozzay
- Fixed ZModel validation error when using empty array in
@defaultattribute #947 by @chunkerchunker
About V2
While gradually wrapping up the V1 track, we're making some good progressing on experimenting polymorphism in V2 branch. Please stay tuned for updates.
New Contributors
Welcome @bbozzay and @chunkerchunker to becoming warmhearted contributors! Thank you for making ZenStack a better toolkit!
Full Changelog: v1.6.2...v1.7.0