Skip to content

Commit 38b20a3

Browse files
committed
Fix suspense replaying forward refs (#26535)
This reverts commit adac7b1. DiffTrain build for [2f18eb0](2f18eb0)
1 parent 7d661b0 commit 38b20a3

18 files changed

+967
-791
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
66dc44e7760d0f75b6845b7fa71f2f1e4e5f20d3
1+
2f18eb0ac63fdcaed3f1d4e3c375a559a552c09a

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-1ad32b8c";
30+
var ReactVersion = "18.3.0-www-modern-b6a03dc1";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-00b5e5d4";
72+
var ReactVersion = "18.3.0-www-classic-ccedb28a";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -13732,18 +13732,12 @@ function replayFunctionComponent(
1373213732
workInProgress,
1373313733
nextProps,
1373413734
Component,
13735+
secondArg,
1373513736
renderLanes
1373613737
) {
1373713738
// This function is used to replay a component that previously suspended,
1373813739
// after its data resolves. It's a simplified version of
1373913740
// updateFunctionComponent that reuses the hooks from the previous attempt.
13740-
var context;
13741-
13742-
{
13743-
var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
13744-
context = getMaskedContext(workInProgress, unmaskedContext);
13745-
}
13746-
1374713741
prepareToReadContext(workInProgress, renderLanes);
1374813742

1374913743
if (enableSchedulingProfiler) {
@@ -13755,7 +13749,7 @@ function replayFunctionComponent(
1375513749
workInProgress,
1375613750
Component,
1375713751
nextProps,
13758-
context
13752+
secondArg
1375913753
);
1376013754

1376113755
if (enableSchedulingProfiler) {
@@ -25400,8 +25394,8 @@ function replaySuspendedUnitOfWork(unitOfWork) {
2540025394
}
2540125395
// eslint-disable-next-line no-fallthrough
2540225396

25403-
case FunctionComponent:
25404-
case ForwardRef: {
25397+
case SimpleMemoComponent:
25398+
case FunctionComponent: {
2540525399
// Resolve `defaultProps`. This logic is copied from `beginWork`.
2540625400
// TODO: Consider moving this switch statement into that module. Also,
2540725401
// could maybe use this as an opportunity to say `use` doesn't work with
@@ -25412,24 +25406,43 @@ function replaySuspendedUnitOfWork(unitOfWork) {
2541225406
unitOfWork.elementType === Component
2541325407
? unresolvedProps
2541425408
: resolveDefaultProps(Component, unresolvedProps);
25409+
var context;
25410+
25411+
{
25412+
var unmaskedContext = getUnmaskedContext(unitOfWork, Component, true);
25413+
context = getMaskedContext(unitOfWork, unmaskedContext);
25414+
}
25415+
2541525416
next = replayFunctionComponent(
2541625417
current,
2541725418
unitOfWork,
2541825419
resolvedProps,
2541925420
Component,
25421+
context,
2542025422
workInProgressRootRenderLanes
2542125423
);
2542225424
break;
2542325425
}
2542425426

25425-
case SimpleMemoComponent: {
25426-
var _Component = unitOfWork.type;
25427-
var nextProps = unitOfWork.pendingProps;
25427+
case ForwardRef: {
25428+
// Resolve `defaultProps`. This logic is copied from `beginWork`.
25429+
// TODO: Consider moving this switch statement into that module. Also,
25430+
// could maybe use this as an opportunity to say `use` doesn't work with
25431+
// `defaultProps` :)
25432+
var _Component = unitOfWork.type.render;
25433+
var _unresolvedProps = unitOfWork.pendingProps;
25434+
25435+
var _resolvedProps =
25436+
unitOfWork.elementType === _Component
25437+
? _unresolvedProps
25438+
: resolveDefaultProps(_Component, _unresolvedProps);
25439+
2542825440
next = replayFunctionComponent(
2542925441
current,
2543025442
unitOfWork,
25431-
nextProps,
25443+
_resolvedProps,
2543225444
_Component,
25445+
unitOfWork.ref,
2543325446
workInProgressRootRenderLanes
2543425447
);
2543525448
break;

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-41062e02";
72+
var ReactVersion = "18.3.0-www-modern-89053274";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -13449,13 +13449,12 @@ function replayFunctionComponent(
1344913449
workInProgress,
1345013450
nextProps,
1345113451
Component,
13452+
secondArg,
1345213453
renderLanes
1345313454
) {
1345413455
// This function is used to replay a component that previously suspended,
1345513456
// after its data resolves. It's a simplified version of
1345613457
// updateFunctionComponent that reuses the hooks from the previous attempt.
13457-
var context;
13458-
1345913458
prepareToReadContext(workInProgress, renderLanes);
1346013459

1346113460
if (enableSchedulingProfiler) {
@@ -13467,7 +13466,7 @@ function replayFunctionComponent(
1346713466
workInProgress,
1346813467
Component,
1346913468
nextProps,
13470-
context
13469+
secondArg
1347113470
);
1347213471

1347313472
if (enableSchedulingProfiler) {
@@ -25060,8 +25059,8 @@ function replaySuspendedUnitOfWork(unitOfWork) {
2506025059
}
2506125060
// eslint-disable-next-line no-fallthrough
2506225061

25063-
case FunctionComponent:
25064-
case ForwardRef: {
25062+
case SimpleMemoComponent:
25063+
case FunctionComponent: {
2506525064
// Resolve `defaultProps`. This logic is copied from `beginWork`.
2506625065
// TODO: Consider moving this switch statement into that module. Also,
2506725066
// could maybe use this as an opportunity to say `use` doesn't work with
@@ -25072,24 +25071,38 @@ function replaySuspendedUnitOfWork(unitOfWork) {
2507225071
unitOfWork.elementType === Component
2507325072
? unresolvedProps
2507425073
: resolveDefaultProps(Component, unresolvedProps);
25074+
var context;
25075+
2507525076
next = replayFunctionComponent(
2507625077
current,
2507725078
unitOfWork,
2507825079
resolvedProps,
2507925080
Component,
25081+
context,
2508025082
workInProgressRootRenderLanes
2508125083
);
2508225084
break;
2508325085
}
2508425086

25085-
case SimpleMemoComponent: {
25086-
var _Component = unitOfWork.type;
25087-
var nextProps = unitOfWork.pendingProps;
25087+
case ForwardRef: {
25088+
// Resolve `defaultProps`. This logic is copied from `beginWork`.
25089+
// TODO: Consider moving this switch statement into that module. Also,
25090+
// could maybe use this as an opportunity to say `use` doesn't work with
25091+
// `defaultProps` :)
25092+
var _Component = unitOfWork.type.render;
25093+
var _unresolvedProps = unitOfWork.pendingProps;
25094+
25095+
var _resolvedProps =
25096+
unitOfWork.elementType === _Component
25097+
? _unresolvedProps
25098+
: resolveDefaultProps(_Component, _unresolvedProps);
25099+
2508825100
next = replayFunctionComponent(
2508925101
current,
2509025102
unitOfWork,
25091-
nextProps,
25103+
_resolvedProps,
2509225104
_Component,
25105+
unitOfWork.ref,
2509325106
workInProgressRootRenderLanes
2509425107
);
2509525108
break;

compiled/facebook-www/ReactART-prod.classic.js

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3887,18 +3887,15 @@ function replayFunctionComponent(
38873887
workInProgress,
38883888
nextProps,
38893889
Component,
3890+
secondArg,
38903891
renderLanes
38913892
) {
3892-
var context = isContextProvider(Component)
3893-
? previousContext
3894-
: contextStackCursor$1.current;
3895-
context = getMaskedContext(workInProgress, context);
38963893
prepareToReadContext(workInProgress, renderLanes);
38973894
nextProps = renderWithHooksAgain(
38983895
workInProgress,
38993896
Component,
39003897
nextProps,
3901-
context
3898+
secondArg
39023899
);
39033900
finishRenderingHooks(current);
39043901
if (null !== current && !didReceiveUpdate)
@@ -8549,28 +8546,40 @@ function replaySuspendedUnitOfWork(unitOfWork) {
85498546
switch (unitOfWork.tag) {
85508547
case 2:
85518548
unitOfWork.tag = 0;
8549+
case 15:
85528550
case 0:
8553-
case 11:
85548551
var Component = unitOfWork.type,
85558552
unresolvedProps = unitOfWork.pendingProps;
85568553
unresolvedProps =
85578554
unitOfWork.elementType === Component
85588555
? unresolvedProps
85598556
: resolveDefaultProps(Component, unresolvedProps);
8557+
var context = isContextProvider(Component)
8558+
? previousContext
8559+
: contextStackCursor$1.current;
8560+
context = getMaskedContext(unitOfWork, context);
85608561
current = replayFunctionComponent(
85618562
current,
85628563
unitOfWork,
85638564
unresolvedProps,
85648565
Component,
8566+
context,
85658567
workInProgressRootRenderLanes
85668568
);
85678569
break;
8568-
case 15:
8570+
case 11:
8571+
Component = unitOfWork.type.render;
8572+
unresolvedProps = unitOfWork.pendingProps;
8573+
unresolvedProps =
8574+
unitOfWork.elementType === Component
8575+
? unresolvedProps
8576+
: resolveDefaultProps(Component, unresolvedProps);
85698577
current = replayFunctionComponent(
85708578
current,
85718579
unitOfWork,
8572-
unitOfWork.pendingProps,
8573-
unitOfWork.type,
8580+
unresolvedProps,
8581+
Component,
8582+
unitOfWork.ref,
85748583
workInProgressRootRenderLanes
85758584
);
85768585
break;
@@ -10053,19 +10062,19 @@ var slice = Array.prototype.slice,
1005310062
};
1005410063
return Text;
1005510064
})(React.Component),
10056-
devToolsConfig$jscomp$inline_1168 = {
10065+
devToolsConfig$jscomp$inline_1170 = {
1005710066
findFiberByHostInstance: function () {
1005810067
return null;
1005910068
},
1006010069
bundleType: 0,
10061-
version: "18.3.0-www-classic-d70758c5",
10070+
version: "18.3.0-www-classic-3b2e6228",
1006210071
rendererPackageName: "react-art"
1006310072
};
10064-
var internals$jscomp$inline_1342 = {
10065-
bundleType: devToolsConfig$jscomp$inline_1168.bundleType,
10066-
version: devToolsConfig$jscomp$inline_1168.version,
10067-
rendererPackageName: devToolsConfig$jscomp$inline_1168.rendererPackageName,
10068-
rendererConfig: devToolsConfig$jscomp$inline_1168.rendererConfig,
10073+
var internals$jscomp$inline_1344 = {
10074+
bundleType: devToolsConfig$jscomp$inline_1170.bundleType,
10075+
version: devToolsConfig$jscomp$inline_1170.version,
10076+
rendererPackageName: devToolsConfig$jscomp$inline_1170.rendererPackageName,
10077+
rendererConfig: devToolsConfig$jscomp$inline_1170.rendererConfig,
1006910078
overrideHookState: null,
1007010079
overrideHookStateDeletePath: null,
1007110080
overrideHookStateRenamePath: null,
@@ -10082,26 +10091,26 @@ var internals$jscomp$inline_1342 = {
1008210091
return null === fiber ? null : fiber.stateNode;
1008310092
},
1008410093
findFiberByHostInstance:
10085-
devToolsConfig$jscomp$inline_1168.findFiberByHostInstance ||
10094+
devToolsConfig$jscomp$inline_1170.findFiberByHostInstance ||
1008610095
emptyFindFiberByHostInstance,
1008710096
findHostInstancesForRefresh: null,
1008810097
scheduleRefresh: null,
1008910098
scheduleRoot: null,
1009010099
setRefreshHandler: null,
1009110100
getCurrentFiber: null,
10092-
reconcilerVersion: "18.3.0-www-classic-d70758c5"
10101+
reconcilerVersion: "18.3.0-www-classic-3b2e6228"
1009310102
};
1009410103
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
10095-
var hook$jscomp$inline_1343 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
10104+
var hook$jscomp$inline_1345 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1009610105
if (
10097-
!hook$jscomp$inline_1343.isDisabled &&
10098-
hook$jscomp$inline_1343.supportsFiber
10106+
!hook$jscomp$inline_1345.isDisabled &&
10107+
hook$jscomp$inline_1345.supportsFiber
1009910108
)
1010010109
try {
10101-
(rendererID = hook$jscomp$inline_1343.inject(
10102-
internals$jscomp$inline_1342
10110+
(rendererID = hook$jscomp$inline_1345.inject(
10111+
internals$jscomp$inline_1344
1010310112
)),
10104-
(injectedHook = hook$jscomp$inline_1343);
10113+
(injectedHook = hook$jscomp$inline_1345);
1010510114
} catch (err) {}
1010610115
}
1010710116
var Path = Mode$1.Path;

0 commit comments

Comments
 (0)