Repository navigation
fix(utils): keep array items when the items schema did not change - #5460
Conversation
Size limit reportSizes are minified + brotli, measured by size-limit at A package listed twice is measured both as installed and, on the second row, as its own code with its dependencies excluded. Peer dependencies are always excluded.
|
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for this. The guard does keep the minItems placeholders (I confirmed [null, null] now survives an unrelated sibling-schema change). But it special-cases the symptom: the enum filter still runs when the items schema hasn't changed, and the maxItems slice now prefers empty slots over values. Details are inline. I ran every scenario below against this branch and against main before the PR.
One point couldn't go inline because the line is outside the diff:
Array-form item type never matches (sanitizeDataForNewSchema.ts:245, pre-existing). oldSchemaType === newSchemaType compares by reference, so type: ['string', 'null'] taken from two different schema objects never matches, and the whole list is cleared. Old items { type: ['string','null'], enum: ['a','b'] }, new items { type: ['string','null'], enum: ['a'] }, data ['a', 'b'] -> list becomes undefined, not ['a']. Line 154 does the same for property keys. This isn't introduced here, but it's the same function and the same "list unexpectedly emptied" symptom.
Also, please add a changelog entry as the last bullet under ## @rjsf/utils in CHANGELOG.md. It should mention the changed maxItems behavior too, unless that changes per the inline comment.
|
A note on how this code looks on
So |
|
Following up on the |
|
@heath-freenome Retargeted to v7 and reworked as suggested. What changed:
Ran: On your non-inline point about array-form item If #5451 also needs a 6.x fix on |
|
@heath-freenome Moved the changelog entry from |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the quick rework. Everything from the first round is addressed: the retarget, the shared-suite test with the sibling-change trigger, CHANGELOG-v7.md, and the null exemption and maxItems slice issues, which are gone now.
I ran another pass over the new head (f0cc524). The first inline comment is the important one, and it's a hole in the approach I suggested, not something you introduced: with a nested if/then, "the raw items schema didn't change" is the wrong signal, because the keyed schemas there are already resolved against the data. I confirmed it and the new-array-of-objects case against v7 (65fb46692) with throwaway tests. The rest are smaller.
|
@heath-freenome Both regressions reproduced as failing tests first, then fixed. Pushed as 900fca3. Nested Newly introduced array-of-objects: the flag is gone. The property loop now passes a neutral Also in this push:
|
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for turning this around so quickly. Both regressions from last round are fixed, the public signature is back to five parameters, and the docs and shouldFilter cleanup are what I asked for.
I ran another pass against 900fca35, checking each scenario against the PR source with the ajv8 validator. The summary is uncomfortable, and most of it is on me: #5451 still isn't fixed for the schema shape that makes Form sanitize on every change (first inline comment). Two of the new problems come straight from the { type: 'array', items: {} } stand-in that I suggested (comment on line 196).
I think this is the third round in a row where a gate on the array-enum branch closes one hole and opens another. There are now five of them: sameItemsSchema, itemsResolvedAsWritten, conditionalResolvedUpstream, isWholeValueSelect and the stand-in. My original one-condition suggestion was the wrong fix, and I'd rather not ask you for a sixth gate. The comment on line 312 has what I think the root cause is and a direction that would handle it in one place. I'd like to agree on the approach before more code changes.
|
Thanks for another careful pass, and no apology needed on the stand-in. I reproduced every one of these against
On the root cause I think you're exactly right. Both sides are resolved against the current data, so every gate in I'd be glad to take that on. The shape I'd expect: But it changes what the util receives, so I'd rather settle the direction before writing it. As I see it:
Happy to go whichever way you and the team prefer. If you want to see the prototype, I'll build it red-first against the seven cases from this round and the two regressions from the last one. On the smaller points: agreed on hoisting |
|
@charan-rathore Thanks for re-running every case and for laying out the options so clearly. Let's go with the prototype, and do it here: this PR's current gates would all be replaced anyway, so reworking it in place keeps the history and the discussion together. On the shape, I'd go with the optional trailing argument for the previous data, passed down through the recursion, rather than having
The hoisting and shared-helper nits will probably disappear with the gates, so don't spend time on them in the current code. Since this changes what the util receives, other maintainers may weigh in on the signature, but please go ahead with the prototype. |
|
@heath-freenome Reworked along the lines we agreed, pushed as 7c754ab.
Verification: |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the rework. The shape is what we agreed on: an optional trailing argument passed down through the recursion, with Form supplying it. The stand-in is gone, the pairing rule is written down and tested, the scalar path uses the same comparison, and the docs, upgrade guide and changelog are updated. CI's lint and typecheck job passes on 03d9f5f0, so the type-check you couldn't run locally is covered.
I checked each scenario below with the ajv8 validator, against both the PR head and v7. Two things need to change before the details matter:
- The previous data should only decide the enum filter (comment on line 187). Right now the old schema resolved against the previous data is used for everything else as well: removing fields, the type check and the default/const swap. So
Formnow clears values that a nested conditional hides or retypes, and v7 keeps them. That follows from the shape I asked for in the go-ahead, not from anything you did wrong. I should have scoped it to the filter from the start. - Without the previous data, behavior should match v7 exactly (comment on line 377). The round-3 gates are still used on that path, so
formDataForNewOptionand other direct callers see a change, and the changelog says they don't.
The other comments are smaller, and some of them go away once these two are done.
|
Thanks for the detailed pass - all seven points are in. What changed:
One behavior change worth calling out: with previous data, a sibling flip that narrows an items enum through an ancestor Verified locally: |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. Most of round 4 landed cleanly: field removal, the type check and the default/const swap are back to v7's behavior; without previous data the filter always runs and the gates are gone; NO_VALUE separates "no previous data" from "previous value was undefined"; and the items comparison is hoisted.
CI is red, though. The build fails on Node 22, 24 and 26 with 18 core failures. All of them pass on v7 at the merge base:
- 16 are the #5250 tests in
packages/core/test/Form.errors.test.tsx("nested inside an object" and "nested behind a $ref").foodstays'worms'when it should become'meat'. - 2 are the #1357/#2492 tests in
packages/core/test/Form.behaviors.test.tsx.
They have two separate causes:
- An ancestor's conditional is invisible to the filter decision (comment on line 183). This is what brings #5250 back for every
Formuser. To answer your question directly: yes, an ancestor flip has to force the filter, because that is #5250. - The array shortcut on line 355 treats an unchanged array as agreement even when the items schema changed.
Since the type-checked lint is left to CI, please also run packages/core's suite locally before pushing. The utils suite alone doesn't exercise Form.
The other comments are smaller, and two of them are tests that should flip once (1) is fixed.
|
Thanks @heath-freenome - all seven points are in
Verified locally before pushing: the failures you listed reproduce on the pre-fix source (8 tests red in |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks, the separate previous-data chain fixes the round-5 regression. I had it checked at a4b8b6c8 with the real AJV validator:
- #5250 through
Form: the stale value is cleared, as on v7, for every variant I tried:itemsif/theninline and behind a$ref, anif/thenon a parent object narrowing a list, a rootif/thenswitching a$ref, rootdependencieswithoneOf,additionalPropertieswithif/then, and a row'sif/thennarrowing a nested list. - #5451: editing a sibling now keeps
list: [null, null]where v7 drops it to[]. - Suites: core passes 4346/4346 and utils 2674/2674 with coverage thresholds. CI is green.
Two things before merge:
- The
@rjsf/corechangelog entry went into the 6.x changelog (comment onCHANGELOG.mdline 25). - No
Formtest covers the #5451 fix (comment onForm.tsxline 826).
The other three comments are smaller: an extra resolve on every call, a limitation of oldData that should be documented, and a doc nit.
|
Thanks, all five are in f4e4509:
Suites on this commit: core 4354/4354, utils 2674/2674 with the 100% branch coverage threshold met, and |
|
Rebased onto current v7 (af8bf31) after #5459 and the Form function-component rewrite landed. The conflict was the changelog bullets and the Form call site; the previous-formData argument now goes through |
|
@charan-rathore you'll have to rebase again and fix the size limit issue |
|
@heath Rebased onto the latest v7 (3c5f2ba, which includes the Form rewrite from #5438) and fixed the size limit failure. The
That brings the check to 23992 bytes, under the budget with a few bytes of room. Verified with the repo's own tooling (full nx build + |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the rebase and the size-limit trim. All five round-7 comments are addressed: the changelog entry is in CHANGELOG-v7.md, the Form test for #5451 is in, the chain resolves on first need, and the $ref limit is documented.
I did another pass over ceb8ce18. Two comments matter before merge:
Formdoesn't apply theoldDataprecondition the new docs state (formState.tsline 556). When theschemaprop changes so that a$reftarget'senumnarrows, a value the new enum rejects is now kept. Before this PR it was cleared.- The lazy resolve only covers scalar leaves. Every array, and every object or array child, still resolves the previous-data chain up front (line 333 and line 247).
Line 286 is an inconsistency: the scalar path and the array path treat a select over object constants differently. The rest are cleanups. Two of them, on lines 236 and 245, delete code. That should free some room under the size limit, which item 2's fix may need. Line 400 is a design question you're free to decline.
|
All eight addressed in 1. 2. Lazy resolve for arrays and container children ( 3. Object-constant selects ( 4. Per-item filter ( 5. 6. 7. Single-pass filter ( 8. Comment style ( Suites: utils 125 files / 2741 tests with 100% statement/branch/function/line coverage, core 47 files / 4467 tests. Size: |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks. 34e5ee3 works through round 8: the formDataUtils marker, resolving the previous-data chain on first need for arrays and children, the whole-value select exemption on the scalar path, and dropping oldIsBorrowed, NO_VALUE and the double scan. I've resolved those threads, along with the earlier ones the branch now covers. The per-item question on line 400 is still open. It's non-blocking.
Before merge: the marker can say data was checked under the current schema when it wasn't, and then a stale value survives:
- Line 602: after a schema swap, any edit that doesn't sanitize sets the marker again.
- Line 1068: the marker is carried through commits that changed the data without sanitizing it.
Line 826 repeats the marker rule, and line 572 has a question about what the marker is keyed on.
I traced these by reading the code. I haven't run them.
|
All four addressed in Line 602 - re-armed by a non-sanitizing edit. Confirmed with your exact scenario: swap narrows the Line 1068 - carried through an unsanitized change. Confirmed with your pet example, including the declined array write: after the row add flips the Line 826 - one rule, one place. Both copies now call a small Line 572 - keyed on the root schema. No reason to keep it on the instance; your point about inline The round-8 test is updated to cover the re-arm path as well. Suites: core 47 files / 4491 tests, utils 125 files / 2741 tests at 100% statement/branch/function/line coverage, and |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for turning this around quickly, and for writing a failing test for each round-9 comment first. Lines 602, 826 and 572 look fixed to me.
Before merge: the line-1068 fix needs another pass, and that one is on me. The first option I suggested clears the marker on ordinary edits: adding a row, a parent passing the form's own edit back, and reset(). Each time, the #5451 data loss comes back. The inline comment on settledFormDataSchema has the three sequences and a different approach. I confirmed all three by running throwaway Form tests against 6d82dbd. The other two comments come from reading the code.
On line 400: fair point, 0fe7418 settled that, and a follow-up PR is fine. I've resolved that thread.
|
Round 10 is up, taking your second option. The settled snapshot. Your three sequences are
All three failed against The re-resolve flag. The double walk is gone with the rewrite: the pass shares the root once into And no apology needed — the first option was the reasonable read of a two-state marker, and your running the sequences caught what my analysis didn't. Thanks for that. |
heath-freenome
left a comment
There was a problem hiding this comment.
Round 11. ed29aad fixed the three sequences from my round-10 comment, and I've resolved those threads. I ran the review again on 99229b1. I confirmed two regressions against v7 with throwaway Form tests, run on this head and on v7 3c5f2ba; both come from the settled-snapshot design. Two more items are reasoned from the code: the array pairing (not run) and the scalar re-resolve. The other four are API, docs and cleanup.
The first one is again a gap in the option I proposed rather than in your implementation of it. I paired the snapshot with the committed data's resolved schema without noticing that the root's conditionals are already merged into it.
|
All eight threads are in the pushed head (aad44b9, plus 107bf4c which merges v7's #5464 and resolves the overlap in formState.ts):
The three new Form tests live in |
|
@heath-freenome On the unsettled-snapshot thread: all three paths are fixed in
Tests in |
|
@heath-freenome On the array-pairing thread: took your preference in Your three sequences under the new rule:
Test changes: the insert test from |
|
Round 13 is up at
Local checks:
|
heath-freenome
left a comment
There was a problem hiding this comment.
Round 13. Thanks for working through round 12. The nits are fixed, and I've resolved those three threads. c26fd675, 8ea08e02 and 4d09cc90 do what round 12 asked, but two of them open new holes. I've replied in the formState.ts:1254, :858 and sanitizeDataForNewSchema.ts:386 threads.
CI is still red on b5fe05e1:
checks: lint, which is also the typecheck, fails with 11 errors (inline on the test file). The round-13 summary didn't list lint among the local checks.build, on all three Node versions:@rjsf/utilsbranch coverage is still 99.96%, at the same statement as last round (inline).sizepasses with the 24.1 kB budget.
Two of the thread replies are about my own round-12 requests. The :1254 reply covers a gap in the check c26fd675 built from my wording. The :386 reply goes back on the array rule I preferred, which 4d09cc90 adopted; sorry for the churn on that one.
The reset comment at formState.ts:851 questions a choice ed29aad7a made on purpose, so it's your call.
All of this is traced from the code and the CI logs. I didn't run any tests.
heath-freenome
left a comment
There was a problem hiding this comment.
Round 14. Thanks: d665b879, 5108b668, 823a368d, b6583669, 32801c7b and 4df42a23 close out most of round 13, and I've resolved those eight threads. @rjsf/utils coverage is 100% when I run it locally.
CI hasn't run on ddb48053, because the workflows are waiting for approval. Running pnpm run lint locally fails with two TS2741 errors from the new state member (inline on formModel.ts).
Two of the new fixes need more work. I've replied in the open threads:
formState.ts:869(the reset/push thread): a #5250 regression I reproduced. After a parent push the form doesn't take as its own proposal, flipping back to the snapshot's branch keeps values that branch rejects. v7 without this PR clears them.sanitizeDataForNewSchema.ts:386(row pairing):e3cc5729only reaches self-owned forms, and the move can line rows up wrongly after a change it wasn't told about.
There are also inline notes on docs for oldDataForPairing and a proposal that never clears, plus a follow-up on the K nit in its thread. Only finding 1 and the lint errors were run; everything else is traced from the code.
|
The four open threads, all verified locally (full core suite 4952 green, utils suite 2798 green with the 100% branch gate, type-checking lint clean): Reset keeps a stale snapshot ( One helper for the constraint check ( The double walk ( The reversed rule ( One honest note on the tests: the deep-equal-copy parent test goes red on the old acceptance condition, but the changed-schema-once parent test passes both ways. Under the old condition the marker drop still left the later edits filtering correctly in that sequence, so it pins the behavior without discriminating. You caught the same shape on the live test, so I would rather say it than have you find it. Size: this PR raises the core installed budget to 31.5 kB ( |
heath-freenome
left a comment
There was a problem hiding this comment.
Round 15 on 5e123dc3. Lint and typecheck are clean, @rjsf/utils coverage is 100% and CI is green, thanks. I resolved two threads: the double walk, and the IS_OWNED_BY_FORM entry.
Still open from round 14, with the code unchanged:
- The
oldDataForPairingdocs (types.ts:2039). - The getter that forces the parent's resolve below the root (
:346thread). - The proposal that is never cleared (
formState.ts:1315).
Findings 1, 3 and 4 have follow-ups in their threads. I ran 1 and 3.
I ran both new gaps below on this head. Both fail the same way on the v7 base, so they're #5451 cases this PR still misses, not regressions.
On the approach (not a request to change it). The fix now carries six FormState members, a proposal-acceptance check and a replay of row moves, all to decide whether an enum filter runs. Each open item comes from a data path that changes the data without settling the snapshot: a parent push, a container write in a parent-owned form, an added row, a schema swap. A narrower fix would keep null/undefined placeholders inside the filter itself. That would reverse 7c754ab25 and every round built on it, so I'm not asking for it. If you keep this approach, please list in the PR body which paths settle the snapshot and which don't. That would make the rest of these easier to check.
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. Everything from round 15 is in, and I've resolved all 10 open threads. At 152e5358, lint, cs-check and @rjsf/utils coverage (100%) pass, and my repros for the flip back, the parent-owned remove and the added row all pass.
The moved pairing view has three gaps I ran and one I only traced, plus two doc nits. Each is inline below. I ran each test against both this branch and v7. Only the third (push, then remove) is a regression: v7 filters the pushed value, and this branch keeps it. The root-array and declined-reorder cases fail on v7 too, so they're places where #5451 isn't fixed yet.
Also, CHANGELOG-v7.md now conflicts with v7. When you merge it, please keep both bullets last in their lists.
|
@charan-rathore can we focus on getting this PR merged before you do anything new? |
|
Yes. This PR is my only active work right now. Round 17 covers all three runnable gaps plus the two doc nits: a container write now carries the pairing view it moved as pending state until the parent answers that write, and the sanitize call marks a frame with no previous array explicitly so a declined write can no longer revive a dropped key's settled value. The three new tests reproduce your probes verbatim. Pinned suites pass (21/21 settled-snapshot, 1012/1012 utils schema); I'm running the full core suite before I push. |
|
Round 17 is up at Local gates: pinned suites pass (21/21 settled-snapshot, 1012/1012 utils schema), the full core suite passes (49 files, 4959 tests), oxfmt clean, and |
|
Amend note for the re-push: the |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. The declined reorder, the root-array reorder and both doc nits are fixed, and I've resolved those threads. My round-16 repros pass, the settled-snapshot suite passes, and utils coverage is 100%.
Two things block approval:
checksfails on5df3f53fwith a type error from the size amend (inline atformState.ts:529).- The length-mismatch regression is fixed for nested arrays but not for an array at the document root (my reply on the round-16 thread).
The two-writes follow-on (my reply on the stacked-write thread) and the two gaps below aren't blocking; both gaps behave the same on v7. The two nits are optional, though I'd take the readable version plus a 31.5 kB Form canary over the size trims.
…h container writes (rjsf-team#5460) The sanitize pass filters an array's items against the items enum only when the items schema itself changed, when either side was resolved against the current data into a different shape, for selects over object or array constants, and for properties the new schema introduces - so editing an unrelated field no longer deletes entered values such as unfilled minItems placeholders, fixing rjsf-team#5451. Container writes carry a pairing view of the settled data so a moved row follows its item to its new index, and hold that view as pending state until the parent answers the write: an out-of-order or declined push can no longer re-pair a row against a sibling's item, and a frame with no previous array is marked explicitly so a deliberately dropped key's settled value is not revived. Fixes rjsf-team#5451 Signed-off-by: Charan Rathore <[email protected]>
|
Round 18 is up at Local gates: pinned suites 22/22 settled-snapshot and 1012/1012 utils schema, the full core suite passes (49 files, 4970 tests), |
heath-freenome
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. Both blockers are fixed at 1e47db99: checks is green, and my root-level push-then-remove repro now ends with tags: [], as on v7. All 22 settled-snapshot tests pass, and so does the rest of CI. The readable version of the pending-pairing code is back, with the Form canary at 31.5 kB.
Approving. The two follow-ups you offered to file once this lands (two container writes in one event, and an optional array with no default) are fine as separate issues. The three inline notes below are small and non-blocking.
Co-authored-by: Heath C <[email protected]>
Resolving the changelog conflict of the peer floor commit took the branch's side whole, which dropped the entries v7 had added meanwhile (rjsf-team#5460, rjsf-team#5474, rjsf-team#5510, rjsf-team#5484, rjsf-team#5488, rjsf-team#5508). The rjsf-team#5460 entry loses its last sentence: a parent that adds to the data it stores no longer keeps the snapshot from settling, since every edit settles it in the form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolving the changelog conflict of the peer floor commit took the branch's side whole, which dropped the entries v7 had added meanwhile (rjsf-team#5460, rjsf-team#5474, rjsf-team#5510, rjsf-team#5484, rjsf-team#5488, rjsf-team#5508). The rjsf-team#5460 entry loses its last sentence: a parent that adds to the data it stores no longer keeps the snapshot from settling, since every edit settles it in the form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolving the changelog conflict of the peer floor commit took the branch's side whole, which dropped the entries v7 had added meanwhile (rjsf-team#5460, rjsf-team#5474, rjsf-team#5510, rjsf-team#5484, rjsf-team#5488, rjsf-team#5508). The rjsf-team#5460 entry loses its last sentence: a parent that adds to the data it stores no longer keeps the snapshot from settling, since every edit settles it in the form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolving the changelog conflict of the peer floor commit took the branch's side whole, which dropped the entries v7 had added meanwhile (rjsf-team#5460, rjsf-team#5474, rjsf-team#5510, rjsf-team#5484, rjsf-team#5488, rjsf-team#5508). The rjsf-team#5460 entry loses its last sentence: a parent that adds to the data it stores no longer keeps the snapshot from settling, since every edit settles it in the form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5556) * feat(core)!: let Form own its data and take formData only when it changes Form has one data owner, itself. `formData` is the value it takes, filled in with the schema's defaults, on mount and whenever it is passed a value it has not seen: neither its own data, which a parent storing what `onChange` reported passes back, nor the prop of the render before. `initialFormData` is read on mount and on `reset()` only. Edits are applied and shown before `onChange` is called, whatever the parent does with them; a parent refuses one by setting the field back. That removes the parent-owned mode and everything that served it: the proposal held until the parent answered, the epoch it was dropped by, the members owned per owner, the validation a blur owed the render that answered, the controlled branches of change, blur, reset and the derivation, and the three ownership warnings. Without live validation, a change now clears the validator's errors of the fields it replaced in `applyChange()` itself, for both seeds. That clearing existed only as a side effect of the parent-owned derivation diffing the prop against the previous one; a form seeded with `initialFormData` kept the errors until the next validation. A change that moves array items is diffed with the items where the move put them, so the errors that moved with them stay, under every parent. A root array is diffed by index like a nested one. The reporter that held callbacks while an `<Activity>` hid the form goes too, with its three Effects: a callback is called when its operation happens, hidden or not, and a handle kept past the unmount still works. The react peer goes back to >=19, since the insertion Effect cleanup that needed 19.2 is gone. `submit()` calls `requestSubmit()` at once instead of queuing until the inputs show the data. Native constraint validation checks the inputs as rendered, so an edit that fills a required input in the same handler is blocked until React renders it, as in v6; the `CustomEvent('submit')` the queue dispatched never reached React's handler and is deleted. The form element is kept across the ref detach an `<Activity>` causes, so a hidden form submits. `commit()` takes the next state alone: the reapply guard served operations issued from a validation callback, which the docs forbid. `applyChange()` copies the containers along the change's path instead of structured-cloning the whole value, which also stops a `File` or class instance in the data from throwing or losing its prototype. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs: describe the form as the one owner of its data The upgrade guide, the form props reference, the internals page and the quickstart describe `formData` as the value the form takes when it is passed one it has not seen, `initialFormData` as the seed, edits as applied before they are reported, and `submit()` as a submit through the element at once. The controlled-form rules, the hidden-form paragraph and the ownership warnings are gone with the behaviour. Co-Authored-By: Claude Fable 5.1 <[email protected]> * refactor(core): drop what the one-owner contract left stranded `MultiSchemaField` kept a record of the data its option switch sent so that a switch whose data did not follow it, a parent declining it, could be put back. The data always follows now; the record is a flag that keeps the user's own switch from being re-matched against the data it adds. The model's `Report` and `OperationProps` existed so an operation could not report through the props it started with, since a report held for a hidden form had to use later props. Reports are immediate, so an operation reads `committedProps` and calls the callback itself; a field's report still goes through `callWithDeferredThrow()`. `FormState.edit`, a v6 flag that gated live validation on a prop change for a form that was never handed data, goes: live validation runs for the data the form holds whenever something the errors depend on changed. `FormState` is no longer exported. It carries memo keys and bookkeeping, and `IChangeEvent` is the public shape of what reaches a consumer. `describeOwnerships` ran nine suites once self-owned and once under a parent that stored every edit back. The second run only proved that passing the form's own data back is not a replacement, which the ownership suite states once; `describeRepeated` keeps the four extra-data variants. `ObjectField`'s seed records stay as they were: a child's write does not pass through the field, so the data is where a property's history is read, whatever the owner. Only the comments that described a declined rename go. Co-Authored-By: Claude Fable 5.1 <[email protected]> * refactor(core)!: let container fields read the form's data instead of a view of it `ArrayField` and `ObjectField` built their adds, removes, renames and reorders from a view: the data they were rendered with, advanced by what they had sent since, and vouched for by a context chain through every core field that declared which child it had handed the form's own data. The vouching existed so that a custom field handing a core field a transformed view, a sorted copy say, kept to that view. The view layer is gone: a container field reads the form's current value at its `fieldPath`, and a custom field that wraps one has to pass `formData` through unchanged. That removes `useFieldView`, `RawFormDataContext` and its eleven call sites, and the `epoch` and `proposing()` the model kept so a field's record of a view it sent ended at the right commit. `FormDataContext` keeps `readField` and `sendMove`. `ArrayField` keeps its rows in a ref beside the keys that render them, installed from an insertion Effect, so a second handler in one event starts from the rows the first one sent; `ObjectField` reads the rendered data through a ref outside a `Form`. Both read through refs rather than closing over the render's data, so a handler keeps its identity across edits and sibling rows are not re-rendered. A custom field that passes the form's data on, which the component chain did not vouch for, now composes edits in one event with the rest of the form; one that keeps a draft or hands a transformed view no longer chains edits on it. The tests for those wrappers are gone, and the custom-fields page and the upgrade guide say what a wrapper may hand a container field. Tests and helpers are reworded for the one owner: `Form.parents.test.tsx`, `ParentLog`, `ParentProps`, and `reported` for what was `proposals`. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs: record the one-owner contract in the changelog and correct the core peer floor in the guide Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(core): keep the react peer dependency floor at >=19.2 The one-owner change lowered the floor to >=19 because the insertion Effect cleanup that needed 19.2 was gone. 19.2 is the oldest React RJSF supports, so the floor stays where v7 has it. The changelog entry and the upgrade guide say so. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): fix what the review of the one-owner form found A change that reaches a form after it unmounted is dropped, as in v6: a draft a widget flushes from an Effect cleanup, a late timer or file read, or `setFieldValue()` and `reset()` through a handle kept past the unmount. Reported through the last render's `onChange`, it was stored as the data of the form that replaced it. The form learns of the unmount from an insertion Effect cleanup, which an `<Activity>` hiding it does not run, so a hidden form goes on taking changes. `committed()` keeps an edit made between a render and the form's insertion Effect under a parent that stores edits, where the echo was read as a new value and replaced it. Without live validation, adding or copying an array item no longer clears the array's own validator errors, which a remove and a reorder kept. `reset()` reports the `extraErrors` it leaves on display instead of an empty error list. `submit()` and `focusOnError` compare against the classes of the form element's own window, so they work for a form rendered into an iframe. A root `formData` of `NaN` is recognised as seen through `Object.is`, where it was taken again on every derivation. `ArrayField` gives every slot of a sparse array a key and a row, where a hole rendered no row and made Add throw. The docs, the changelog and the doc comments say what the code does for edits shown before `onChange`, a record that loads after mount, `submit()` and `reset()`, and a form that has unmounted. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep three v6 behaviours the one-owner form had dropped An option switch that `onChange` answers by setting the field back returns the `oneOf`/`anyOf` selector to the option the data fits, as v6 and v7 do. The field again records the data its switch sent, so it can tell data that followed the switch from data that did not; the flag that replaced the record kept the chosen option whatever the next render brought, which left the selector and the option's fields on a refused option. A live-validated form that was never handed data is not validated because a validation prop changed identity. The `edit` gate v6 and v7 have is back: without it a `transformErrors` written inline showed the `required` errors of an untouched form on the parent's next render. An edit a consumer's function makes through the handle while an operation runs, such as `setFieldValue()` from `customValidate` during `validateForm()`, is kept. The operation runs once more on top of it, where its result, computed from the data before the edit, used to be stored over an edit that `onChange` had already reported. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): share what the container fields read and send through, and drop what the rebase left unused `useReadFieldData()` and `useSendMove()` take over the read of the form's current data and the announced key move that ArrayField, ObjectField and `useSendOptionSwitch()` each spelled out. `settledFormDataState()` drops its `rootMatches` fallback, which no caller reaches since the caller shares the root, and `applyReset()` and `applySubmit()` share `extraErrorsAlone()`. `deriveState()` shares and records the `formData` prop in one place, which the model's commit reuses, `withKeysMoved()` drops its overload, and `ownedErrorsOf()` is `errorStateOf()`. ArrayField's confirmed rows say again when they are needed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): pair rows against the settled data when the parent sets a reorder back A formData the form takes that is not a copy of its own data resets the pairing view to the data as it last settled, from before the container writes since, as v7 did for a declined write (#5451). A parent setting a reorder back otherwise had the next sibling edit pair each row with its neighbour's previous value and drop its placeholders. The test that covered this declined with the value the parent already held, which the form now ignores as seen, so it sets the value back as a copy; the other settled snapshot tests are renamed from proposals to edits. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): validate without reporting through a handle kept past the unmount `validateForm()` and `validateFormWithFormData()` on a form that has unmounted return their result without committing the errors or calling `onError`, as a change or a `reset()` there is already dropped: the callback is the last render's, and there is no form left to show what it found. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: fold the owner-at-mount changelog entries into the one-owner entry The v7 changelog described both the owner decided at mount and the one-owner form that replaces it. The entries that only described the former go, the one-owner entry takes over what still holds of them (defaults without `onChange`, frozen `formData`, `submit()` after an edit), and the others speak of a parent setting a change back rather than declining a proposal. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(core): read elements and the handle through helpers instead of non-null assertions `elementOf()` joins `input()` and `handleOf()` in testUtils, failing the test with a message where a `!` would only defer the failure. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): diff a change only for errors to clear, and name what a pass is told A change diffs the data it replaced only when there are validator errors to clear, through a thunk as `reconcileErrors()` takes it, so a keystroke in a form without them no longer pays for the diff and the error rebuild. `FormState.edit` is `isDataPassed`, which is what it records, and `deriveDataState()` takes it as a named option rather than a bare `true`. `withKeysMoved()` checks for a removed item's missing key instead of relying on `NaN` failing a comparison, `FieldChange` and `KeyMove` are no longer exported, and `useKeyedFormData()` hands ArrayField the items of its sent rows itself. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep the moved pairing view where a value the form takes holds its data A `formData` the form takes is paired node by node: where it holds what the form's data does, it keeps the pairing view the container writes moved, and elsewhere it is paired against the data as it last settled. A parent that stores each edit with a field of its own, such as a timestamp, passed a value that was never the form's data, so a reorder lost its moves and the next sibling edit dropped the rows' placeholders (#5451). The pairing view is typed `unknown`, which it is, so moving it needs no cast. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(core): read elements and handles through the helpers in the rest of the rewritten tests The tests this PR rewrote most held 68 more non-null assertions on lines it had not touched; `elementOf()`, `input()` and `handleOf()` replace them, so each file reads its elements one way. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: restore the v7 changelog entries the rebase onto v7 dropped Resolving the changelog conflict of the peer floor commit took the branch's side whole, which dropped the entries v7 had added meanwhile (#5460, #5474, #5510, #5484, #5488, #5508). The #5460 entry loses its last sentence: a parent that adds to the data it stores no longer keeps the snapshot from settling, since every edit settles it in the form. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(core)!: seed the form from formData on mount and reset only, as initialFormData `formData` is another name for the seed, taken over `initialFormData` when both are passed: read on mount and on `reset()`, and ignored after that, as React's uncontrolled inputs read `defaultValue`. Data the form reported changes nothing when it is passed back, and any other value warns once in development and points at a `key` or `setFieldValue('', data)`. The adoption path goes with it: `FormState.formDataProp`, the seen-value check and the pairing of an adopted value. A container written with no move announced, as `setFieldValue()` puts a reorder back, now pairs the rows it changed against the data as it last settled, where it kept the view the reorder moved (#5451). The tests that replaced the data by passing a new `formData` do so through `setFieldValue('', data)` or a `key`; those of the contract itself assert the new one. The playground remounts its forms when a sample loads or the JSON editor replaces the data, and the docs describe the seed, the `key` and `setFieldValue()`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): make ArrayField's row keys without mutating anything while rendering Rows made while rendering are keyed from a generation held in state and their index, and ordered as the items are; rows a handler adds take a key from a per-field count only handlers move, ordered after every current row. Rendering is pure, so StrictMode's second render keys the rows alike, and a row added after a remove never takes a key a row has had. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(core): refuse or rewrite an edit in a pure transformChange prop `transformChange(next, previous)` decides what an edit leaves the form with before the form stores, validates and reports it, so a parent that refuses or normalizes an edit no longer calls `setFieldValue()` from `onChange` and gets a nested report. It runs inside the model's re-run of an operation, so it must be pure; a value it changes is written over the whole form, which re-derives defaults, clears the errors of the values it replaced and pairs the rows of a refused reorder against the settled data. The guide's refusal section, the prop reference and the changelog describe it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core)!: hand commits to the store from layout Effects and treat a hidden form as unmounted The form no longer uses insertion Effects, which React reserves for CSS-in-JS. Each commit hands the model its props and rendered state from a layout Effect, and the model publishes the state the render derived, so the store's snapshot is the state the form shows; the render derives it with `useMemo` instead of setting state while rendering. A prop change that changes the form's state takes a second commit to publish it, which renders no field. A field's layout Effect, which runs before the form's, sees the previous props in the commit that renders new ones. A form an `<Activity>` hides is detached as an unmounted one is, the way React asks hidden content to be treated: it drops changes, `reset()` and `submit()`, and its validation methods return their result without reporting. `submit()` after an edit React has yet to render waits for the commit that renders it, so native constraint validation checks the inputs as they show the edit, and the guide's Effect for that is gone. ArrayField and ObjectField keep their latest rows and data from layout Effects too. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(utils,core)!: fill a null schema's value in as a default instead of from NullField's mount Effect `computeDefaults()` gives a missing value of a `type: 'null'` schema the one value it allows, `null`, except for the `anyOf`/`oneOf` option a field renders, whose `null` option renders no field. `NullField` renders nothing and no longer calls `onChange` from an Effect as it mounts, which React asks components not to do; the submitted data is the same, and the form holds the `null` from its first render without a report. `getDefaultFormState()`'s return type, and the public `SchemaUtilsType.getDefaultFormState()`'s, include `null`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(chakra-ui): let NumberInput show its value without writing the input from an Effect `NumberInputRoot` wrote `props.value` into its input element from an Effect, overwriting the DOM of a component Chakra controls; Chakra's `NumberInput` already syncs the input to the `value` it is handed. A test pins that a value set from outside the field reaches the input. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(daisyui): position DateWidget's calendar before the browser paints it The calendar popup measured the trigger and set its position from a passive Effect, after paint, so it could show in its previous place for a frame as it opened. Measuring and positioning is what layout Effects are for; the resize and scroll listeners move with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(daisyui): keep the frame provider's theme storage out of render `DaisyUIFrameProvider` wrote the chosen theme to `localStorage` while rendering and read the stored one on every render. It now reads it once through a state initializer and writes a chosen theme from an Effect, so rendering has no side effect and a render React discards writes nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(playground): show a broken shared link as an error banner instead of alerting from an Effect The playground alerted from a mount Effect when the shared link's setup could not be read, which StrictMode's second Effect run showed twice in development. The error is read once as the module loads, so it renders as a banner above the editors and is logged once, with no Effect. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): drop ObjectField's seeded-property records from its handlers rather than a layout Effect ObjectField kept its record of the seeds the add button wrote in step with the data from a layout Effect on every `formData` change. The handlers a write goes through now do it: the `onChange` the properties report through, and the add, rename and remove handlers, each check the record against the data the write left, read from the form. A write the form refused, as `transformChange` can, or one a parent wrote the seed back over keeps the record, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): keep render output out of the store and submit after an edit without waiting for a commit The model's store holds what operations make of the form and nothing a render derives. Form's layout Effect only records the props and state each commit rendered, which an operation starts from, deriving the store's state under the committed props when an operation has run since and sharing it with what is on screen, so a prop change takes one commit again and no field renders for it twice. The render keeps its last derivation in state, React's pattern for storing information from previous renders, instead of a store update from an Effect. `submit()` no longer queues: it submits before it returns. While the inputs show the stored value it goes through `requestSubmit()`, so the browser's constraint validation runs as for a submit button; after an edit React has yet to render, it dispatches the submit event, and schema validation alone checks the stored value. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mantine): give a field's error id to one element from render, without a DOM check `FieldErrorTemplate`'s hidden copy of a field's errors queried the document after every commit and took the field's error id only while no other element had it. Mantine's `FieldTemplate` now provides the id of the field whose hidden copy it renders: under it, the copy has the field's `errorId`, and the error element a Mantine widget, checkbox or object/array template shows has none of the field's, so the inputs described by the id read the errors once and a custom widget that shows no errors is still described by them. Anywhere else, as for a oneOf selector, a widget rendered by itself or a custom `FieldTemplate`, the error element shown keeps the id and the copy has none. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(daisyui): report the date picker's blur from the handler that closes it The picker reported blur, and the focus the trigger holds after it, from a passive Effect of the close commit, and a pending blur from an unmount cleanup, so the consumer heard of it after the parent rendered the save. React asks a component to tell its parent from the event handler that caused the change; the form stores an edit as `onChange` reports it, so `getFormData()` in `onBlur` already reads the saved value. Done, a press on the trigger, a press elsewhere and Escape now report the blur with the value the close stores, and then any focus the trigger holds, from their handlers; a press elsewhere that leaves the trigger focused still leaves the trigger's own blur to report it. Both Effects are gone, and with them `callWithDeferredThrow()` here: a throw from `onBlur` leaves the handler as any event handler's does, and a `flushSync` from it runs at once instead of being deferred with a React error. The trigger's blur reads whether the popup is open from a ref the handlers set, since React has not rendered the close yet when that blur arrives in the same event. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: describe the seed-only Form in one upgrade-guide section and per-change changelog entries Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(core): link the ignored-formData warning to the upgrade guide's recipes Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(mantine): pin which element has a field's error id for each FieldTemplate and widget pairing A custom widget under a custom, non-Mantine FieldTemplate is described by no element: the hidden copy leaves the id to an error element no widget shows. That case is marked test.fails until the id is given to it from a contract the copy can see. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: name the prop changes that re-derive defaults Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(core): describe the seed-only formData contract in comments Comments and one test name still described a later formData prop being taken as the form's data. Name the whole-form setFieldValue('', data) as the unsanitized replacement instead, and drop the reasoning that relied on a prop replacing the data. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(core): cover a oneOf/anyOf option switch refused by transformChange Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): validate only the data transformChange keeps applyEdit applied the raw edit with applyChange, which live-validated it and called customValidate and transformErrors on it, then applied a rewrite as a second applyChange that validated again. A rewritten edit was validated twice and a refused one once, on data the form never keeps. applyChange is split into applyChangeToData (data, defaults, sanitization, liveOmit, settled snapshot and pairing view) and applyChangeToErrorsOf (error moves, own errors, live validation). applyEdit derives the edit's data, asks transformChange, and validates once: the edit's data when taken, nothing when refused (the state before the edit), and for a rewrite the edit's error moves unvalidated followed by one validated root write. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): put a rewritten option switch's selector on the option its data fits When `transformChange`, an `onChange` or a custom parent answered a `oneOf`/`anyOf` switch with other data than the switch sent, the selector stayed on the option the user picked and showed that option's empty fields. The field read any change of data after a switch as the data following it. The field now compares the data it gets back with the data its switch sent. Data that came back as sent keeps the picked option; any other data keeps it only while it still fits that option, and is re-matched otherwise, the way a refused switch already was. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(core)!: deprecate formData in favour of initialFormData `formData` is another name for the seed `initialFormData`, read only on mount and on reset(), but its name reads as a controlled value. Tag it `@deprecated` so editors and linters point v6 code at `initialFormData`. It still works and still wins when both are passed. The playground's samples seed through `initialFormData`; shared links keep carrying their data as `formData`, which `loadedState` still reads. Tests seed through `initialFormData` too, except those that pin the alias itself: the v6 echo pattern, a later `formData` being ignored, `reset()` re-reading it and both props passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): undo a refused move's bookkeeping and drop late blur/focus - A reorder, insert, copy or rename that transformChange refuses puts the array's row keys and the object's property order back - A transformChange rewrite keeps the fields' own errors, the root's included - A deep-equal copy from transformChange counts as the edit itself - A detached form drops blur and focus as it drops a change - focusOnError escapes the id in its selector; a null formData is the seed; setFormElement releases the element on detach; stale comments fixed Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: link the changelog entries to #5556 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): warn once, in development, about a handle call a hidden or unmounted form drops A `setFieldValue()`, `reset()` or `submit()` that reaches a form hidden by `<Activity>` or unmounted is dropped, as the contract says, but silently: a server response filling a hidden tab was lost with no trace. The call itself is a sign the caller has not noticed the form is detached, so the first one is warned about, once per form, with a link to the upgrade guide. A field's late change stays silent, since a widget flushing a draft from its Effect cleanup is expected then. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(core): address the first review round of the one-owner form - A `transformChange` result deep-equal to the data before the edit refuses it, as that data itself does, so `sendMove()` reports the refusal and the array row keys and property order go back - The props and state of a commit reach the model from an insertion Effect, which React runs before any layout Effect of the commit, so a command issued from a layout Effect anywhere in the tree starts from that commit's props - The form attaches to its model from the first layout Effect in its subtree, so an edit a widget makes from a layout Effect as an `<Activity>` shows the form again, or as StrictMode replays the Effects, is taken - A refused rename no longer moves the React key the last accepted rename gave another property - `submit()` dispatches a submit event to an element another `tagName` renders, where it did nothing - `pairingViewOfWrite()` walks the written data once, returning with each subtree's view whether it changed - `extraErrorsAlone()` merges `extraErrors` the way #5553's `applySubmit()` did, so an array it holds for an array field's items is keyed by index - The `transformChange` docs say it decides edits alone: what the form derives itself is reported without it Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(daisyui): fall back to the theme last stored when dataTheme is cleared The frame provider read the stored theme once at mount, so clearing `dataTheme` after choosing one fell back to the theme stored at mount rather than the one the Effect had since written. The stored theme now follows the chosen one, adjusted while rendering as React documents for state that follows a prop. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(core): port the model tests #5553 added to the form The one-owner form has no `formModel.test.ts`, so the three cases #5553 added there, a raised array holding nothing for an item, and a property named `__proto__` kept as a property in a raised array and across a sibling's rename, are pinned through the form's `onChange` instead. Its form-level tests seed through `initialFormData`. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs: restore the changelog entries of #5553 the rebase dropped Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): fill a missing null value in whatever emptyObjectFields says NullField used to write the null from an Effect under any defaultFormStateBehavior. The defaults that replace it went through maybeAddDefaultToObject(), which drops them under 'skipDefaults' and for optional keys under 'populateRequiredDefaults', so a required type: 'null' property stayed missing and failed the submit. A null the fill made, and the objects that lead to it, are now added like a const. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(chakra-ui): clear UpDownWidget's input when the form clears its value Zag's NumberInput switches to its own state while value is undefined, so without the Effect that wrote the input it kept showing the last number after setFieldValue() or reset() cleared the value. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: give transformChange an example that holds per keystroke Trimming on every keystroke removed a space as soon as it was typed, and next.title.trim() threw once the title was cleared. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(core): say committed() runs from an insertion Effect, and why Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): defer a field change's consumer callbacks, and re-key rows a rewrite moved A field's change now runs through callWithDeferredThrow() as a whole, so a throw from transformChange, customValidate or transformErrors on a change a widget reports from an Effect no longer unmounts the form, as one from onChange already did not. A change that throws stores nothing, so the move it carried counts as refused and ArrayField puts its rows back. sendMove() returns what became of the change: taken, refused, or rewritten with the value the edit alone left at the path. ArrayField keeps a row's key only where the form kept the item the handler put there, and gives every other item a new row, so a transformChange that sorts or filters never pairs one item's row instance with another. applyEdit() shares a rewrite against the edit's data first, so a copy that changes nothing of the edit takes it in one walk; a second walk against the data before the edit runs only for a real rewrite or a key move. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep a cleared field cleared through a transformChange rewrite A rewrite is written over the whole form, and under mergeDefaultsIntoFormData: 'useDefaultIfFormDataUndefined' its default merge filled the cleared key back in, skipping the #5125 re-clear the edit itself gets. The rewrite now carries the edit's cleared path, and re-clears it when the rewrite leaves it without a value. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep a taken option switch whose derived defaults add to its data MultiSchemaField told a taken switch from a refused or rewritten one by whether the data came back deep-equal to what the switch sent, so defaults the form derives for the switched value, such as a `then` it turns on, made a taken switch look refused, and the selector could move off the option the user picked. sendMove() now reports what the form stored at the path for a taken change, and the field keeps its choice while it renders that data; a refusal, a rewrite or a later edit from onChange still re-matches the option. MoveOutcome becomes a tagged union: refused, taken with the value kept, or rewritten with the value kept and the value the edit alone left; undefined when no form answered the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): report the null fill from computeDefaults' own recursion holdsNullFill() walked each property's computed defaults again at every object level, resolving $refs as it went, and saw only a property's own properties and a top-level $ref. computeDefaults() now reports a null fill through an onNullFill callback from the recursion it already does, so a property brought in by $ref, allOf, if/then or dependencies counts, and nothing is walked twice. Arrays don't report one: a field renders an item only for one the data holds. Where the allOf setting or emptyObjectFields leaves an object's allOf or if out of its defaults, the field for a null property they bring in still renders, so getObjectDefaults() adds just those nulls, computed under settings that drop every other default. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mantine): leave the error id on the widget under a custom FieldErrorTemplate FieldTemplate gave the field's error id to the hidden copy whenever it rendered errors, so the error a Mantine widget shows dropped the id and relied on FieldErrorTemplate to carry it. A custom FieldErrorTemplate that doesn't call useErrorCopyId() left no element with the id the input's aria-describedby names. The copy now takes the id only when the field's FieldErrorTemplate, globally or per field, is this theme's. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): warn when both seeds are passed, and not for an inline formData copy Passing formData and initialFormData together seeds from formData with nothing said; development now warns once, naming the seed that won. warnIfFormDataIgnored() compared a new formData with the last one by identity only, so an inline literal with unchanged content drew the "ignored after mount" warning after the user had typed; it now falls back to deepEquals(). The formData JSDoc and props page no longer promise that v6 code keeps working: only the echo pattern does, and a formData that changes after mount is ignored, silently in production. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): warn in development when a container field isn't handed the form's data A custom field that wraps ArrayField or ObjectField has to pass formData through unchanged, since their handlers read the form's value at fieldPath. Breaking that failed silently: a wrapper that sorted the list had remove act on another item. Both fields now compare, after the commit, the formData they were rendered with against the form's data at their path as that commit rendered it, and warn once on a difference. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): hand a commit's props over before the cleanups of the fields it removes React runs the layout cleanups of removed content while it walks the tree in the mutation phase, and Form's own insertion Effect ran after its subtree, so a widget that flushes a draft as a schema change removes it reported through the previous commit's onChange and schema, which FormRef's doc said can't happen. The handoff is now a Handoff component rendered first inside the form element, whose insertion Effect React runs before it reaches any field below. FormRef's doc and the internals page name the one exception left: a sibling of the form that the commit removes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(playground): keep its form data in step with the form, and remount only the form The form fills in the defaults of a new schema, uiSchema or default state setting without calling onChange, so the formData editor, the share link and the raw validation went on showing the data from before until a field was edited. An Effect now re-reads getFormData() after the commit that passes such a change, as it would sync with any external store. The stale "controlled parent" comment goes. An edit in the formData editor bumped the key every seeded form shared, remounting the theme, subtheme and validator selectors and the options drawer's settings form, two of which were siblings under the same key. A load now bumps loadKey, which keys those, and an edit bumps a key of the main form's alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): order a rename transformChange rewrites by the data it kept A rewritten rename was recorded as taken: the property order and the React key moved to the name the field sent, which the kept data may not hold, so a key-normalizing transformChange moved the property to the end, and one that put the old name back gave two properties the same React key. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): drop a submit event that reaches a form hidden by Activity handleSubmit had no detached check, so a native submit (a <button form> outside the Activity, requestSubmit()) of a hidden form called onSubmit for valid data, and a form first rendered hidden was never detached at all. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep the submit event submit() dispatches from an enclosing form For a tagName other than form, submit() dispatched a bubbling SubmitEvent, so an enclosing <form>'s onSubmit (the reason tagName exists) ran as well. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): drop the rows an array change sent once a commit renders without them ArrayField installed the rows a handler reads only when the rendered rows changed, so after a change that never reached the form (a custom field refusing a remove) the next handler started from the rows that change sent and handed one item's row instance to another. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mantine): read a ui:globalOptions FieldErrorTemplate when deciding who takes the error id FieldTemplate resolved the FieldErrorTemplate from the field's own ui:options only, so a custom one set through ui:globalOptions, which SchemaField renders, was taken for Mantine's: no element had the error id and the widget's aria-describedby pointed at nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(daisyui): report the undefined a date picker's close stores as undefined reportBlur and reportFocus defaulted their value parameter to the rendered value, so a Done on an empty field, which stores ui:emptyValue's undefined, reported the old '' to onBlur and onFocus. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): fill in the null of an option that is null only through a type list getDefaultFormState() left out the null of any rendered anyOf/oneOf option getSchemaType() reads as null, but MultiSchemaField renders no field only for a literal type: 'null', so an option of type: ['null'] rendered NullField with no value: a required property could no longer be submitted. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(utils): add the skipped branches' nulls without a type assertion The null fill added an `objectDefaults as GenericObjectType` assertion; an isObject() narrowing in the same condition does the same job. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): escape focusOnError's selector with CSS.escape() The hand-rolled asCssString() re-implemented the platform's CSS.escape(), which the Mantine theme used for the same job before this branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep a property in its place when transformChange refuses its removal handleRemoveProperty dropped the key from the property order before sending the removal, so a removal the form refused left the property rendered after all the others. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): warn when a parent puts its seed record back as formData The ignored-formData warning skipped every object the form had held, the seed included, since a render that adds no defaults hands the seed object back. A v6 Cancel button that sets the parent's state back to the original record was therefore ignored without a warning. Only the data operations make, which onChange reports, is held now. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: stop describing a formData passed after mount as replacing the data internals.md, validation.md, form-props.md and typescript.md still said a new formData prop reaches the form or is validated, and the getDefaultFormState() reference did not say it can return null or fills null values. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): throw an error from onSubmit, onError or validation out of submit() submit() submits inside the event it fires, where the browser reports a throw instead of handing it to the caller, so an error onSubmit, onError, customValidate or transformErrors threw never came out of submit(), as the upgrade guide says one does from every FormRef call. The submit submit() runs now keeps the throw and submit() throws it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): let transformChange refuse a key move that leaves the data as it was A move such as swapping two equal items leaves data equal to the data before it, which the store shares back as that very object, so transformChange got one object as both next and previous and returning previous took the move: each row's state, an option chosen for it, went to the other item. transformChange now gets a copy of that data as next. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): defer a throw from a blur's validation as a change's is Under liveValidate: 'onBlur', a blur ran customValidate and transformErrors unwrapped: only its onChange went through callWithDeferredThrow(). A widget that reports a blur from an Effect, inside React's commit, then unmounted the form on a throw that the same callback deferred for a change. The whole blur now runs the way a field's change does. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep the ignored-formData warning quiet for JSON copies and scalar roots The development warning about a formData passed after mount fired for a parent that stores a JSON copy of each edit once a field was cleared, since the copy leaves out the key the form holds as undefined, and for a scalar root's undo or late store, since only objects were remembered as held. It now compares with undefined as missing, remembers scalars by value, and stops comparing once it has warned. Production no longer keeps the seed alive for it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): warn when transformChange returns undefined for an edit that left data A transformChange written with a block body that returns only on the path that refuses, (next, previous) => { if (...) return previous; }, returns undefined for every other edit, which empties the form, defaults included, and hands onChange an undefined formData its type does not allow. The form now warns about it once in development, and the docs say so, and that what transformChange returns is filled in with the schema's defaults. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): rekey an array's rows wherever the form keeps other items than a change sent ArrayField kept the rows a change sent unless transformChange refused or rewrote it, so a remove the defaults answered by putting an item back (minItems with mergeExtraDefaults), or a reorder that onChange set back with setFieldValue(), left rows paired with other items than they showed, and each row's state, an option chosen or focus, went with them. The handler now reads what the form holds after the change and keeps a row only where that is the item the change put there, for a rewrite as before and for these. The kept items are read through the field's reader rather than from the outcome's unknown value, which Array.isArray() let through as any[]. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep a new property's seed record outside a Form until it is renamed Outside a Form, ObjectField's handlers read the data of the last commit, so the add button, checking its seed record against the data right after sending it, found no new property there and dropped the record: renaming the property then kept its 'New Value' under a name a numeric pattern describes. The handlers now read what they sent until the next commit, as ArrayField's do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): take a key move only with the value it was announced for The form took a field's announced key move for whatever change reached its path. A custom parent field that put other data in place of the change, as one keeping an option switch from happening by writing the old value back, had the switch reported as taken, so the selector stayed on the option the data did not fit and rendered its required input over the old data. A move now carries the value it describes, and a change bringing another value at the path moves nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): warn once per field about a container not passed the form's data The development warning about a custom field handing ArrayField or ObjectField other formData than the form holds kept its once-only flag per instance, so a field remounted with a key warned again each time, and named the field by its id alone, which two fields can share across idSeparator. It now goes through logOnce() with fieldLabelForLog(), as the other field warnings do, and production builds skip the check rather than scheduling an Effect in every container on every change. isDevelopment moves to a module of its own so the hook can read it as it loads: it is imported inside the cycle formState.ts starts by building the registry. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): pair a row a container write changes with the row the view moved there A container write with no move announced, as setFieldValue() makes, paired every changed position with the data at that index before the last moves. After a reorder that is another row, so a row the write changed in place was compared with its neighbour's previous value, the next sanitize missed the conditional the change flipped, and kept values the new branch rejects. The write also filled a position whose pairing a move of another length had dropped. A changed item now pairs with the view's item, the one a reorder put there; only an item set back to the data as it last settled pairs with that (#5451); a dropped position stays unpaired. pairingViewOfWrite(), a one-line wrapper, goes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): merge the errors a reset or valid submit leaves through mergeErrors() extraErrorsAlone() spelled the merge of extraErrors into nothing with its own validationDataMerge() call, where every derivation goes through mergeErrors(), so the errors shown right after a reset or a submit could drift from what the next derivation of the same state shows if mergeErrors() changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): live-validate an edited form on a prop change though it had no seed Whether a prop change re-validates the data was decided once, at mount, from whether the props passed any, so a form with no seed under liveValidate: 'onChange' never re-validated after the user edited it: a schema change dropped the errors the user had earned and nothing brought them back, where v6 re-validated whatever data was there. An edit now counts as data to validate, and a reset decides again from the seed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): fill a null schema's value in wherever the field rendered for it holds one The null getDefaultFormState() fills in for a null schema, in place of the one NullField used to write as it mounted, missed values its field holds: one the data holds as undefined, which the merge keeps over a default; a property that is null only through its own allOf or if/then/else, or an own property the object's allOf makes null, under allOf: 'skipDefaults'; an item of an array, or an additional property, the data holds, whose null did not reach the objects above under skipDefaults or populateRequiredDefaults; and a default: null. Each is filled in now. It is no longer filled in for an optional object the Optional Data Controls render without their fields, nor for an anyOf/oneOf option that is null once its allOf is merged, whose field renders nothing. The allOf branches are only searched for a null in a schema that names the null type somewhere. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep the null of a null field a write clears or a condition retypes A setFieldValue() that clears a null field was kept cleared like any other field's, and a condition retyping a property to null left it cleared too: the sanitize loop ended on a repeated round with the data sanitize left, which the fill had not seen, so the null it would have written was missing and the required error had no field to fix it. A null field now has nothing to clear, and a repeating round ends on filled data. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(playground): read the form's data back after every remount, not only a schema edit The playground re-read the form's data after a schema, uiSchema or settings change, but not after the remounts it makes itself, a load, an edit in the formData editor or a theme switch, so the defaults the remounted form filled in were missing from the editor, the share link and the raw validation. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: say what a hidden form drops through Suspense, a null ref and a wrapper that hands on part of its data The upgrade guide now says that React clears the ref of a hidden form, so the dropped-call warning only reaches a handle kept from before, that the ref is back only after the fields' layout Effects of the commit that shows the form again, and that a Suspense fallback hides a form the way Activity does, which the warning now names too. A custom field that hands ArrayField or ObjectField part of its data under its own fieldPath loses data, not just order. The getDefaultFormState() reference, a FallbackField comment that still had NullField writing a null, and the DaisyUI date picker's claim about the value a close reports are brought up to date. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: describe where getDefaultFormState() fills a null in, in the changelog Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(size): raise the @rjsf/core, Form and @rjsf/utils own budgets by 1 kB The review fixes take @rjsf/core to 33.32 kB, the Form canary to 33.09 kB and @rjsf/utils' own code to 27.12 kB brotlied, each over its budget. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(playground): read the form's data back after every mount, also one a frame delays The read-back Effect ran on the commit that remounted the form, but the themes rendered inside the demo frame (MUI, antd, DaisyUI, Mantine) mount the form only once the frame is ready, a commit later, so the Effect found no form and the defaults it filled in never reached the formData editor, the share link or the raw validation. The form is now held in state through a callback ref, so each mount, whatever caused it, hands over a new FormRef and the Effect reads that form's data. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(core): say what formData is without comparing it with v6, and who sets an array field back The comparison with v6 belongs to the upgrade guide. With formData only a seed, onChange cannot set a field back; setFieldValue() can. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): keep a property named __proto__ as a key when moving keys to diff errors withKeysMoved() built the moved object by assignment, so a JSON-sourced __proto__ key set the prototype instead and dropped out of the comparison. A rename that leaves the data without that key then counted it as unchanged, and its validator error stayed on a property the data no longer holds. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): sanitize a transformChange rewrite as the edit it stands for The rewrite is written over the whole form as a root change, and root writes are taken as written, so a rewrite that switched a conditional kept the values of the branch it left, which the same switch made in the field drops. A root write now carries the path of the edit it stands for, and is sanitized as that edit would be; setFieldValue('', data) is still taken as written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): fill in no null inside an optional object the optional data controls show collapsed The null of a type 'null' schema was dropped for such an object only from the rule that adds it whatever emptyObjectFields says, but the object's default still held it, so under populateAllDefaults and skipEmptyDefaults that non-empty default was stored anyway: the object rendered expanded and validation reported its required fields on an object the user never added. The collapsed object is now known before its defaults are computed, and no null is filled in below it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(chakra-ui,daisyui,mantine): leave the theme Effects to #5563 and #5548 The Chakra and DaisyUI Effect removals don't depend on who owns the form's data, so they move to their own PR, #5563, which is cut from v7. Mantine's FieldErrorTemplate goes back to v7's. Deciding the error id in render compared the template in use with the theme's own, and still left a custom widget under a custom FieldTemplate undescribed. #5548, in the #5490 stack, decides which element draws a field's errors from the field's presentation plan, which a widget declares, and replaces the same layout Effect. The theme packages now differ from v7 only in tests moved to initialFormData. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): leave the selector where it was when transformChange refuses a switch A refused option switch set the selector to the option picked and then kept it there whenever the data still fitted that option, which data does whenever no option requires a property. A switch the form refused looked taken. The rule came from the parent-owned form, where a parent declining a switch and one taking it with the same data couldn't be told apart. Here the form knows: sendOptionSwitch() returns the refusal, so the selection isn't changed at all, as a refused edit leaves an input alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): fill the null of a property named __proto__ in as an own key The null fill of a branch the settings skip wrote `fills[key] = ...` and merged the fills with Object.assign(). For a JSON-sourced `__proto__` property, both go through the prototype setter, so the fill re-pointed the fills object's prototype and the null was lost. Both now write through setOwn(), as #5524 does for every other default. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): key array rows by the items the form made of a change `commitRows()` compared the items the form holds after an add, copy, remove or reorder with the rows the handler sent, and for a change `transformChange` rewrote with what the change alone left. Two cases went wrong: - A remove that `transformChange` rewrote, where the defaults put an item back (`minItems` with `arrayMinItems.populate`), matched the change's own data, which already held the put-back item, so the rows were left at the length the handler sent. The render then fell back on the keys from before the remove, and the removed item's row showed the next item. - A change the form took as sent was compared with the raw rows, so an item the form only derived, such as one whose extra data a live omit dropped, got a new row and remounted, losing its focus and state. Both now compare with what the form made of the change, `kept` for a change taken and `edited` for one rewritten, and keep the rows only when the form holds as many items as the change sent. Regression tests: "when the defaults put an item back after a remove that transformChange rewrites" and "should keep the row of an item the form only derived, as a live omit does, across an add" both failed before this change and pass after it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(core): fill the defaults of a data pass through one helper The sanitize round that repeats filled the defaults with a copy of the fill at the top of the loop, which added a second `as T` cast. Both now go through `fillDefaults()`, which takes the result through an overload trust point instead of a cast. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(core): say which of what the form derives transformChange skips is reported The `transformChange` JSDoc said the defaults for a new schema are reported through `onChange`; they are only stored, and only a blur's live omit and `reset()` are reported. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): announce an option switch with the value its container stores A key move is taken only by the change carrying the value it was announced with, but `ArrayField` stores a cleared item as `null` and `ObjectField` a cleared `additionalProperties` entry as `''`, so an option switch that clears such a value announced `undefined` and the form received the container's value instead. The move was never taken: the option's errors stayed, no outcome came back, and the selector re-matched the stored `null` or `''` and could go back to the option the user left. The two coercions are now one rule, `storedValue()`, which both containers apply and which the option switch applies to the value it announces and sends, so the change reaching the form is the one the move describes. Three `transformChange` tests set a row's option up by a switch their rule refused; that switch clears the item, and only the unmatched move let the selector follow it. They now refuse only the edit they are about. The two new tests in oneOf.test.tsx failed before the fix and pass after. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): decide a removed property's place from what became of the removal `handleRemoveProperty` kept the key in the property order whenever the data read back after `onChange` still held it. That read reflects the removal only when `onChange` has already stored it: outside a `Form` it returns what the field last sent, and under a parent field that stores the change later the form still holds the key. The order then kept the name, and the next Add, which picks that free name again, rendered the new property at the removed one's old place instead of last. The removal is now announced like a rename, as a change that moves no key, and the order follows its outcome: a removal `transformChange` refused, or a rewrite that kept the property, leaves it in place, and anything else, including a removal no form answered as it was sent, takes it out. `AnnouncedMove.newKeyOf` is optional for such a change. The new ObjectField test, with a parent field that passes changes on a microtask later, failed before the fix and passes after. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): hand a commit's props over before a replaced root field's cleanups React runs the cleanups of an element's removed children before it walks the children that stay, so a direct child of the form element the commit removed ran its layout cleanups before `Handoff`'s insertion Effect. A root field replaced by a new `fields.SchemaField`, an error list or `children` flushed a draft under the previous commit's props, with the old `transformChange` and `onChange`. Everything the form renders after `Handoff` and `Attachment` now sits in a fragment, whose removed children React cleans up when its walk reaches the fragment, after `Handoff`. A fragment adds no element, so no theme's markup or snapshot changes, and the `FormRef` and internals docs' "before the cleanup of any field the commit removes" now holds for the root field too. The new Form.ownership test, which switches `fields.SchemaField`, failed before the fix (the flush reported through the first commit's `onChange`) and passes after. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): resolve the schema again for the data a repeating sanitize round ends on When the sanitize loop ends on a repeated hash, it stores the fill of what sanitize left, but kept the `retrievedSchema` it resolved at the top of that iteration, for the data before the fill. Every other exit commits a schema resolved for the data it stores. The schema is now resolved again after that fill. No input in the suite reaches a mismatch: the two that reach this exit (NullField's condition that retypes a property to `null`, and a variant with a second `if` reading that `null`) repeat the previous round's sanitized data, whose fill is the data the iteration resolved its schema for. The exit is also taken on a hash equal to an earlier pass's data before sanitizing, where that does not hold, so the resolve keeps the exit consistent by construction. It runs only on this exit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(utils): read the ui:definitions entry when deciding an optional object is collapsed The check that keeps the `null` fill out of an optional object the Optional Data Controls render collapsed read the property's own uiSchema entry alone. `computeDefaults()` and the field merge in the `ui:definitions` entry of a definition the property `$ref`s, so an object whose definition's entry turns the controls on was taken as expanded: its `null` fie…
Fixes #5451.
Description
On v7,
sanitizeDataForNewSchemafilters array items against the itemsenumon every sanitize pass. Because the old side was resolved against the current data, a conditional that flipped between the previous data and now showed up with identical-looking items schemas, and the filter then deleted values the user had legitimately entered (or unfilledminItemsplaceholders) when an unrelated sibling field's schema changed.Formsanitizes on every change, so any conditional form could lose entered array items this way.The fix, after review with @heath-freenome:
sanitizeDataForNewSchematakes an optional trailingoldDataargument (the previous form data), threaded down the recursion. Without it, behavior is exactly as before, so existing direct callers are unaffected;Formpasses the data as it last settled.resolvedOldSchemaparameter:FormStatestoressettledFormDataand thesettledRetrievedSchemafrom the last settling pass, so the old-vs-new comparison sees a conditional flip as a real difference and the enum filter still runs when it should (A nesteddependenciesbranch switch never sanitizes, so a narrowed select keeps an invalid value #5250 stays fixed), while an unchanged items schema no longer filters.deepEqualsgate), so a kept out-of-enum value does not pay a resolve per pass. ThemaxItemsslice behavior is unchanged.resolvedOldSchemais a caller-supplied schema, documented in the JSDoc,utility-functions.md, the v7 upgrade guide and theCHANGELOG-v7.mdentry. The marker that tracks settled data is dropped when its root no longer matches, and an empty marker failshasSettledData.What settles the snapshot
Settles:
shouldSanitize: scalar edits and whole-value selects).acceptedProposal: the pushed value becomes the settled data.Does not settle:
schemachanges: the settled marker is dropped when its root no longer matches, and placeholders do not survive the first edit after a root schema change.Verification
Formtests inpackages/core/test/Form.settledSnapshot.test.tsx- the sanitizeDataForNewSchema() drops the empty minItems placeholders of a scalar enum array, so any change in a form with a conditional empties the list #5451 sibling-schema-change trigger (8 variants), the A nesteddependenciesbranch switch never sanitizes, so a narrowed select keeps an invalid value #5250 flipped-conditional regression, and the declined-remove mispairing case - each reproduced red before the fix and green after.sanitizeDataForNewSchemaTest.tscover the same triggers at the util level.@rjsf/validator-ajv8shared suite 3580/3580,@rjsf/validator-ata1790/1790,@rjsf/validator-cfworker895/895,@rjsf/utilsmock-validator suite 1010/1010, and the full@rjsf/coresuite 4877/4877. The moved-row pairing test was split into the two rules the insert case involves - an insert that changes the array length keeps the moved row's value (the length-mismatch guard), a same-length reorder pairs it against a real previous element and the narrowed enum clears the value - both pinned with theisValidsequences the real validators produce. The port onto the new error-handling stack carries the outstanding proposal through the controlled commit, so a parent's accept still settles the snapshot.formState.ts, and I will rebase on request.Checklist