Releases: TheEdoRan/next-safe-action
Releases · TheEdoRan/next-safe-action
v7.1.0
v7.1.0-beta.2
7.1.0-beta.2 (2024-06-20)
Features
- validation-errors: support throwing validation errors via init option (8abcf33)
v7.1.0-beta.1
7.1.0-beta.1 (2024-06-20)
Features
- support extending previous schemas inside
schema
method (79ec8eb)
v7.0.2
v7.0.1
v7.0.1-next.2
v7.0.1-next.1
7.0.1-next.1 (2024-06-13)
Bug Fixes
- hooks: export
useStateAction
hook from/stateful-hooks
path (4ead815)
v7.0.0
7.0.0 (2024-06-13)
Features
- action-client: export a copy of safe action client from
/zod
path (#115) (20a2ef5) - add action execution callbacks (#161) (804a1cf)
- add Next navigation props to
onSuccess
andonSettled
action callbacks (9b37224) - allow direct use of
action
method, withoutschema
call (3935e9f) - allow omitting schema argument in
schema
method (#102) (aa11577) - example: add nested schema example (e4a0346)
- hooks: return
executeAsync
fromuseAction
anduseOptimisticAction
hooks (#147) (e0f5c20), closes #137 #72 #94 - hooks: return
input
from hooks (#118) (17935ad), closes #116 - support binding additional arguments (#97) (f628dc7)
- support generic metadata type (1e55068)
- support generic server error (#93) (3d677bd)
- support middleware chaining (#89) (714554d), closes #88
- support nested validation errors (e6e4e44), closes #51
- support passing schema via async function (#154) (4dcf742), closes #111
- support setting default validation errors shape per instance (#152) (0565085)
- support stateful actions via
stateAction
method anduseStateAction
hook (#110) (d060132) - validation-errors: support customization of validation errors format (#101) (66d4ea3), closes #98
- validation-errors: support flattening via
flattenValidationErrors
function (#100) (9ae6764) - validation-errors: support setting validation errors in action's server code function (#52) (64fb643)
Bug Fixes
- correctly handle internal framework errors (8596aab)
- don't push middleware functions in safe client array in
use
method (054487c) - exported class expression ts error 4094 (#96) (f36392a)
- hooks:
useStateAction
execution flow (16e5693) - hooks: form actions support (79e48b0)
- make result optional to handle Next navigation events (68d8ed2)
- prevent sharing metadata between actions (e8932bb)
- remove unwanted exported private properties from action client (1fbe49c)
- return proper results when handling framework navigation functions (c8496f7)
- types: don't allow undefined results for stateful actions (ec95a10)
- types: handle result undefined value at the action level (a9a2c8c)
- validation errors type for optional nested schema objects (94843fd), closes #51
- validation-errors: server validation errors were incorrectly processed by typeschema clients (cd567a2)
Refactors
- action-builder: simplify
try/catch
block for middleware stack execution (f356709) - example: directly import homepage Server Action in Client Component (b1a0077)
- example: reorganize examples, use Tailwind (#77) (6e73cae)
- hooks: better
useOptimisticAction
variable names (131f8bf) - hooks: don't set empty result before throwing Next navigation errors (c3a4b40)
- hooks: export
EMPTY_HOOK_RESULT
just from/hooks
path (74c0dc8) - hooks: pass callbacks data in single object instead of multiple function args (14b1fbf)
- hooks: return shorthand statuses from hooks (#131) (6319f07), closes #129
- hooks: use separate type for server state in
useOptimisticAction
(#134) (c38dbe1), closes #127 - improve internal code (#150) (8e19d94)
- remove
clone
method (8dc2138) - rename
define
method toaction
(1617d22) - rename
ServerValidationError
class toActionServerValidationError
(54b0b52) - restructure monorepo (#104) (58373ab)
- simpler
buildValidationErrors
implementation, moveValidationErrors
type to index ([5d3f258](5d3f2581a9925d...
v7.0.0-next.60
v7.0.0-next.59
7.0.0-next.59 (2024-06-12)
Refactors
- hooks: don't set empty result before throwing Next navigation errors (c3a4b40)