Skip to content

Releases: zenstackhq/zenstack

ZenStack Release v2.0.1

26 Apr 06:04
3291c6e

Choose a tag to compare

What's Changed

  • Prisma peer dependency version has been bumped to 5.13.x.
  • Fixed VSCode auto-fix code generation location issue.
  • Fixed policy compilation error for deeply nested post-update rules #1381

Full Changelog: v2.0.0...v2.0.1

ZenStack Release v2.0.0 🎉

25 Apr 05:46
2d4f330

Choose a tag to compare

Features

Make sure you read the full upgrade guide before upgrading!

1. Polymorphic Relations

You can now model a polymorphic inheritance hierarchy using the "delegated types" pattern. Read more details here.

2. Using auth() Inside @default Attribute

You can now use the auth() function call inside @default() attribute in ZModel. It's very handy for models that should always be connected to the current user during creation. By providing such a default value, you don't need to explicitly connect to the user anymore:

model Post {
  ...
  author User @relation(...)
  authorId String @default(auth().id)
}
const db = enhance(prisma, { user: getCurrentUser() });
const post = await db.post.create({ title: 'Post1' }); // no need to connect the `author` field

Special thanks to Augustin for making this feature happen!

3. Edge Runtime Support (Preview)

The @zenstackhq/runtime package is compatible with Vercel Edge Runtime and Cloudflare Workers. See here for more details.

4. Server Adapter for NestJS

An official adapter for using ZenStack with NestJS that plays well with its dependency injection. See here for more details.

5. Formating ZModel in Prisma Style

Yes, we heard your voices, and here it comes 😄. Please update the VSCode extension and JetBrains plugin to the latest version and enjoy.

image

You can toggle back to the old behavior in the extension settings (VSCode only).

Improvements and Fixes

This release also contains many DX improvements and fixes.

Full Changelog: v1.12.4...v2.0.0

ZenStack Release v1.12.4

21 Apr 23:51
d08dd82

Choose a tag to compare

What's Changed

  • Fixed access policy check issue with "upsert" models with compound @@id fields. #1271

Full Changelog: v1.12.3...v1.12.4

ZenStack Release v2.0.0-beta.13

15 Apr 07:32
7960595

Choose a tag to compare

Pre-release

What's Changed

  • VSCode extension and the zenstack CLI formats ZModel files with prisma-like indentation style by default. #885
  • zenstack CLI now auto-format the generated prisma schema by default.
  • Fixed several typing issues about using auth() inside @default().
  • Fixed the problem that member access from auth() is not properly resolved if the auth model is imported. #1257
  • Fixed the problem that @@index attribute is incorrectly inherited from the base. #1243
  • Removed several Prisma V4 dependencies since V4 is not supported anymore.

Full Changelog: v2.0.0-beta.8...v2.0.0-beta.13

ZenStack Release v1.12.3

12 Apr 07:40
2ce8b9b

Choose a tag to compare

What's Changed

  • Fixed the issue that enhance doesn't handle relations of the same type but different names properly #1241
  • Fixed openapi plugin to allow array form of input data

Full Changelog: v1.12.2...v1.12.3

ZenStack Release v1.12.2

11 Apr 04:20
254ef39

Choose a tag to compare

What's Changed

  • Fixed the issue that post-update rule for "id" field is not effective when the id field is changed during an update #1235
  • Fixed incorrect access policy generation when this is used in post-update rules.

Full Changelog: v1.12.1...v1.12.2

ZenStack Release v2.0.0-beta.8

09 Apr 14:28

Choose a tag to compare

Pre-release

What's Changed

  • Support for edge runtime (Vercel edge and Cloudflare worker)
  • Clear plugins' output dir before running generation #1220
  • Add Prisma as peer dependency #1084
  • Make data validation a separate enhancement kind #1050
  • Fixed ZModel linker errors #1210

Full Changelog: v2.0.0-beta.5...v2.0.0-beta.8

ZenStack Release v1.12.1

08 Apr 22:39
4ef45ff

Choose a tag to compare

What's Changed

  • [Zod] Generate a field schema as zod UUID if it has @db.Uuid attribute by @sakgoyal

New Contributors

  • Welcome @sakgoyal to becoming our new contributor!

Full Changelog: v1.12.0...v1.12.1

ZenStack Release v2.0.0-beta.5

31 Mar 01:20
ee3c716

Choose a tag to compare

Pre-release

New Features

Fixes and Improvements

  • [Runtime] Improved handling of Prisma fluent API call to make sure N+1 query optimization is effective #1178
  • [ZModel] Fixed the issue that auth() field from a base model is not properly resolved #1179
  • [ZModel] Fixed a linking error that happens after merging declarations from imported models #1186
  • [Server] Changed several default exports to named ones for better bundler compatibility

Full Changelog: v2.0.0-beta.3...v2.0.0-beta.5

ZenStack Release v1.12.0

31 Mar 20:32
dfa6cb4

Choose a tag to compare

This release notes includes cumulated fixes and improvements since the last 1.11.0 release.

What's Changed

  • [TRPC] Improved how the generated code imports zod schemas for better compatibility by @jbruxelle #1177
  • [TanStack] Vue-query hooks now properly handle reactive input (for both query args and options)
  • The enhance API now has an extra prismaModule option to allow passing in the Prisma module when the prisma client is generated into a custom location docs
  • Fixed unit test failures on Windows environments.
  • Fixed the issue with insufficient unique constraint conflict detection when the skipDuplicates option is specified in a nested createMany payload #1162

Full Changelog: v1.11.0...v1.12.0

New Contributors

  • Welcome @jbruxelle to becoming our new contributor ❤️ !

Full Changelog: v1.11.0...v1.12.0