Skip to content

Commit 445b0c7

Browse files
hramosfacebook-github-bot
authored andcommitted
React sync for revisions 1c2876d...7a3416f
Reviewed By: bvaughn Differential Revision: D7526137 fbshipit-source-id: 9f9db8a6b56cb4ae581a7b8d28079ec38de2180f
1 parent 9b9b6c8 commit 445b0c7

File tree

5 files changed

+322
-292
lines changed

5 files changed

+322
-292
lines changed

Libraries/Renderer/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1c2876d5b558b8591feb335d8d7204bc46f7da8a
1+
7a3416f27532ac25849dfbc505300d469b43bbcc

Libraries/Renderer/ReactFabric-dev.js

+16-13
Original file line numberDiff line numberDiff line change
@@ -4765,6 +4765,14 @@ var ReactStrictModeWarnings = {
47654765
var didWarnAboutDeprecatedLifecycles = new Set();
47664766
var didWarnAboutUnsafeLifecycles = new Set();
47674767

4768+
var setToSortedString = function(set) {
4769+
var array = [];
4770+
set.forEach(function(value) {
4771+
array.push(value);
4772+
});
4773+
return array.sort().join(", ");
4774+
};
4775+
47684776
ReactStrictModeWarnings.discardPendingWarnings = function() {
47694777
pendingComponentWillMountWarnings = [];
47704778
pendingComponentWillReceivePropsWarnings = [];
@@ -4790,9 +4798,7 @@ var ReactStrictModeWarnings = {
47904798

47914799
var formatted = lifecycle.replace("UNSAFE_", "");
47924800
var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
4793-
var sortedComponentNames = Array.from(componentNames)
4794-
.sort()
4795-
.join(", ");
4801+
var sortedComponentNames = setToSortedString(componentNames);
47964802

47974803
lifecyclesWarningMesages.push(
47984804
formatted +
@@ -4844,9 +4850,7 @@ var ReactStrictModeWarnings = {
48444850
didWarnAboutDeprecatedLifecycles.add(fiber.type);
48454851
});
48464852

4847-
var sortedNames = Array.from(uniqueNames)
4848-
.sort()
4849-
.join(", ");
4853+
var sortedNames = setToSortedString(uniqueNames);
48504854

48514855
lowPriorityWarning$1(
48524856
false,
@@ -4869,9 +4873,7 @@ var ReactStrictModeWarnings = {
48694873
didWarnAboutDeprecatedLifecycles.add(fiber.type);
48704874
});
48714875

4872-
var _sortedNames = Array.from(_uniqueNames)
4873-
.sort()
4874-
.join(", ");
4876+
var _sortedNames = setToSortedString(_uniqueNames);
48754877

48764878
lowPriorityWarning$1(
48774879
false,
@@ -4893,9 +4895,7 @@ var ReactStrictModeWarnings = {
48934895
didWarnAboutDeprecatedLifecycles.add(fiber.type);
48944896
});
48954897

4896-
var _sortedNames2 = Array.from(_uniqueNames2)
4897-
.sort()
4898-
.join(", ");
4898+
var _sortedNames2 = setToSortedString(_uniqueNames2);
48994899

49004900
lowPriorityWarning$1(
49014901
false,
@@ -6217,7 +6217,6 @@ var ReactFiberClassComponent = function(
62176217
if (
62186218
typeof instance.getSnapshotBeforeUpdate === "function" &&
62196219
typeof instance.componentDidUpdate !== "function" &&
6220-
typeof instance.componentDidUpdate !== "function" &&
62216220
!didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)
62226221
) {
62236222
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type);
@@ -9199,6 +9198,10 @@ var ReactFiberBeginWork = function(
91999198
changedBits,
92009199
renderExpirationTime
92019200
);
9201+
} else if (oldProps === newProps) {
9202+
// Skip over a memoized parent with a bitmask bailout even
9203+
// if we began working on it because of a deeper matching child.
9204+
return bailoutOnAlreadyFinishedWork(current, workInProgress);
92029205
}
92039206
// There is no bailout on `children` equality because we expect people
92049207
// to often pass a bound method as a child, but it may reference

Libraries/Renderer/ReactFabric-prod.js

+34-27
Original file line numberDiff line numberDiff line change
@@ -3656,33 +3656,40 @@ function ReactFiberBeginWork(
36563656
renderExpirationTime
36573657
);
36583658
case 12:
3659-
fn = workInProgress.type;
3660-
unmaskedContext = workInProgress.pendingProps;
3661-
var oldProps = workInProgress.memoizedProps;
3662-
props = fn._currentValue;
3663-
updateQueue = fn._changedBits;
3664-
if (
3665-
hasLegacyContextChanged() ||
3666-
0 !== updateQueue ||
3667-
oldProps !== unmaskedContext
3668-
) {
3669-
workInProgress.memoizedProps = unmaskedContext;
3670-
oldProps = unmaskedContext.unstable_observedBits;
3671-
if (void 0 === oldProps || null === oldProps) oldProps = 1073741823;
3672-
workInProgress.stateNode = oldProps;
3673-
0 !== (updateQueue & oldProps) &&
3674-
propagateContextChange(
3675-
workInProgress,
3676-
fn,
3677-
updateQueue,
3678-
renderExpirationTime
3679-
);
3680-
renderExpirationTime = unmaskedContext.children;
3681-
renderExpirationTime = renderExpirationTime(props);
3682-
reconcileChildren(current, workInProgress, renderExpirationTime);
3683-
current = workInProgress.child;
3684-
} else
3685-
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
3659+
a: {
3660+
fn = workInProgress.type;
3661+
unmaskedContext = workInProgress.pendingProps;
3662+
updateQueue = workInProgress.memoizedProps;
3663+
props = fn._currentValue;
3664+
var changedBits = fn._changedBits;
3665+
if (
3666+
hasLegacyContextChanged() ||
3667+
0 !== changedBits ||
3668+
updateQueue !== unmaskedContext
3669+
) {
3670+
workInProgress.memoizedProps = unmaskedContext;
3671+
var observedBits = unmaskedContext.unstable_observedBits;
3672+
if (void 0 === observedBits || null === observedBits)
3673+
observedBits = 1073741823;
3674+
workInProgress.stateNode = observedBits;
3675+
if (0 !== (changedBits & observedBits))
3676+
propagateContextChange(
3677+
workInProgress,
3678+
fn,
3679+
changedBits,
3680+
renderExpirationTime
3681+
);
3682+
else if (updateQueue === unmaskedContext) {
3683+
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
3684+
break a;
3685+
}
3686+
renderExpirationTime = unmaskedContext.children;
3687+
renderExpirationTime = renderExpirationTime(props);
3688+
reconcileChildren(current, workInProgress, renderExpirationTime);
3689+
current = workInProgress.child;
3690+
} else
3691+
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
3692+
}
36863693
return current;
36873694
default:
36883695
invariant(

0 commit comments

Comments
 (0)