Force Diffing algorithm to insert views Bottom Up (from children to root)

Summary:
This diff changes the way views are inserted by the diffing algorithm.
Previously the diffing algorithm inserted views top-down, now it insert views bottom-up (same order as previous version of RN).

Let say we need to create the following tree:
```

A --> B --> C
      |
      | --> D

```

Before, the diffing algorithm created the following list of instructions:
```
insert(A, B, 0)
insert(B, C, 0)
insert(B, D, 1)
```

After this diff, the insert instructions are going to be:

```
insert(B, C, 0)
insert(B, D, 1)
insert(A, B, 0)
```

Reviewed By: shergin

Differential Revision: D14817454

fbshipit-source-id: 7aac1a1e1784c53bca2747aee80a5bc8ee788e7a
This commit is contained in:
David Vacca
2019-04-10 16:10:38 -07:00
committed by Facebook Github Bot
parent 9202d4f772
commit 5850bd0785

View File

@@ -207,10 +207,10 @@ static void calculateShadowViewMutations(
mutations.end(), deleteMutations.begin(), deleteMutations.end());
mutations.insert(
mutations.end(), createMutations.begin(), createMutations.end());
mutations.insert(
mutations.end(), insertMutations.begin(), insertMutations.end());
mutations.insert(
mutations.end(), downwardMutations.begin(), downwardMutations.end());
mutations.insert(
mutations.end(), insertMutations.begin(), insertMutations.end());
}
ShadowViewMutationList calculateShadowViewMutations(