-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade library to version 4 #24
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`action` -> `actionBuilder`, `serverFunction` -> `serverCode`. BREAKING CHANGE: `ActionDefinition` type is now called `ServerCode`.
BREAKING CHANGE: Exported `HookRes` type is now called `HookResponse`. Same for the ex-`res` object returned by hooks, now called `response`.
…`onError` BREAKING CHANGE: `input` is now the second argument of `onSuccess` and `onError` callbacks, last one is `reset` function.
Before action status via hooks was reported with multiple keys: `hasExecuted`, `isExecuting`, `hasErrored`, `hasSucceded`. Now there's just a single `status` key, which can be `idle`, `executing`, `hasSucceded`, `hasErrored`. BREAKING CHANGE: Removed all current action status keys from the object returned by hooks. There's a single key now called `status`, which indicates the action status via string.
…rErrorLog` BREAKING CHANGE: initializer option `serverErrorLogFunction` is now called `handleServerErrorLog`
BREAKING CHANGE: `ClientCaller` type renamed to `SafeAction`
…ema` `inputValidator` argument is now called `schema`. `IV` generic type is now called `Schema`.
If `safeParse` is used instead of `safeParseAsync`, Zod throws an error when a `superRefine()` is used asynchronously.
`response` object is now called `result` everywhere. Same for `HookResponse` type, now called `HookResult`. BREAKING CHANGE: hooks `response` object renamed to `result`, exported `HookResponse` type renamed to `HookResult`
BREAKING CHANGE: `useOptimisticAction` hook now requires a reducer function as third argument. `execute` function returned by the hook now only has one argument, which is the safe action input. Optimistic state update behavior is determined by the reducer's function body.
BREAKING CHANGE: `buildContext` client initialization option is now called `middleware`
… update JSDocs too
…educer` function to `input`
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Library rewrite. Documentation and migration guide will be available on the new library website.