Skip to content

Commit

Permalink
Copy Differ implementation to new file, feature-flag-gate new differ
Browse files Browse the repository at this point in the history
Summary:
Changes in following diffs will be gated by this feature flag.

The differ in the new file is copied from the current stable implementation and will not be modified until it's deleted.

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D27775698

fbshipit-source-id: 03d9518ffd2b1f25712386c56a38bd2b4d839fc2
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Apr 15, 2021
1 parent 5eba5c1 commit 39b8233
Show file tree
Hide file tree
Showing 17 changed files with 1,746 additions and 22 deletions.
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/mounting/Differentiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "Differentiator.h"
#include "DifferentiatorFlatteningClassic.h"

#include <better/map.h>
#include <better/small_vector.h>
Expand Down Expand Up @@ -1583,7 +1584,13 @@ ShadowViewNodePair::List sliceChildShadowNodeViewPairsLegacy(

ShadowViewMutation::List calculateShadowViewMutations(
ShadowNode const &oldRootShadowNode,
ShadowNode const &newRootShadowNode) {
ShadowNode const &newRootShadowNode,
bool useNewDiffer) {
if (!useNewDiffer) {
return DifferOld::calculateShadowViewMutations(
oldRootShadowNode, newRootShadowNode);
}

SystraceSection s("calculateShadowViewMutations");

// Root shadow nodes must be belong the same family.
Expand Down
3 changes: 2 additions & 1 deletion ReactCommon/react/renderer/mounting/Differentiator.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ enum class ReparentMode { Flatten, Unflatten };
*/
ShadowViewMutationList calculateShadowViewMutations(
ShadowNode const &oldRootShadowNode,
ShadowNode const &newRootShadowNode);
ShadowNode const &newRootShadowNode,
bool useNewDiffer);

/**
* Generates a list of `ShadowViewNodePair`s that represents a layer of a
Expand Down
Loading

0 comments on commit 39b8233

Please sign in to comment.