Skip to content

fix(react): avoid manipulate __pendingListUpdates unless SnapshotInstance tree is changed #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hzy
Copy link
Collaborator

@hzy hzy commented Jul 2, 2025

We make __pendingListUpdates.values nullable, and set it to null to indicate manipulating it should be avoided, in the following scenarios:

  1. setAttribute when hydrate
  2. setAttribute when ensureElements

Summary

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

changeset-bot bot commented Jul 2, 2025

🦋 Changeset detected

Latest commit: c334f16

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

This PR includes changesets to release 1 package
Name Type
@lynx-js/react 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

@hzy hzy requested review from Yradex and gaoachao July 2, 2025 07:38
Copy link

codspeed-hq bot commented Jul 2, 2025

CodSpeed Performance Report

Merging #1201 will not alter performance

Comparing hzy:p/hzy/list-perf-0 (c334f16) with main (ae3a1a8)

Summary

✅ 10 untouched benchmarks

Copy link

relativeci bot commented Jul 2, 2025

Web Explorer

#2551 Bundle Size — 259.52KiB (0%).

c334f16(current) vs ae3a1a8 main#2540(baseline)

Bundle metrics  Change 2 changes
                 Current
#2551
     Baseline
#2540
No change  Initial JS 140.94KiB 140.94KiB
No change  Initial CSS 31.82KiB 31.82KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 4 4
No change  Assets 4 4
Change  Modules 209(-0.48%) 210
No change  Duplicate Modules 17 17
Change  Duplicate Code 4.16%(+0.24%) 4.15%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#2551
     Baseline
#2540
No change  JS 227.7KiB 227.7KiB
No change  CSS 31.82KiB 31.82KiB

Bundle analysis reportBranch hzy:p/hzy/list-perf-0Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link

relativeci bot commented Jul 2, 2025

React Example

#2560 Bundle Size — 234.92KiB (+0.1%).

c334f16(current) vs ae3a1a8 main#2549(baseline)

Bundle metrics  Change 2 changes
                 Current
#2560
     Baseline
#2549
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 37.89% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 153 153
No change  Duplicate Modules 61 61
Change  Duplicate Code 45.86%(+0.02%) 45.85%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#2560
     Baseline
#2549
No change  IMG 145.76KiB 145.76KiB
Regression  Other 89.17KiB (+0.26%) 88.94KiB

Bundle analysis reportBranch hzy:p/hzy/list-perf-0Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link

codecov bot commented Jul 3, 2025

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!

@hzy hzy enabled auto-merge July 4, 2025 09:13
hzy and others added 3 commits July 5, 2025 03:50
…stance tree is changed

We make `__pendingListUpdates.values` nullable, and set it to null to indicate manipulating it should be avoided, in the following scenarios:

1. setAttribute when hydrate
2. setAttribute when ensureElements
Co-authored-by: BitterGourd <[email protected]>
Signed-off-by: Zhiyuan Hong <[email protected]>
@hzy hzy force-pushed the p/hzy/list-perf-0 branch from 921a8e0 to c334f16 Compare July 4, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants