Making SvelteKit forms a pleasure to use!
FormPath
et al. now extends only basic objects and arrays, avoiding issues with classes, all built-in objects like File
and Date
, and special "branded" types that validation libraries are using. Thanks to Matt DeKok for this fix!devalue
updated to ^5.0.0
to handle invalid dates.use:enhance
was only intended for SPA mode to fully support progressive enhancement, so it now properly checks for that before adding the missing method="POST"
attribute on the form.FormPathLeaves
caused a memory leak when using svelte-package
.Map
and Set
.submit
method now falls back to submit, if no support for requestSubmit in browser.isTainted
now handles the type of $tainted
in generic components.id
option for superForm (not superValidate) wasn't used in multiple form scenarios.FormResult
type that can be used in onUpdate
, it didn't filter out SuperValidated
.Migration guide: https://superforms.rocks/migration-v2 More detailed list of what's new: https://superforms.rocks/whats-new-v2
use:enhance
on all related forms.FormPath
with nested arrays. Error output improved as well.Migration guide: https://superforms.rocks/migration-v2 More detailed list of what's new: https://superforms.rocks/whats-new-v2
ActionResult
for success or failure is now added to the onUpdate
event in the result
property. Can be used to access the ActionData
more easily.fail
function, works the same as the SvelteKit fail, but removes files and sets form.valid
to false
.options.config
added to the Zod adapter, so the JSON Schema generation can be customized.Migration guide: https://superforms.rocks/migration-v2 More detailed list of what's new: https://superforms.rocks/whats-new-v2
message
, not errors-and-message
, as it didn't work anyway.event.result.error
signature in onError was incorrect, it doesn't always match App.Error
. It is now a union between App.Error
, The built-in JS Error
class, and the default App.Error signature { message: string }
. See the server errors section for examples when the different kinds of errors are being created.Migration guide: https://superforms.rocks/migration-v2 More detailed list of what's new: https://superforms.rocks/whats-new-v2
fileProxy
, filesProxy
, fileFieldProxy
and filesFieldProxy
, so File
objects can be used with bind:files
on the input field. See file uploads for examples.FormPathLeavesWithErrors
, for the setError
function.instance
and special
validators for Valibot, which now enables File validation for Valibot!taintedMessage
didn't always work when navigating with the History API.tainted
didn't untaint automatically when using arrays.Migration guide: https://superforms.rocks/migration-v2 More detailed list of what's new: https://superforms.rocks/whats-new-v2
SPA
option can now take a string, corresponding to a form action, and it will post there, even without a html form on the page. Especially useful for debounced server checks like available usernames. Example here
superForm
returned a form with an empty id, causing collisions, it is now a random string.customValidity
didn't clear without client-side validators.Migration guide: https://superforms.rocks/migration-v2 More detailed list of what's new: https://superforms.rocks/whats-new-v2
undefined
to a field in the $errors
store.onResult
.