svelte-jsonschema-form v3 is released #238
x0k
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Straight to the point.
What’s new?
Removed the
json-schema-merge-allofdependencyOne of the main reasons for developing v3 was the dependency on json-schema-merge-allof.
That package relies on
lodash, which significantly increased the bundle size.To fix this, we built our own library, integrated into
@sjsf/formfor code reuse. It’s 20x smaller (gzip), faster, and more reliable.See Merger setup.
Nullable schema support
Schemas like
"type": ["string", "null"]now work correctly.Try it in the Playground.
New form option:
idBuilderYou can now fully control how id and name attributes are generated using the
idBuilderoption.See ID Builder interface.
New form method:
hasFieldStateCheck the state of any specific field (focused, inputted, changed, blurred) using the new
hasFieldStatemethod.See Other methods.
New UI option:
actionThis convention is implemented by specific themes and allows defining snippets via
action: someSnippetin UI options.The snippet is rendered next to the field label or title.
See docs and advanced example
optional-data-controls.New field type:
unknownFieldThis field is rendered for JSON Schemas where the data type is not explicitly defined (e.g.
{}).Since validators treat such schemas as accepting any value, it can be used to handle non-JSON data like
File.See Native File guide.
SvelteKit integration
The form actions integration has been reworked, and experimental support for remote functions has been added.
Themes
The
basictheme now uses CSS classes for styling, making it easier to integrate with frameworks like Pico CSS.Added support for:
Migration
Beta Was this translation helpful? Give feedback.
All reactions