next-safe-action v6 #47
Closed
TheEdoRan
announced in
Announcements
Replies: 1 comment 1 reply
-
@TheEdoRan, what if we add another handler that is named as `handleReturnedServerValidationErrors'? Why would it be necessary? For example, when we send server actions to some third-party API resource, it can issue validation on the server side of the form:
In the current version, we cannot process this in any way, but we would like to... Tell me, is it possible? Can you do server validation error handling? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
next-safe-action v6
What's new?
With next-safe-action version 6, you can now use a wide range of validation libraries, even multiple and custom ones at the same time, thanks to the great TypeSchema library. You can find supported libraries here.
Existing code will not be affected, since Zod is supported by TypeSchema. However, now you can for example define a new safe action using Yup or Valibot, while still keeping existing actions with Zod validation, and everything will be handled internally by next-safe-action, thanks to the TypeSchema abstractions.
BREAKING CHANGES
Action result object
validationError
is now calledvalidationErrors
.Safe action client
handleReturnedServerError()
function now directly returns the server error message as astring
, instead of a{ serverError: string }
object.Hooks
Hooks are now exported from
next-safe-action/hooks
instead ofnext-safe-action/hook
.Types
ServerCode
is now calledServerCodeFn
.Misc changes
Types
SafeClientOpts
type, which represents the options for the safe action client, used internally bycreateSafeActionClient()
function.Beta Was this translation helpful? Give feedback.
All reactions