just-react icon indicating copy to clipboard operation
just-react copied to clipboard

关于effectList 单向链表的使用已经被react废弃掉了

Open flyFatSeal opened this issue 4 years ago • 9 comments

小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist

react官方commit更改信息:Remove remaining references to effect list #19673

We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase.

This removes all references to the effect list in the new fork.

希望能将该内容更新

flyFatSeal avatar Oct 10 '20 07:10 flyFatSeal

小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist

react官方commit更改信息:Remove remaining references to effect list #19673

We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase.

This removes all references to the effect list in the new fork.

希望能将该内容更新

请问一下,为啥effectList 单向链表被废弃了

另外,这个PR只是被合并到了master分支。并没有说合并进了具体的某个版本的分支。

AnathanPham avatar Oct 23 '20 06:10 AnathanPham

感谢反馈

BetaSu avatar Oct 23 '20 06:10 BetaSu

小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist react官方commit更改信息:Remove remaining references to effect list #19673 We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase. This removes all references to the effect list in the new fork. 希望能将该内容更新

请问一下,为啥effectList 单向链表被废弃了

另外,这个PR只是被合并到了master分支。并没有说合并进了具体的某个版本的分支。

小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist react官方commit更改信息:Remove remaining references to effect list #19673 We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase. This removes all references to the effect list in the new fork. 希望能将该内容更新

请问一下,为啥effectList 单向链表被废弃了

另外,这个PR只是被合并到了master分支。并没有说合并进了具体的某个版本的分支。

17版本已经使用了,具体原因我这边也还不清楚。

flyFatSeal avatar Nov 09 '20 13:11 flyFatSeal

由于某些性能指标下降, subtreeTag被重置为 effectList。所以这部分书里暂不修改

https://github.com/facebook/react/commit/765e89b908206fe62feb10240604db224f38de7d

BetaSu avatar Jan 12 '21 05:01 BetaSu

我看react18中也已经弃掉effectList,未恢复回effectList

MyNameisQiShiQi avatar Apr 22 '22 07:04 MyNameisQiShiQi

由于某些性能指标下降, subtreeTag被重置为 effectList。所以这部分书里暂不修改

facebook/react@765e89b

我看react18中也已经弃掉effectList,未恢复回effectList

MyNameisQiShiQi avatar Apr 22 '22 07:04 MyNameisQiShiQi

为啥要废弃?有老哥研究了吗?

ronnycyy avatar Sep 26 '22 02:09 ronnycyy

为啥要废弃?有老哥研究了吗?

看代码React 18中使用了 if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {subtreeFlags 是当前 fiber 的子树的标识汇总,已经能防止无意义的完整深度遍历,能够更早地结束遍历,目测不再需要使用effectList来减少遍历整棵fiber tree了。

healyxiang avatar Jan 03 '23 11:01 healyxiang

的确。effectList废弃了

wangxingxing123654 avatar Nov 17 '23 07:11 wangxingxing123654