Skip to content

Version 2.0.0

Choose a tag to compare

@bhch bhch released this 14 Aug 11:47
· 190 commits to master since this release

14 Aug, 2022

This is a major release with lots of new features, plenty of bugfixes, significant internal rewrite and, therefore, some breaking changes.

What's new

New features

  • EditorState
    Now the form component and its state are separate. This will allow for the component to be used as a library in other Node projects.
  • Schema validation
    Schema will be validated for errors while new form component is created.
  • File uploads
    New keyword called handler has been added for file uploads. Use this to provide the URL endpoint where files will be uploaded to.
  • New APIs for browser component
    APIs for controlling the form component in the browser such as handling change events and dynamically updating the schema.
  • Exception reporter for browser component
    New exception reporter will now display schema errors in the browser. Currently, it's primitive but will evolve in future.
  • Docs, Live demos, Interactive playground
    https://bhch.github.io/react-json-form/.

Bugfixes

  • #32: Display help text under "Select file" button (of file-url field).
  • #33: If default value for integer type was 0, it was being overwritten by null.
  • #34: Make multiselect widget work on top level arrays.
  • #35: Boolean type will be null by default. Earlier, the default for boolean was false.
  • #36: Make select input respect falsy values.
  • #37: Add support for date-time (from the standard spec) as an alias for datetime.
  • #39: Respect minItems when creating or syncing arrays.

Breaking changes

Main Form component (src/form.js)

If you directly use the Form component (such as in Node projects), the following notes are for you.

  • Renamed Form component to ReactJSONForm.
  • Removed fileListEndpoint and fileUploadEndpoint props. Now use fileHandler prop instead.
  • The form component will requires two compulsory props: state (instance of EditorState) and onChange (a callback function for handling the changes).
  • Boolean type will be null by default. Earlier, the default for boolean was false.

Browser component (src/renderer.js)

If you use the component in the browser (and not in Node projects), the following notes are for you

  • Removed JsonForm function which was used for creating the form component in browsers. Instead use the new createForm function.
  • Removed uid config option.
  • Removed fileListEndpoint and fileUploadEndpoint config options. Use the new fileHandler option which serves the purpose of both.