Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
flyFatSeal opened this issue Oct 10, 2020 · 9 comments
Open

Comments

@flyFatSeal
Copy link

小书原文描述位置: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.

希望能将该内容更新

@AnathanPham
Copy link

AnathanPham commented Oct 23, 2020

小书原文描述位置: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分支。并没有说合并进了具体的某个版本的分支。

@BetaSu
Copy link
Owner

BetaSu commented Oct 23, 2020

感谢反馈

@flyFatSeal
Copy link
Author

小书原文描述位置: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版本已经使用了,具体原因我这边也还不清楚。

@BetaSu
Copy link
Owner

BetaSu commented Jan 12, 2021

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

facebook/react@765e89b

@MyNameisQiShiQi
Copy link

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

@MyNameisQiShiQi
Copy link

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

facebook/react@765e89b

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

Repository owner deleted a comment from 7greenfrog7 Apr 22, 2022
@ronnycyy
Copy link

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

@HealyXiang
Copy link

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

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

@wangxingxing123654
Copy link

的确。effectList废弃了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants