Skip to content

Commit

Permalink
Deprecated "posted".
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscoheat committed Aug 12, 2024
1 parent 5802d3e commit 5279de0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Deprecated

- `posted` is deprecated, due to inconsistencies between server and client validation, and SPA mode. It will be removed in v3. Use a [status message](https://superforms.rocks/concepts/messages) or return your own data in the form action to handle form post status.

### Added

- `descriptionAsErrors` option for the JSON Schema validator, so you can specify error messages directly in the schema with the `description` field.
Expand Down
3 changes: 3 additions & 0 deletions src/lib/client/superForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ export type SuperForm<
submitting: Readable<boolean>;
delayed: Readable<boolean>;
timeout: Readable<boolean>;
/**
* @deprecated posted is inconsistent between server and client validation, and SPA mode. Will be removed in v3. Use a status message or return your own data in the form action to handle form post status.
*/
posted: Readable<boolean>;

allErrors: Readable<{ path: string; messages: string[] }[]>;
Expand Down
3 changes: 3 additions & 0 deletions src/lib/superValidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export type SuperValidated<
> = {
id: string;
valid: boolean;
/**
* @deprecated posted is inconsistent between server and client validation, and SPA mode. Will be removed in v3. Use a status message or return your own data in the form action to handle form post status.
*/
posted: boolean;
errors: ValidationErrors<Out>;
data: Out;
Expand Down

0 comments on commit 5279de0

Please sign in to comment.