Convert ReactUpdaters to createRoot
Completes https://github.com/facebook/react/pull/28005
Haven't checked if the changed assertions makes sense. Should this test instead be considered a legacy test and gated @kassens?
Comparing: d77dd31a329df55a051800fc76668af8da8332b4...eb3f84b5be81550e62006181b2f3cf048ba681ce
Critical size changes
Includes critical production bundles, as well as any change greater than 2%:
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| oss-stable/react-dom/cjs/react-dom.production.js | = | 6.66 kB | 6.66 kB | = | 1.82 kB | 1.82 kB |
| oss-stable/react-dom/cjs/react-dom-client.production.js | = | 496.48 kB | 496.45 kB | = | 88.87 kB | 88.86 kB |
| oss-experimental/react-dom/cjs/react-dom.production.js | = | 6.67 kB | 6.67 kB | +0.05% | 1.83 kB | 1.83 kB |
| oss-experimental/react-dom/cjs/react-dom-client.production.js | = | 501.30 kB | 501.27 kB | = | 89.56 kB | 89.55 kB |
| facebook-www/ReactDOM-prod.classic.js | = | 593.97 kB | 593.94 kB | = | 104.48 kB | 104.48 kB |
| facebook-www/ReactDOM-prod.modern.js | = | 570.35 kB | 570.33 kB | = | 100.89 kB | 100.88 kB |
| test_utils/ReactAllWarnings.js | Deleted | 63.65 kB | 0.00 kB | Deleted | 15.90 kB | 0.00 kB |
Significant size changes
Includes any change greater than 0.2%:
Expand to show
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| test_utils/ReactAllWarnings.js | Deleted | 63.65 kB | 0.00 kB | Deleted | 15.90 kB | 0.00 kB |
Generated by :no_entry_sign: dangerJS against eb3f84b5be81550e62006181b2f3cf048ba681ce
@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?
We get the old expect(allSchedulerTypes).toEqual([[null], [Suspender], [Suspender]]); match once we start looking into pendingUpdatersLaneMap with
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 enableUpdaterTracking together. Maybe we're missing a movePendingFibersToMemoized call somewhere?
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-compiler-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 2, 2024 10:38pm |