New Features
-
Server API handler for RESTful style API
Now ZenStack supports two styles of APIs: RPC (mirroring PrismaClient's query APIs) and RESTful (resource-centric API using JSON:API as transportation). When creating a server adapter, you can choose to use one of these handlers (defaults to RPC). Check out the documentation for more details.
A big ❤️THANK YOU❤️ to @jawadst for initiating this effort and contributing code!
-
OpenAPI specification generation for RESTful style API
Related to the previous feature, the
@zenstackhq/openapi
plugin is also updated to support RESTful style API. -
Server adapter for SvelteKit
The
@zenstackhq/server/sveltekit
module implements a SvelteKit server hook to provide an automatic RPC or RESTful style CRUD API. Check out the sample project here. -
New plugins:
@zenstackhq/swr
and@zenstackhq/tanstack-query
These plugins generate client hooks targeting SWR and TanStack Query. The original
@zenstackhq/react
plugin will be deprecated in the future and replaced by these two new plugins. SWR plugin is for React only, and TanStack Query plugin supports React and Svelte today and will support Vue in the future.Sample projects:
Fixes And Improvements
- Next.js server adapter is moved to
@zenstackhq/server
package. The original@zenstackhq/next
package will be deprecated soon. - Upgraded to Langium 1.2.0
- OpenAPI: component schema should be generated even if the model is marked as "@@openapi.ignore" #349
- Don't generate auxiliary fields when a model doesn't have any access policy #415
- ZModel: added supports to directUrl field in datasource declaration. This can be used to provide a separate database connection (usually without pooling) for migration.
Breaking Changes
- Plugin's output path handling is unified to be relative to the location of ZModel file. This wasn't implemented consistently previously. If you had ZModel residing in a non-root folder, you may need to adjust plugin output paths accordingly.
We're aiming to hit Beta for the next release!
Full Changelog: v1.0.0-alpha.114...v1.0.0-alpha.119