Skip to content

Commit 5279de0

Browse files
committed
Deprecated "posted".
1 parent 5802d3e commit 5279de0

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Deprecated
11+
12+
- `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.
13+
1014
### Added
1115

1216
- `descriptionAsErrors` option for the JSON Schema validator, so you can specify error messages directly in the schema with the `description` field.

src/lib/client/superForm.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ export type SuperForm<
239239
submitting: Readable<boolean>;
240240
delayed: Readable<boolean>;
241241
timeout: Readable<boolean>;
242+
/**
243+
* @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.
244+
*/
242245
posted: Readable<boolean>;
243246

244247
allErrors: Readable<{ path: string; messages: string[] }[]>;

src/lib/superValidate.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export type SuperValidated<
2929
> = {
3030
id: string;
3131
valid: boolean;
32+
/**
33+
* @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.
34+
*/
3235
posted: boolean;
3336
errors: ValidationErrors<Out>;
3437
data: Out;

0 commit comments

Comments
 (0)