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
It's not possible to send arbitrary data to superForm anymore, a SuperValidated structure is required, which is returned from superValidate on the server and superValidateSync, so in most cases this is not a problem.
message/setMessage and setError can only set a status in the range 400-599.
As with a Zod schema with refine/superRefine/transform, array and object validation now forces the whole Zod schema to be validated client-side, not just per field.
The Validation type is now called SuperValidated.
StringPath and StringPathLeaves are renamed to FormPath and FormPathLeaves.
Removed
The valid option is removed from message, any status >= 400 will return a fail.
The $valid, $empty and $firstError stores are removed from the client, they weren't that useful. allErrors can be used instead, together with the $posted store.
empty is removed from SuperForm.
options.noErrors is removed. Use options.errors instead.
The virtually unused meta has been removed. Use the Zod schema directly instead for reflection.
Fixed
When a redirect response is received, form timers will not reset until after navigation or onDestroy.
Fixed prototype mismatch for Zod schemas from different modules.
SuperDebug color scheme updated. (Thanks to gregorymcmillan)
Fixed flash messages being displayed early. This update also means that at least sveltekit-flash-message 1.0.0 is required to work together with Superforms.
Form data was reset to its previous state when error was thrown.
Form-level errors can be added with setError, using an empty string as path.
Explicitly setting a form id for multiple forms is not required anymore when using use:enhance, unless the forms are using the same schema. An id can be specified in the options or in a hidden form field called __superform_id.
FieldPath is gone - the following methods are now using a string accessor like tags[2].id instead of an array like ['tags', 2, 'id']: validate, setError and all proxy methods (ending with Proxy). This also applies to generic components.
The signature for allErrors and firstError has changed to { path: string; messages: string[] }.
The literal "any" is now an allowed value in step for constraints.
Multiple regex and step are now allowed on a schema field. A warning will be emitted by default, that can be turned off.
The signature for options.resetForm has changed to boolean | () => boolean (it was async before).
The undocumented defaultData is now called defaultValues.
Added [aria-invalid="true"] to errorSelector option.