Skip to content

fix: list hydrate error#2434

Open
DwwWxx wants to merge 1 commit intolynx-family:mainfrom
DwwWxx:p/dingwang.wxx/main/fix_list_hydrate
Open

fix: list hydrate error#2434
DwwWxx wants to merge 1 commit intolynx-family:mainfrom
DwwWxx:p/dingwang.wxx/main/fix_list_hydrate

Conversation

@DwwWxx
Copy link
Copy Markdown
Collaborator

@DwwWxx DwwWxx commented Apr 7, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed list node hydration when using both serialized and background snapshot instances by ensuring item-key values are correctly derived during diff operations.
  • Tests

    • Added comprehensive test suite for dual-runtime list hydration scenarios, validating correct child ordering and patch generation.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@DwwWxx DwwWxx requested review from HuJean, Yradex and hzy as code owners April 7, 2026 10:18
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 837665e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@lynx-js/react Patch
@lynx-js/react-umd Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR fixes hydration of list nodes when both SerializedSnapshotInstance and BackgroundSnapshotInstance are involved. The fix improves item-key derivation in the diff logic by scanning values or __values properties and conditionally applying list-item key selection logic during array diffing operations.

Changes

Cohort / File(s) Summary
List Key Derivation
packages/react/runtime/src/renderToOpcodes/hydrate.ts
Introduced getItemKeyOf() function to derive item keys from __listItemPlatformInfo or by scanning values/__values. Renamed diffArrayLepus parameter from isListHasItemKey to isListItem and updated key selection logic to use the derived key when available. Removed UNREACHABLE_ITEM_KEY_NOT_FOUND constant.
Hydration Snapshot Logic
packages/react/runtime/src/snapshot/backgroundSnapshot.ts
Updated diffArrayLepus invocation in hydrate() to pass conditional boolean (type === DynamicPartType.ListChildren) based on dynamic part type instead of always passing false.
Tests & Release Notes
.changeset/flat-ties-spend.md, packages/react/runtime/__test__/hydrate.test.jsx
Added changeset documenting list hydration fix. Introduced formatSnapshotPatch() test helper for patch formatting. Added comprehensive test suite validating list node hydration with correct item-key ordering and diff patch generation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • HuJean
  • Yradex
  • hzy
  • gaoachao

Poem

🐰 A bunny hops through hydration's flow,
Item-keys now dance just so,
From values deep, we pluck the truth,
Lists align with proper proof! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: list hydrate error' is specific and directly related to the main change in the changeset, which fixes list node hydration issues when both SerializedSnapshotInstance and BackgroundSnapshotInstance are involved.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/chatty-fans-flash.md:
- Line 2: The changeset currently marks "@lynx-js/react" as "minor" which
signals a breaking change under the repo's 0.x versioning; update the changeset
entry for the package name "@lynx-js/react" to use "patch" instead of "minor" so
this bugfix is released as a non-breaking patch; save the changeset file after
replacing the token "minor" with "patch" and run the usual changeset
validation/CI to confirm.

In `@packages/react/runtime/src/snapshot/backgroundSnapshot.ts`:
- Line 128: BackgroundSnapshotInstance stores the list key as __item_key but
diffArrayLepus reads node.itemKey, so the fallback key path is never used; fix
by exposing the internal key via a public getter or property named itemKey on
BackgroundSnapshotInstance (or set itemKey from __item_key during construction)
so diffArrayLepus can access it; update references in BackgroundSnapshotInstance
(the __item_key field) and ensure diffArrayLepus continues to read node.itemKey
so key-based list diffing works for background list nodes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8f700964-138c-4306-b14e-0540aec79d45

📥 Commits

Reviewing files that changed from the base of the PR and between 5f2cea3 and 656698a.

📒 Files selected for processing (5)
  • .changeset/chatty-fans-flash.md
  • packages/react/runtime/src/hydrate.ts
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts
  • packages/react/runtime/src/snapshot/snapshot.ts
  • packages/react/runtime/src/snapshot/types.ts

Comment thread .changeset/chatty-fans-flash.md Outdated
Comment thread packages/react/runtime/src/snapshot/backgroundSnapshot.ts Outdated
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 7, 2026

Merging this PR will improve performance by 36.76%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 80 untouched benchmarks
⏩ 21 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
002-hello-reactLynx-destroyBackground 929.8 µs 679.9 µs +36.76%

Comparing DwwWxx:p/dingwang.wxx/main/fix_list_hydrate (cd3909e) with main (b1ad1b9)

Open in CodSpeed

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 7, 2026

React External

#365 Bundle Size — 592.3KiB (+0.09%).

cd3909e(current) vs b1ad1b9 main#353(baseline)

Bundle metrics  Change 1 change
                 Current
#365
     Baseline
#353
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 31.07% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#365
     Baseline
#353
Regression  Other 592.3KiB (+0.09%) 591.76KiB

Bundle analysis reportBranch DwwWxx:p/dingwang.wxx/main/fix_l...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 7, 2026

React MTF Example

#380 Bundle Size — 206.52KiB (+0.19%).

cd3909e(current) vs b1ad1b9 main#368(baseline)

Bundle metrics  Change 2 changes
                 Current
#380
     Baseline
#368
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 46.04% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 173 173
No change  Duplicate Modules 67 67
Change  Duplicate Code 45.8%(+0.02%) 45.79%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#380
     Baseline
#368
No change  IMG 111.23KiB 111.23KiB
Regression  Other 95.29KiB (+0.42%) 94.89KiB

Bundle analysis reportBranch DwwWxx:p/dingwang.wxx/main/fix_l...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 7, 2026

Web Explorer

#8821 Bundle Size — 748.66KiB (0%).

cd3909e(current) vs b1ad1b9 main#8809(baseline)

Bundle metrics  no changes
                 Current
#8821
     Baseline
#8809
No change  Initial JS 44.27KiB 44.27KiB
No change  Initial CSS 2.16KiB 2.16KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 10 10
No change  Modules 149 149
No change  Duplicate Modules 11 11
No change  Duplicate Code 35.02% 35.02%
No change  Packages 3 3
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8821
     Baseline
#8809
No change  Other 401.63KiB 401.63KiB
No change  JS 344.87KiB 344.87KiB
No change  CSS 2.16KiB 2.16KiB

Bundle analysis reportBranch DwwWxx:p/dingwang.wxx/main/fix_l...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 7, 2026

React Example

#7247 Bundle Size — 237.22KiB (+0.17%).

cd3909e(current) vs b1ad1b9 main#7235(baseline)

Bundle metrics  Change 1 change
                 Current
#7247
     Baseline
#7235
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 38.45% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 179 179
No change  Duplicate Modules 70 70
No change  Duplicate Code 46.13% 46.13%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#7247
     Baseline
#7235
No change  IMG 145.76KiB 145.76KiB
Regression  Other 91.47KiB (+0.44%) 91.07KiB

Bundle analysis reportBranch DwwWxx:p/dingwang.wxx/main/fix_l...Project dashboard


Generated by RelativeCIDocumentationReport issue

@DwwWxx DwwWxx force-pushed the p/dingwang.wxx/main/fix_list_hydrate branch from 656698a to 799cf6d Compare April 10, 2026 10:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/react/runtime/__test__/hydrate.test.jsx`:
- Line 34: The test calls __pendingListUpdates.clear() with no id which doesn't
remove per-id entries and leaves stale state; update the cleanup to iterate
existing ids and clear each explicitly (e.g., for each id in
__pendingListUpdates.keys() call __pendingListUpdates.clear(id)) or otherwise
reinitialize the global container so all pending list update entries are
removed; reference the __pendingListUpdates.clear method and the
__pendingListUpdates keys to implement the fix.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45ddcce9-f95f-4934-ba0a-eec0aec2cb8f

📥 Commits

Reviewing files that changed from the base of the PR and between 656698a and 799cf6d.

📒 Files selected for processing (4)
  • .changeset/flat-ties-spend.md
  • packages/react/runtime/__test__/hydrate.test.jsx
  • packages/react/runtime/src/hydrate.ts
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/flat-ties-spend.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts
  • packages/react/runtime/src/hydrate.ts

Comment thread packages/react/runtime/__test__/hydrate.test.jsx Outdated
@DwwWxx DwwWxx force-pushed the p/dingwang.wxx/main/fix_list_hydrate branch 2 times, most recently from bec67dd to 7bce702 Compare April 10, 2026 10:34
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/react/runtime/__test__/hydrate.test.jsx (2)

15-31: Render undefined explicitly in the patch formatter.

JSON.stringify(undefined) becomes an empty field after join(', '), so snapshots like InsertBefore(-1, 2, ) are harder to reason about and can hide formatter bugs.

Suggested tweak
-    out.push(`${meta.name}(${args.map(a => JSON.stringify(a)).join(', ')})`);
+    out.push(
+      `${meta.name}(${args.map(a => a === undefined ? 'undefined' : JSON.stringify(a)).join(', ')})`,
+    );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react/runtime/__test__/hydrate.test.jsx` around lines 15 - 31, The
formatter formatSnapshotPatch produces empty fields for undefined because
JSON.stringify(undefined) yields undefined and becomes an empty slot when
joined; update the argument serialization in formatSnapshotPatch (the map
callback that currently uses JSON.stringify(a)) to explicitly render undefined
(e.g., return the string "undefined" when a === undefined) and otherwise use
JSON.stringify(a), so InsertBefore(-1, 2, ) becomes InsertBefore(-1, 2,
undefined); keep this change localized to formatSnapshotPatch and still use
SnapshotOperationParams to determine arg counts.

407-439: Use getItemKeyOf() here instead of a second scanner.

This PR’s regression fix lives in packages/react/runtime/src/hydrate.ts; duplicating the scan in the test means the suite can stay green even if getItemKeyOf() drifts. Import the helper and assert getItemKeyOf(node, true) / getItemKeyOf(node, false) directly so the new production path is actually covered.

Suggested direction
-import { SnapshotOperationParams } from '../src/lifecycle/patch/snapshotPatch';
+import { SnapshotOperationParams } from '../src/lifecycle/patch/snapshotPatch';
+import { getItemKeyOf } from '../src/hydrate';
...
-    const getItemKeyFromValues = (node, values) => {
-      for (let index = 0; index < values?.length; index++) {
-        const value = values[index];
-        if (value && typeof value === 'object' && !Array.isArray(value)) {
-          if ('item-key' in value) {
-            return value['item-key'] ?? undefined;
-          }
-        }
-      }
-      return undefined;
-    };
     mtsList.childNodes.forEach((node, index) => {
-      const itemKey = getItemKeyFromValues(node, node.__values);
+      const itemKey = getItemKeyOf(node, true);
       expect(itemKey).toBeTypeOf('string');
       expect(itemKey).toBe(`mts-list-item-${index}`);
     });
...
     btsList.childNodes.forEach((node, index) => {
-      const itemKey = getItemKeyFromValues(node, node.__values);
+      const itemKey = getItemKeyOf(node, false);
       expect(itemKey).toBeTypeOf('string');
       expect(itemKey).toBe(`bts-list-item-${index}`);
     });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react/runtime/__test__/hydrate.test.jsx` around lines 407 - 439,
Replace the local scanner getItemKeyFromValues with the production helper
getItemKeyOf: import getItemKeyOf and remove the duplicated function, then in
the mtsList loop call getItemKeyOf(node, true) and in the btsList loop call
getItemKeyOf(node, false) and assert the returned string equals the expected
`*-list-item-${index}`; this ensures the test exercises the actual getItemKeyOf
implementation rather than a second scanner.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/react/runtime/src/hydrate.ts`:
- Around line 82-88: The bucket key for keyless list items collapses everything
to UNREACHABLE_ITEM_KEY_NOT_FOUND causing lost per-type buckets; update the key
construction used around getItemKeyOf (used when building beforeMap/after
buckets in hydrate.ts and consumed by diffArrayLepus) so that when getItemKeyOf
returns null/undefined you fallback to a composite that includes node.type
(e.g., combine UNREACHABLE_ITEM_KEY_NOT_FOUND with node.type) instead of using
UNREACHABLE_ITEM_KEY_NOT_FOUND alone, preserving per-type grouping for unkeyed
items.

---

Nitpick comments:
In `@packages/react/runtime/__test__/hydrate.test.jsx`:
- Around line 15-31: The formatter formatSnapshotPatch produces empty fields for
undefined because JSON.stringify(undefined) yields undefined and becomes an
empty slot when joined; update the argument serialization in formatSnapshotPatch
(the map callback that currently uses JSON.stringify(a)) to explicitly render
undefined (e.g., return the string "undefined" when a === undefined) and
otherwise use JSON.stringify(a), so InsertBefore(-1, 2, ) becomes
InsertBefore(-1, 2, undefined); keep this change localized to
formatSnapshotPatch and still use SnapshotOperationParams to determine arg
counts.
- Around line 407-439: Replace the local scanner getItemKeyFromValues with the
production helper getItemKeyOf: import getItemKeyOf and remove the duplicated
function, then in the mtsList loop call getItemKeyOf(node, true) and in the
btsList loop call getItemKeyOf(node, false) and assert the returned string
equals the expected `*-list-item-${index}`; this ensures the test exercises the
actual getItemKeyOf implementation rather than a second scanner.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8f8ed800-1be1-497b-ba72-38ecb10babc7

📥 Commits

Reviewing files that changed from the base of the PR and between 799cf6d and 7bce702.

📒 Files selected for processing (4)
  • .changeset/flat-ties-spend.md
  • packages/react/runtime/__test__/hydrate.test.jsx
  • packages/react/runtime/src/hydrate.ts
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/flat-ties-spend.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts

Comment thread packages/react/runtime/src/hydrate.ts Outdated
@DwwWxx DwwWxx force-pushed the p/dingwang.wxx/main/fix_list_hydrate branch from 7bce702 to 3804e61 Compare April 13, 2026 08:18
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/react/runtime/src/hydrate.ts (1)

46-50: Empty string item-key would be coerced to undefined.

On line 49, if obj['item-key'] is an empty string (""), the expression "" as string ?? undefined still returns "" (since ?? only checks for null/undefined), but the outer condition if (value && ...) on line 46 already guards against this.

However, the as string ?? undefined at the end means that if obj['item-key'] is explicitly set to null, it returns undefined. This is likely the intended behavior, but worth verifying that null item-keys should be treated as absent.

Minor: Consider simplifying the return statement
       if ('item-key' in obj) {
-        return obj['item-key'] as string ?? undefined;
+        const key = obj['item-key'];
+        return typeof key === 'string' ? key : undefined;
       }

This makes the type checking more explicit and handles cases where item-key might be a non-string value.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react/runtime/src/hydrate.ts` around lines 46 - 50, The code
currently returns obj['item-key'] with a null-coalescing fallback which can be
unclear; explicitly check the type and truthiness of obj['item-key'] so only
actual strings are returned and null/non-string values become undefined. Update
the branch that reads obj['item-key'] (where value is checked as an object) to:
if typeof obj['item-key'] === 'string' then return the string or undefined when
empty/falsy as desired, otherwise return undefined; this makes intent explicit
and avoids treating non-string or null values as valid keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/react/runtime/src/hydrate.ts`:
- Around line 46-50: The code currently returns obj['item-key'] with a
null-coalescing fallback which can be unclear; explicitly check the type and
truthiness of obj['item-key'] so only actual strings are returned and
null/non-string values become undefined. Update the branch that reads
obj['item-key'] (where value is checked as an object) to: if typeof
obj['item-key'] === 'string' then return the string or undefined when
empty/falsy as desired, otherwise return undefined; this makes intent explicit
and avoids treating non-string or null values as valid keys.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dee80c05-2744-4212-b6e3-b4517ecdc88e

📥 Commits

Reviewing files that changed from the base of the PR and between 7bce702 and 3804e61.

📒 Files selected for processing (4)
  • .changeset/flat-ties-spend.md
  • packages/react/runtime/__test__/hydrate.test.jsx
  • packages/react/runtime/src/hydrate.ts
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/flat-ties-spend.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts

@DwwWxx DwwWxx force-pushed the p/dingwang.wxx/main/fix_list_hydrate branch from 3804e61 to 2976fc5 Compare April 13, 2026 08:33
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/react/runtime/__test__/hydrate.test.jsx`:
- Around line 440-441: Rename the misspelled variable "patchs" to "patches"
wherever it's declared and used in this test (e.g., the const assignment const
patchs = hydrate(JSON.parse(JSON.stringify(mtsList)), btsList); and the
expect(patchs)... assertion), and update the corresponding assertion/usage at
the other mentioned location (line referenced as 496 in the comment) to use
"patches" as well so all references match.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f16aba44-bf96-4439-b320-c954630459a2

📥 Commits

Reviewing files that changed from the base of the PR and between 3804e61 and 2976fc5.

📒 Files selected for processing (4)
  • .changeset/flat-ties-spend.md
  • packages/react/runtime/__test__/hydrate.test.jsx
  • packages/react/runtime/src/renderToOpcodes/hydrate.ts
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/flat-ties-spend.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/runtime/src/snapshot/backgroundSnapshot.ts

Comment thread packages/react/runtime/__test__/hydrate.test.jsx Outdated
@DwwWxx DwwWxx force-pushed the p/dingwang.wxx/main/fix_list_hydrate branch 2 times, most recently from af6e6e6 to cd3909e Compare April 13, 2026 16:28
@DwwWxx DwwWxx force-pushed the p/dingwang.wxx/main/fix_list_hydrate branch from cd3909e to 837665e Compare April 17, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant