GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — DevTools: Fix "unknown" updater in profiler when a component unsuspends by eps1lon · Pull Request #28330 · react/react Conversation
|
|
Comparing: d77dd31...eb3f84b Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@acdlite @kassens I was going to approve this test but noticed the assertions had to change with the modern root. Not really sure what this test is for but it looks like @kassens you omitted it from the original PR that converts to createRoot. Do either of you know if this needs to be maintained as a legacy mode test? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We get the old diff --git a/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js b/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js index d518159ce8..b45f7e6259 100644 --- a/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js +++ b/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js @@ -45,10 +45,19 @@ describe('updaters', () => { } const schedulerTags = []; const schedulerTypes = []; - fiberRoot.memoizedUpdaters.forEach(fiber => { - schedulerTags.push(fiber.tag); - schedulerTypes.push(fiber.elementType); - }); + if (fiberRoot.memoizedUpdaters.size > 0) { + fiberRoot.memoizedUpdaters.forEach(fiber => { + schedulerTags.push(fiber.tag); + schedulerTypes.push(fiber.elementType); + }); + } else { + fiberRoot.pendingUpdatersLaneMap.forEach(pendingUpdaters => { + pendingUpdaters.forEach(fiber => { + schedulerTags.push(fiber.tag); + schedulerTypes.push(fiber.elementType); + }); + }); + } allSchedulerTags.push(schedulerTags); allSchedulerTypes.push(schedulerTypes); }), I'm just now piecing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ae87aca to
16ee439
Compare
There was an error while loading. Please reload this page.
16ee439 to
dcc5ca6
Compare
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // TODO: When would we ever ping lanes that we aren't suspended on? | ||
| root.pingedLanes |= pingedLanes; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do we need to investigate this further? Just transferring the updaters from root.pingedLanes to updateLane isn't enough. For some reason we're pinging when root.suspendedLanes & pingedLanes === NoLanes. Which seems odd intuitively but maybe the bug is root.suspendedLanes having no overlap with pingedLanes?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
When would we ever ping lanes that we aren't suspended on?
Maybe if we suspend on two Wakeables A and B, A gets pinged earlier, we unsuspend completely i.e. don't suspend on B again (e.g. conditional use?) and then we wouldn't want to retry when B gets pinged?
Grasping for straws here since all tests still pass with this change.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // This test should be convertable to createRoot but the allScheduledTypes assertions are no longer the same | ||
| // So I'm leaving it in legacy mode for now and just disabling if legacy mode is turned off | ||
| // @gate !disableLegacyMode | ||
| it('should cover suspense pings', async () => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The original issue in the test was that the updater was on the Default lane, the updater got pinged, and then we said we should render on a Retry lane (markRootPinged). This left the updater dangling in pending updaters since we only move the pending updaters to memoized on the lane we actually render (Retry lane).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // TODO: Is it ever ok to have dangling pending updaters or is this always a bug? | ||
| // const lane = 1 << index; | ||
| // throw new Error( | ||
| // `Lane ${lane} has pending updaters. Either you didn't assert on all updates in your test or React is leaking updaters.`, | ||
| // ); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Tests that currently would fail this: https://app.circleci.com/pipelines/github/facebook/react/54155/workflows/17c8ec84-c64b-4fc1-bde6-6fcb7532513e/jobs/892710
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // idle updates until after all the regular updates have finished; there's no | ||
| // way it could unblock a transition. | ||
| if (updateLane !== IdleLane) { | ||
| movePendingUpdatersToLane(root, root.pingedLanes, updateLane); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to transfer updaters from root.suspendedLanes but I haven't really thought about this for more than a sec.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6a2add4 to
ffd8102
Compare
Fixes
````
SyntaxError: ~/react/packages/react-reconciler/src/ReactFiberLane.js: Compiling let/const in this block would add a closure (throwIfClosureRequired).
614 | if (updateLane !== IdleLane) {
615 | if (enableUpdaterTracking) {
> 616 | if (isDevToolsPresent) {
| ^
617 | // transfer pending updaters from pingedLanes to updateLane
618 | const pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;
619 | const updaters = pendingUpdatersLaneMap[laneToIndex(updateLane)];
```
ffd8102 to
eb3f84b
Compare
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) Reviewed the lane changes in Observations:
No security, correctness, or performance concerns identified. Summary: Targeted lane scheduling adjustments. Changes follow existing patterns correctly. Assessment: approve |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
eb3f84b5
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
devtools: "What caused this update?" when a lazy component resolves
There was an error while loading. Please reload this page.