Skip to content

Commit

Permalink
Add firstEffect, et al fields to new fork
Browse files Browse the repository at this point in the history
We need to bisect the changes to the recent commit phase refactor. To
do this, we'll need to add back the effect list temporarily.

This only adds them to the Fiber type so that the memory is the same
as the old fork.
  • Loading branch information
acdlite committed Nov 13, 2020
1 parent 2ae3590 commit ccf2440
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,7 @@ module.exports = {
'react-internal/no-cross-fork-types': [
ERROR,
{
old: [
'firstEffect',
'nextEffect',
// Disabled because it's also used by the Hook type.
// 'lastEffect',
],
old: [],
new: [],
},
],
Expand Down Expand Up @@ -190,7 +185,7 @@ module.exports = {
{
files: [
'packages/react-native-renderer/**/*.js',
'packages/react-transport-native-relay/**/*.js'
'packages/react-transport-native-relay/**/*.js',
],
globals: {
nativeFabricUIManager: true,
Expand Down
7 changes: 7 additions & 0 deletions packages/react-reconciler/src/ReactFiber.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ function FiberNode(

// Effects
this.flags = NoFlags;
this.nextEffect = null;

this.firstEffect = null;
this.lastEffect = null;
this.subtreeFlags = NoFlags;
this.deletions = null;

Expand Down Expand Up @@ -805,6 +809,9 @@ export function assignFiberPropertiesInDEV(
target.dependencies = source.dependencies;
target.mode = source.mode;
target.flags = source.flags;
target.nextEffect = source.nextEffect;
target.firstEffect = source.firstEffect;
target.lastEffect = source.lastEffect;
target.subtreeFlags = source.subtreeFlags;
target.deletions = source.deletions;
target.lanes = source.lanes;
Expand Down

0 comments on commit ccf2440

Please sign in to comment.