@rjsf/core
- Updated
markdown-to-jsxfrom^9.8.2to^9.10.3(#5420) - Fixed
Formfailing validation withmust be boolean(or the matching type error) when the rootformDatais a falsy value such asfalse,0or''. Onlyundefinedis now treated as missing before validating, fixing #5404 - Fix
Formcrashing withMaximum update depth exceededwhen a widget orsetFieldValue()callsonChangemore than about 50 times in one event (#5631, #5532) - Fix
Formignoring later changes after a change whosecustomValidateortransformErrorsthrows. The form keeps its state and the error is rethrown from a timeout (#5631) - Potentially breaking change: Change
setFieldValue()so a throw fromcustomValidateortransformErrorsis rethrown from a timeout, so atry/catcharoundsetFieldValue()no longer catches it (#5631) - Potentially breaking change: Change
Formto no longer call its deprecatedomitExtraData()method, so a subclass overriding it no longer affectsliveOmit, a submit orvalidateForm(). A submit no longer callsvalidateFormWithFormData()either (#5631) - Potentially breaking change: Change
customValidate,transformErrorsand the validator to run whileFormrenders a change, so they must be pure: they can run more than once per change, and must not set another component's state (#5631) - Potentially breaking change: Remove the undocumented
FormmemberspendingChangesandprocessPendingChange()(#5631) - Change
noValidateto hide custom errors a widget raised, including ones raised before it was turned on; they show again once it is turned off (#5631) - Fix
ErrorListand theonChangeevent still listing a widget's custom error after an edit cleared it, with live validation off (#5631) - Change live validation on change to run once per burst of changes in one event, for the last one; the events of the changes before it report the errors from before the burst (#5631)
- Fix
Formreverting changes made in the same event as a submit, or as a blur withliveValidateorliveOmitset to'onBlur'. A throw from a blur's live validation is now rethrown from a timeout (#5631, #5660) - Potentially breaking change: Change a submit to validate and submit the data and schema of the changes made in the same event, rather than those from before them, so
onSubmitgets the data the form shows. ItscustomValidateandtransformErrorsnow run whileFormrenders,focusOnFirstErroris called after the errors render, and a throw is rethrown from a timeout. WithcreateRoot, a change made outside a React event, such as after anawait, or in a transition is still not included (#5631) - Fix a blur with
liveOmitset to'onBlur'omitting extra data against the schema from before a schema change the parent made in the same event as a field change (#5631) - Fix the errors of an old schema coming back after a schema change with live validation off, once another prop such as
uiSchemachanges, where they also hid a widget's custom error. With live validation on, an error hidden bynoValidatenow stays hidden after it is turned off until the next edit, even whenextraErrorschange (#5631) - Change a widget's replacement of a validation error to be dropped when a parent storing
formDatahands the data back, withliveValidateset to'onBlur'. The field shows the validation error again until the next blur (#5631)
@rjsf/shadcn
- Fixed
RadioWidgetnot showing the selected value with@radix-ui/react-radio-group1.4.x, which ignores the per-itemcheckedprop. TheRadioGroupis now controlled by the encoded option value, so it also follows a form reset or an outsideformDatachange (#5420) - Updated
lucide-reactto^1.49.0, which makesTrash2an alias ofTrash: the remove button's icon class changes fromlucide-trash2tolucide-trash, and thePlusCircle/AlertCircleicons gainlucide-plus-circle/lucide-alert-circleclasses. Update any CSS or test selectors that target.lucide-trash2(#5420)
@rjsf/utils
- Upgraded
@x0k/json-schema-mergeto^1.1.0, which mergesif/then/else,properties/patternProperties/additionalPropertiesanditems/additionalItemsas groups.omitExtraData()merges an object'sallOfbefore evaluating its conditions, and the older merge could pair one entry'selsewith another entry'sif, so data from an inactive branch was kept. The same merge inretrieveSchema()no longer lets anadditionalPropertiesoradditionalItemsfrom oneallOfentry act on another entry'sproperties/patternProperties/items - Fixed
retrieveSchema()treating a$refshared by severaldependenciesoneOfbranches,allOfentries,then/elsebranches,anyOf/oneOfoptions or root properties as a recursion cycle, leaving it unresolved, fixing #5434. Reference resolution now tracks a path-scoped recursion stack, so a$refis a cycle only when it is already being expanded on the current path, and previously expanded schemas keep their source ref on the path throughRJSF_REF_KEY. Shared references resolve in every branch while recursive schemas still terminate - Documented on
Experimental_DefaultFormStateBehavior.allOfwhichallOfandif-then-elsedefaultsskipDefaultsstill provides, related to #3869 (#5444)
@rjsf/validator-ajv8
- Fixed apps that import only
createPrecompiledValidatorbundling all of AJV anyway: the default export'scustomizeValidator()call is now marked pure, so bundlers drop it (#5559)
@rjsf/validator-ata
- Updated
ata-validatorfrom^1.23.0to^1.40.1(#5420) - Updated
ata-validatorfrom^1.40.1to^1.56.0. 1.55.0 fixes a crash in precompiled validators: a one-character value underminLength: 1, or an emoji under amaxLength, threw_cpLen is not defined. 1.56.0 loads its code generator on demand in the browser, so with a bundler that splits chunks (Vite, webpack, Rollup) the runtime validator adds about 58 KB gzipped to the first load instead of 135 KB (#5559) - Fixed apps that import only
createPrecompiledValidatorbundling all of ata-validator anyway: the default export'scustomizeValidator()call is now marked pure, so bundlers drop it (#5559) compileSchemaValidators()andcompileSchemaValidatorsCode()now passataOptionsOverridesto ata, so options likeassertFormat: falseapply to the precompiled validator; onlyverbosewas used before.additionalMetaSchemasandschemasoverrides with an$idare now compiled into the module, so a custom meta-schema applies there too; they go in under the$ida$refreaches each by (a draft-04idinschemaswhere the entry is read as draft-04) and as the runtime validator ends up with them, a later entry replacing an earlier one with the same$idand the form's own schemas winning. A json-schema.org meta-schema passed in is compiled in too, with a warning giving its size, since ata already ships the official draft-04 to 2020-12 ones.extenderFnand thecoerceTypes,removeAdditionalandkeywordsoverrides cannot be carried into the generated module: they were dropped silently and now log a warning, once per process, saying the precompiled and runtime validators may disagree. Extra schemas without an$id, which ata requires, log their own warning. PassingsuppressDuplicateFilteringto the compile step also warns, pointing tocreatePrecompiledValidator()(#5559)- Fixed
ataOptionsOverrides.schemasbeing dropped by the runtime validator for every schema other than the root once a root schema was registered, a custom meta-schema among them: the root is now added after the caller'sschemasinstead of in their place, so it still wins over an entry with its$id, anadditionalMetaSchemasentry with the root's$idno longer replaces it there, and the root's own validator readsschemasthrough the same list, so the root and its sub-schemas apply the same rules; a boolean record entry keeps its meaning (#5571)
Dev / docs / playground
- Upgraded dependencies with minor or patch version bumps across all packages, including
nx/@nx/js,vite,@vitejs/plugin-react,@tailwindcss/cli,knipandlint-staged, plus the playground'smonaco-editorfrom^0.55.1to^0.57.0. Addedpnpmoverrides that pin@types/reactand@types/react-domto React 18 so libraries with an optional@types/reactpeer don't typecheck against React 19's types, plus one that holdsjsdomat~30.0.1because 30.1 needs the globalIteratorthat Node 20 lacks. Renamed the vitest configs to.mtsso Vite'snativeconfig loader can load them as ESM (#5420) - Documented in the
allOfsection ofform-props.md, and onExperimental_DefaultFormStateBehavior.allOf, whichallOfandif-then-elsedefaultsskipDefaultsstill provides, and added tests for those cases, related to #3869 (#5444) - Documented precompiled validators for
@rjsf/validator-atainusage/validation.md, and added size-limit canaries that fail ifcreatePrecompiledValidatorstops tree-shaking in either validator package (#5559) - Documented in
usage/validation.mdthatcustomValidate()andtransformErrors()must be pure, since they can run more than once for a change (#5631)