[Fiber] Replace setCurrentDebugFiberInDEV with runWithFiberInDEV (#29221)
Stacked on #29044. To work with `console.createTask(...).run(...)` we need to be able to run a function in the scope of the task. The main concern with this, other than general performance, is that it might add more stack frames on very deep stacks that hit the stack limit. Such as with the commit phase where we recursively go down the tree. These callbacks aren't really necessary in the recursive part but only in the shallow invocation of the commit phase for each tag. So we could refactor the commit phase so that only the shallow part at each level is covered this way.
Showing
- packages/react-reconciler/src/ReactChildFiber.js 21 additions, 23 deletionspackages/react-reconciler/src/ReactChildFiber.js
- packages/react-reconciler/src/ReactCurrentFiber.js 20 additions, 14 deletionspackages/react-reconciler/src/ReactCurrentFiber.js
- packages/react-reconciler/src/ReactFiberCommitWork.js 167 additions, 87 deletionspackages/react-reconciler/src/ReactFiberCommitWork.js
- packages/react-reconciler/src/ReactFiberReconciler.js 3 additions, 15 deletionspackages/react-reconciler/src/ReactFiberReconciler.js
- packages/react-reconciler/src/ReactFiberThrow.js 28 additions, 16 deletionspackages/react-reconciler/src/ReactFiberThrow.js
- packages/react-reconciler/src/ReactFiberWorkLoop.js 100 additions, 59 deletionspackages/react-reconciler/src/ReactFiberWorkLoop.js
- packages/react-reconciler/src/ReactStrictModeWarnings.js 3 additions, 9 deletionspackages/react-reconciler/src/ReactStrictModeWarnings.js
Please register or sign in to comment