Here migrated all left fields to native navigation. Got rid from legacy
useField hook.
Replaced number input with just text input as more reliable. And reused
expression linter for json value.
Check following forms
- string
- number
- boolean
- json
<img width="401" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/001bde86-3b7c-472d-ad26-acad2f347712">
Ref https://github.com/webstudio-is/webstudio/issues/2532
Here changed variable popover UI
- removed save/cancel buttons - save is happening on close
- replaced value/resource tabs with type select
- support additional string, number and boolean values
- add validation to value and resource forms
Also added form utilities to manage and compose field validation.
Remix fetcher introduce constraints for own server implementation. For
example body can be FormData, object or string and FormData requires
custom stream parser (they provide one).
Though streaming blob much simpler task and can be done with native
streams.
Another constraint is request cancelation when component is unmounted.
We workaround this with global persistent fetcher. Though native fetch
does not require this workaround too.