You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
-
## [2.0.0-alpha.1] - 2024-01-10
8
+
## [2.0.0] - 2024-02-11
9
9
10
10
### Removed
11
11
12
-
-`superForm.fields`
13
-
-`fields` options for setting tainted.
14
-
-`message` parameter in `onError` event.
12
+
-`superForm.fields` was a rarely used and lesser version of `formFieldProxy`, switch to that instead.
13
+
-Removed `fields` options when setting tainted status.
14
+
-Remvoed `message` parameter in `onError` event, use `$message` directly instead.
15
15
16
16
### Changed
17
17
18
-
- Adapters required, `superValidate(zod(schema))` instead of `superValidate(schema)`. If type parameters are used, it must now be wrapped with `z.infer` for Zod schemas.
19
-
- Default `superForm` options now follow SvelteKit more closely: `resetForm: true` and `taintedMessage: false`is default now. Add `define: { SUPERFORMS_LEGACY: true }` in `vite.config.ts` to keep the old behavior.
18
+
- Adapters required for validation! Import from `sveltekit-superforms/adapters` and use `superValidate(zod(schema))` instead of `superValidate(schema)`. If type parameters are used, it must now be wrapped with `Infer` for schemas.
19
+
- Default `superForm` options now follow SvelteKit more closely: `resetForm: true` and `taintedMessage: false`are default now. Add `define: { SUPERFORMS_LEGACY: true }` in `vite.config.ts` to keep the old behavior.
20
20
-`superValidateSync` is renamed to `defaults`. It returns [default values](https://superforms.rocks/default-values/) for the schema, and **does no validation anymore**. Use `+page.ts` if initial validation is required, as described on the [SPA page](https://superforms.rocks/concepts/spa#using-pagets-instead-of-pageserverts).
21
21
-`arrayProxy`: `fieldErrors` renamed to `valueErrors`.
22
22
- Enums must have an explicit default value in the schema.
23
23
- Numeric enums cannot be parsed with their string values anymore.
24
24
- Superform validator functions, previously just an object with functions, requires the `superformClient` adapter. The input for the validator functions can now be `undefined`.
25
-
- If `superValidate` is called with just the schema, the default values aren't validated (i.e. no side-effects for default values).
25
+
- If `superValidate` is called with just the schema, the default values aren't validated (i.e. no side-effects for default values) unless `errors` is set to `true`.
26
26
- Properties with default values don't have `required` in their constraints anymore.
27
27
- Form id cannot be `undefined` anymore, must be `string`. (Set automatically by default now).
28
28
-`flashMessage.onError.message` option in `superForm` renamed to `flashMessage.onError.flashMessage`.
@@ -33,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
33
34
34
### Added
35
35
36
-
- Support for unions in schemas. Unions must have an explicit default value, and multi-type unions can only be used with `dataType: 'json'` set.
36
+
- Support for unions in schemas. A union must have an explicit default value, and multi-type unions can only be used with `dataType: 'json'` set.
37
37
- Added `superForm.isTainted(path?)` and `superForm.isTainted($tainted)` for better [tainted fields check](https://superforms.rocks/concepts/tainted/).
38
38
-[File upload support](https://superforms.rocks/concepts/files/)! Use `withFiles` when returning in form actions: `return withFiles({ form })`.
39
39
-[SuperDebug](https://superforms.rocks/super-debug/) now displays `File` and `FileList`.
0 commit comments