Incorrect documentation for fixing memory leaks
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
The "isMounted is an Antipattern" documentation article suggest avoiding memory leaks with makeCancelable, but this doesn't actually solve the issue since the callback is still referenced. The garbage collector does not understand that setting hasCanceled_ means that resolve will never be called, so it cannot release resolve or the references contained within. Even if it could, reject might also reference this, so memory leaks could still exist. Instead, makeCancelable should store the resolve and reject callbacks itself, and it should null them out on cancelation.
Another user pointed this issue out in https://github.com/facebook/react/issues/5465#issuecomment-287113777
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
影響を受ける資料は issue にリンクされている「isMounted is an Antipattern」記事です。まず、その makeCancelable の例と、参照されている議論を確認してください。メモリリークに関する説明が技術的に正確になるようドキュメントを更新し、その後、記事が問題のある実装を推奨しなくなっていることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100