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
Feature: Performance optimization, live validate/omit onBlur
Added support to make live validate and live omit work during the `onBlur` phase rather than `onChange`
- In `@rjsf/core`:
- Updated `FormProps` to add new `onChange`/`onBlur` values for the `liveValidate` and `liveOmit` props, deprecating the `boolean` aspect of them
- Updated `Form` to support the new feature to do `onBlur` handling of `liveValidate` and `liveOmit`
- Updated the tests to verify the new behavior
- Updated the playground to switch `liveValidate` and `liveOmit` from checkboxes to radio buttons for the new options
- Updated `form-props.md` and `v6x upgrade guide.md` to document the new feature and deprecation
- Updated the `CHANGELOG.md` accordingly
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,17 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
15
15
should change the heading of the (upcoming) version to include a major version bump.
16
16
17
17
-->
18
+
# 6.0.0-beta.23
19
+
20
+
## @rjsf/core
21
+
22
+
- Updated `FormProps` to add new `onChange`/`onBlur` values for the `liveValidate` and `liveOmit` props, deprecating the `boolean` aspect of them
23
+
- Updated `Form` to support the new feature to do `onBlur` handling of `liveValidate` and `liveOmit`
24
+
25
+
## Dev / docs / playground
26
+
- Updated the playground to switch `liveValidate` and `liveOmit` from checkboxes to radio buttons for the new options
27
+
- Updated `form-props.md` and `v6x upgrade guide.md` to document the new feature and deprecation
28
+
18
29
# 6.0.0-beta.22
19
30
20
31
## @rjsf/antd
@@ -44,7 +55,7 @@ should change the heading of the (upcoming) version to include a major version b
44
55
- BREAKING CHANGE: Updated `ArrayFieldTemplate` to remove the `ArrayFieldItemTemplate` render in favor of simply using `items` due to `ArrayField` changes
45
56
- BREAKING CHANGE: Updated `ArrayFieldItemButtonsTemplate` to replace the old callback-generator functions with the new memoizable callback functions
46
57
- Fixed a bug in `Form` to avoid getting errors being reported at the root level via `onChange` when there aren't
47
-
- Refactored LayoutGridField as function components instead of a single class component.
58
+
- Refactored `LayoutGridField` as function components instead of a single class component.
48
59
49
60
## @rjsf/daisyui
50
61
@@ -127,8 +138,7 @@ should change the heading of the (upcoming) version to include a major version b
127
138
- Updated the `utility-functions.md` documentation to add the new `useDeepCompareMemo()` hook
128
139
- Updated the `v6.x upgrade guide.md` documentation to add the BREAKING CHANGES to the `ArrayFieldTemplateProps`, `ArrayFieldItemTemplateType`, `ArrayFieldItemButtonsTemplateType`, `FieldTemplateProps`, `ObjectFieldTemplateProps` and `WrapIfAdditionalTemplateProps` interface props changes and the `useDeepCompareMemo()` hook
129
140
- Added documentation for the `nameGenerator` prop in `form-props.md` and v6.x upgrade guide
130
-
- Updated '@rjsf/snapshot-tests' package to explicitly depend on '@rjsf/core' to build first, fixing an error with parallelized builds
131
-
141
+
- Updated `@rjsf/snapshot-tests` package to explicitly depend on `@rjsf/core` to build first, fixing an error with parallelized builds
Copy file name to clipboardExpand all lines: packages/docs/docs/api-reference/form-props.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -482,11 +482,27 @@ You can also create a custom generator by implementing the `NameGeneratorFunctio
482
482
483
483
## liveOmit
484
484
485
-
If `omitExtraData` and `liveOmit` are both set to true, then extra form data values that are not in any form field will be removed whenever `onChange` is called. Set to `false` by default.
485
+
Flag that describes when live omit will be performed. Live omit happens only when `omitExtraData` is also set to
486
+
to `true` and the form's data is updated by the user.
487
+
488
+
If no value (or `false`) is provided, then live omit will not happen. If `true` or `onChange` is provided for
489
+
the flag, then live omit will be performed after processing of all pending changes has completed. If `onBlur`
490
+
is provided, then live omit will be performed when a field that was updated is blurred (as a performance
491
+
optimization).
492
+
493
+
> NOTE: The `boolean` options for this flag is deprecated and will be removed in a future major release
486
494
487
495
## liveValidate
488
496
489
-
If set to true, the form will perform validation and show any validation errors whenever the form data is changed, rather than just on submit.
497
+
Flag that describes when live validation will be performed. Live validation means that the form will perform
498
+
validation and show any validation errors whenever the form data is updated, rather than just on submit.
499
+
500
+
If no value (or `false`) is provided, then live validation will not happen. If `true` or `onChange` is provided for
501
+
the flag, then live validation will be performed after processing of all pending changes has completed. If `onBlur`
502
+
is provided, then live validation will be performed when a field that was updated is blurred (as a performance
503
+
optimization).
504
+
505
+
> NOTE: The `boolean` options for this flag is deprecated and will be removed in a future major release
490
506
491
507
## method
492
508
@@ -504,6 +520,8 @@ If set to true, turns off HTML5 validation on the form. Set to `false` by defaul
504
520
505
521
If set to true, turns off all validation. Set to `false` by default.
506
522
523
+
> NOTE: In a future major release, this flag may be deleted replaced by making `validator` prop optional
524
+
507
525
## omitExtraData
508
526
509
527
If set to true, then extra form data values that are not in any form field will be removed whenever `onSubmit` is called. Set to `false` by default.
Copy file name to clipboardExpand all lines: packages/docs/docs/migration-guides/v6.x upgrade guide.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -961,6 +961,15 @@ Three new validator-based utility functions are available in `@rjsf/utils`:
961
961
- This new optional flag was added to the `SchemaUtilsType` interface's version of `retrieveSchema()` as well.
962
962
-`validationDataMerge()`: Added optional `preventDuplicates` boolean flag that causes the `mergeObjects()` call to receive `preventDuplicates` instead of `true`
963
963
964
+
### liveValidate and liveOmit performance improvement
965
+
966
+
Because `liveValidate` and `liveOmit` can have serious performance impacts in the `Form`, those flags were updated to add the following new options:
967
+
968
+
- 'onChange' - Live validate and live omit will happen as part of the `onChange` processing (the same as setting the flag to `true`)
969
+
- 'onBlur' - Live validate and live omit will happen as part of the `onBlur` processing, saving the computations until the user is done inputting data. If any changes to the state occur due to this processing, the `onChange()` event will be sent back to the client with the new data.
970
+
971
+
> NOTE: Due to this new feature, the old `boolean` options on those two flag has been deprecated. In a future major release, you will only be able to pass `onChange`, `onBlur` to activate the feature or `undefined` to disable it
972
+
964
973
### Optional Data Controls
965
974
966
975
RJSF 6.x introduces a new feature that allows developers to provide a condensed UI for users who don't care to enter an optional list of array items or set of optional object fields.
0 commit comments