Skip to content

v7.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 13 Jun 14:50
· 15 commits to main since this release
b5a54f2

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 and onSettled action callbacks (9b37224)
  • allow direct use of action method, without schema call (3935e9f)
  • allow omitting schema argument in schema method (#102) (aa11577)
  • example: add nested schema example (e4a0346)
  • hooks: return executeAsync from useAction and useOptimisticAction 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 and useStateAction 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 to action (1617d22)
  • rename ServerValidationError class to ActionServerValidationError (54b0b52)
  • restructure monorepo (#104) (58373ab)
  • simpler buildValidationErrors implementation, move ValidationErrors type to index (5d3f258)
  • switch to MIT License (#157) (775c2e7)
  • types: move PrettyMerge type in utils file (f7eb50c)
  • types: rename HookStateSafeActionFn to HookSafeStateActionFn (87b13b4)
  • upgrade TypeSchema to v0.13 (#81) (9238190)
  • use Zod as the default validation library (#144) (38003a5), closes #105 #140
  • validation-errors: rename rootErrors to formErrors for flattened errors (218176d)

Build System

  • lib: update dependencies and required React version to 18.3.1 (135821d)
  • update required Next.js version to >= 14 (5a05a40)

Documentation

  • add Form Actions support in features (a7cb006)
  • example: add React Hook Form example (23e05aa)
  • example: fix optimistic hook example (da5284e)
  • readme: fix broken logo src (493a7df)
  • readme: remove additional "contributing" title (51d4f33)
  • readme: remove old migration guides (fd64e29)
  • release: bump library version (e768ace)
  • release: update migration links (f24fdcd)
  • rename leftover validationError refs to validationErrors (2e687cb)
  • update contributing section (64a77bd)
  • update demo video (615cdfb)
  • update library description (dbd9639)
  • update links in JSDocs (0bdc31b)
  • update requirements and references to stable version (c52ba36)
  • update website links in JSDocs (4ea8559)
  • website: add bindArgsParsedInputs in "middlewareFn return value" section (e4aacbc)
  • website: add content to custom validation errors section (c9ae089)
  • website: add React Hook Form integration guide (ba9fd4c)
  • website: add WIP React Hook Form integration section (1623823)
  • website: fix broken getting started link (85d2689)
  • website: fix migration guide link (0dadf3e)
  • website: fix React Hook Form example (04c080d)
  • website: fix typo in getting started page (#92) (5c7a45c)
  • website: format stars count (d53227e)
  • website: improve metadata documentation (fccd480)
  • website: move migrations to submenu (6f7c637)
  • website: reorganize documentation, add v7 sections (f70a0d7)
  • website: update colors and layout (f918f77)