Skip to content

Commit

Permalink
React Partial Sync
Browse files Browse the repository at this point in the history
Summary:
Base: 85d05b3a4d439c504ee43652d586ee253a01faf6

Author: Dan Abramov <dan.abramov@gmail.com>
Date:   Wed Sep 18 16:32:11 2019 +0100

    [Fresh] Always remount classes (#16823)

commit acfdc9760b4dc55d192b08de42b2c45e5e5bb531
Author: Ricky <rickhanlonii@gmail.com>
Date:   Wed Sep 18 15:31:00 2019 +0100

    [React Native] Fix for view config registrations (#16821)

commit dbe593d96c35b33fcc1f1bec70af86c24779392b
Author: Dominic Gannaway <trueadm@users.noreply.github.com>
Date:   Wed Sep 18 14:18:32 2019 +0200

    [react-core] Do not null fiber.sibling in detachFiber (#16820)

commit 30fa2f5ea3313b4b7932783d8ac71b5d59b8a8c7
Author: Dominic Gannaway <trueadm@users.noreply.github.com>
Date:   Tue Sep 17 17:30:22 2019 +0200

    [react-core] Clear more properties in detachFiber (#16807)

commit ea374e751b164ed029b35063b84c825305024a0a
Author: Dan Abramov <dan.abramov@gmail.com>
Date:   Wed Aug 28 16:55:56 2019 +0100

    Don't ignore dependencies for render phase update (#16574)

Reviewed By: gaearon

Differential Revision: D17456249

fbshipit-source-id: 87bad63fed4a571f65592ee904606828e3aa39af
  • Loading branch information
Alexander Kawrykow authored and facebook-github-bot committed Sep 18, 2019
1 parent 2c87cf5 commit ee5cb5a
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 184 deletions.
19 changes: 12 additions & 7 deletions Libraries/Renderer/implementations/ReactFabric-dev.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -6901,7 +6901,11 @@ function scheduleFibersWithFamiliesRecursively(
if (staleFamilies.has(family)) {
needsRemount = true;
} else if (updatedFamilies.has(family)) {
needsRender = true;
if (tag === ClassComponent) {
needsRemount = true;
} else {
needsRender = true;
}
}
}
}
Expand Down Expand Up @@ -17865,6 +17869,7 @@ function commitNestedUnmounts(root, renderPriorityLevel) {
}

function detachFiber(current$$1) {
var alternate = current$$1.alternate;
// Cut off the return pointers to disconnect it from the tree. Ideally, we
// should clear the child pointer of the parent alternate to let this
// get GC:ed but we don't know which for sure which parent is the current
Expand All @@ -17875,13 +17880,13 @@ function detachFiber(current$$1) {
current$$1.memoizedState = null;
current$$1.updateQueue = null;
current$$1.dependencies = null;
var alternate = current$$1.alternate;
current$$1.alternate = null;
current$$1.firstEffect = null;
current$$1.lastEffect = null;
current$$1.pendingProps = null;
current$$1.memoizedProps = null;
if (alternate !== null) {
alternate.return = null;
alternate.child = null;
alternate.memoizedState = null;
alternate.updateQueue = null;
alternate.dependencies = null;
detachFiber(alternate);
}
}

Expand Down
19 changes: 12 additions & 7 deletions Libraries/Renderer/implementations/ReactFabric-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6897,7 +6897,11 @@ function scheduleFibersWithFamiliesRecursively(
if (staleFamilies.has(family)) {
needsRemount = true;
} else if (updatedFamilies.has(family)) {
needsRender = true;
if (tag === ClassComponent) {
needsRemount = true;
} else {
needsRender = true;
}
}
}
}
Expand Down Expand Up @@ -17861,6 +17865,7 @@ function commitNestedUnmounts(root, renderPriorityLevel) {
}

function detachFiber(current$$1) {
var alternate = current$$1.alternate;
// Cut off the return pointers to disconnect it from the tree. Ideally, we
// should clear the child pointer of the parent alternate to let this
// get GC:ed but we don't know which for sure which parent is the current
Expand All @@ -17871,13 +17876,13 @@ function detachFiber(current$$1) {
current$$1.memoizedState = null;
current$$1.updateQueue = null;
current$$1.dependencies = null;
var alternate = current$$1.alternate;
current$$1.alternate = null;
current$$1.firstEffect = null;
current$$1.lastEffect = null;
current$$1.pendingProps = null;
current$$1.memoizedProps = null;
if (alternate !== null) {
alternate.return = null;
alternate.child = null;
alternate.memoizedState = null;
alternate.updateQueue = null;
alternate.dependencies = null;
detachFiber(alternate);
}
}

Expand Down
35 changes: 19 additions & 16 deletions Libraries/Renderer/implementations/ReactFabric-prod.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -5002,6 +5002,20 @@ function commitUnmount(current$$1$jscomp$0, renderPriorityLevel) {
createChildNodeSet(current$$1$jscomp$0.stateNode.containerInfo);
}
}
function detachFiber(current$$1) {
var alternate = current$$1.alternate;
current$$1.return = null;
current$$1.child = null;
current$$1.memoizedState = null;
current$$1.updateQueue = null;
current$$1.dependencies = null;
current$$1.alternate = null;
current$$1.firstEffect = null;
current$$1.lastEffect = null;
current$$1.pendingProps = null;
current$$1.memoizedProps = null;
null !== alternate && detachFiber(alternate);
}
function commitWork(current$$1, finishedWork) {
switch (finishedWork.tag) {
case 0:
Expand Down Expand Up @@ -6239,18 +6253,7 @@ function commitRootImpl(root, renderPriorityLevel) {
snapshot.sibling.return = snapshot.return;
snapshot = snapshot.sibling;
}
prevProps.return = null;
prevProps.child = null;
prevProps.memoizedState = null;
prevProps.updateQueue = null;
prevProps.dependencies = null;
var alternate = prevProps.alternate;
null !== alternate &&
((alternate.return = null),
(alternate.child = null),
(alternate.memoizedState = null),
(alternate.updateQueue = null),
(alternate.dependencies = null));
detachFiber(prevProps);
}
nextEffect = nextEffect.nextEffect;
}
Expand Down Expand Up @@ -6313,20 +6316,20 @@ function commitRootImpl(root, renderPriorityLevel) {
case 3:
var _updateQueue = current$$1$jscomp$0.updateQueue;
if (null !== _updateQueue) {
alternate = null;
current$$1 = null;
if (null !== current$$1$jscomp$0.child)
switch (current$$1$jscomp$0.child.tag) {
case 5:
alternate =
current$$1 =
current$$1$jscomp$0.child.stateNode.canonical;
break;
case 1:
alternate = current$$1$jscomp$0.child.stateNode;
current$$1 = current$$1$jscomp$0.child.stateNode;
}
commitUpdateQueue(
current$$1$jscomp$0,
_updateQueue,
alternate,
current$$1,
currentRef
);
}
Expand Down
35 changes: 19 additions & 16 deletions Libraries/Renderer/implementations/ReactFabric-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -5002,6 +5002,20 @@ function commitUnmount(current$$1$jscomp$0, renderPriorityLevel) {
createChildNodeSet(current$$1$jscomp$0.stateNode.containerInfo);
}
}
function detachFiber(current$$1) {
var alternate = current$$1.alternate;
current$$1.return = null;
current$$1.child = null;
current$$1.memoizedState = null;
current$$1.updateQueue = null;
current$$1.dependencies = null;
current$$1.alternate = null;
current$$1.firstEffect = null;
current$$1.lastEffect = null;
current$$1.pendingProps = null;
current$$1.memoizedProps = null;
null !== alternate && detachFiber(alternate);
}
function commitWork(current$$1, finishedWork) {
switch (finishedWork.tag) {
case 0:
Expand Down Expand Up @@ -6239,18 +6253,7 @@ function commitRootImpl(root, renderPriorityLevel) {
snapshot.sibling.return = snapshot.return;
snapshot = snapshot.sibling;
}
prevProps.return = null;
prevProps.child = null;
prevProps.memoizedState = null;
prevProps.updateQueue = null;
prevProps.dependencies = null;
var alternate = prevProps.alternate;
null !== alternate &&
((alternate.return = null),
(alternate.child = null),
(alternate.memoizedState = null),
(alternate.updateQueue = null),
(alternate.dependencies = null));
detachFiber(prevProps);
}
nextEffect = nextEffect.nextEffect;
}
Expand Down Expand Up @@ -6313,20 +6316,20 @@ function commitRootImpl(root, renderPriorityLevel) {
case 3:
var _updateQueue = current$$1$jscomp$0.updateQueue;
if (null !== _updateQueue) {
alternate = null;
current$$1 = null;
if (null !== current$$1$jscomp$0.child)
switch (current$$1$jscomp$0.child.tag) {
case 5:
alternate =
current$$1 =
current$$1$jscomp$0.child.stateNode.canonical;
break;
case 1:
alternate = current$$1$jscomp$0.child.stateNode;
current$$1 = current$$1$jscomp$0.child.stateNode;
}
commitUpdateQueue(
current$$1$jscomp$0,
_updateQueue,
alternate,
current$$1,
currentRef
);
}
Expand Down
45 changes: 24 additions & 21 deletions Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -5354,6 +5354,20 @@ function commitUnmount(current$$1$jscomp$0, renderPriorityLevel) {
createChildNodeSet(current$$1$jscomp$0.stateNode.containerInfo);
}
}
function detachFiber(current$$1) {
var alternate = current$$1.alternate;
current$$1.return = null;
current$$1.child = null;
current$$1.memoizedState = null;
current$$1.updateQueue = null;
current$$1.dependencies = null;
current$$1.alternate = null;
current$$1.firstEffect = null;
current$$1.lastEffect = null;
current$$1.pendingProps = null;
current$$1.memoizedProps = null;
null !== alternate && detachFiber(alternate);
}
function commitWork(current$$1, finishedWork) {
switch (finishedWork.tag) {
case 0:
Expand Down Expand Up @@ -6345,18 +6359,7 @@ function commitRootImpl(root, renderPriorityLevel) {
snapshot.sibling.return = snapshot.return;
snapshot = snapshot.sibling;
}
prevProps.return = null;
prevProps.child = null;
prevProps.memoizedState = null;
prevProps.updateQueue = null;
prevProps.dependencies = null;
var alternate = prevProps.alternate;
null !== alternate &&
((alternate.return = null),
(alternate.child = null),
(alternate.memoizedState = null),
(alternate.updateQueue = null),
(alternate.dependencies = null));
detachFiber(prevProps);
}
nextEffect = nextEffect.nextEffect;
}
Expand All @@ -6378,10 +6381,10 @@ function commitRootImpl(root, renderPriorityLevel) {
) {
var effectTag$jscomp$0 = nextEffect.effectTag;
if (effectTag$jscomp$0 & 36) {
current$$1 = effectTag;
prevProps = effectTag;
var current$$1$jscomp$1 = nextEffect.alternate;
currentRef = nextEffect;
alternate = current$$1$jscomp$0;
current$$1 = current$$1$jscomp$0;
switch (currentRef.tag) {
case 0:
case 11:
Expand Down Expand Up @@ -6413,26 +6416,26 @@ function commitRootImpl(root, renderPriorityLevel) {
currentRef,
updateQueue,
instance$jscomp$0,
alternate
current$$1
);
break;
case 3:
var _updateQueue = currentRef.updateQueue;
if (null !== _updateQueue) {
current$$1 = null;
prevProps = null;
if (null !== currentRef.child)
switch (currentRef.child.tag) {
case 5:
current$$1 = currentRef.child.stateNode.canonical;
prevProps = currentRef.child.stateNode.canonical;
break;
case 1:
current$$1 = currentRef.child.stateNode;
prevProps = currentRef.child.stateNode;
}
commitUpdateQueue(
currentRef,
_updateQueue,
current$$1,
alternate
prevProps,
current$$1
);
}
break;
Expand All @@ -6458,7 +6461,7 @@ function commitRootImpl(root, renderPriorityLevel) {
currentRef.treeBaseDuration,
currentRef.actualStartTime,
commitTime,
current$$1.memoizedInteractions
prevProps.memoizedInteractions
);
break;
case 13:
Expand Down
Loading

0 comments on commit ee5cb5a

Please sign in to comment.