firefox-devtools/profiler

Move to React 16.3 and implement new lifecycle methods

開放

#1,006 建立於 2018年5月17日

 (37 則留言) (0 個反應) (3 位負責人)TypeScript (486 個分叉)auto 404
code maintenancehelp wantedready

倉庫指標

星標
 (1,515 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Since React 16.3 was out, componentWillReceiveProps is obsolete and has been renamed UNSAFE_componentWillReceiveProps. We should replace all its uses with recommended solutions.

Read more at React's blog and documentation.

Here are some suggestions for each file. Note that they don't all have the same difficulty !

  • src/components/app/ZipFileViewer.js (claimed by @qmya) Probably can be moved to componentDidUpdate
  • src/components/shared/Icon.js (claimed by @imabp) Can be replaced by componentDidUpdate
  • src/components/shared/IdleSearchField.js (claimed by @qmya) Probably replaced with a strategy Fully uncontrolled component with a key
  • src/components/shared/TreeView.js (claimed by @mstange) very possibly memoization
  • src/components/shared/chart/Canvas.js Strategy unclear. Maybe Fully uncontrolled component with a key.
  • src/components/shared/chart/Viewport.js (claimed by @imabp) Probably a mix. The parts that call setSizeNextFrame can easily be moved to componentDidUpdate. The part that compute an horizontalViewport could use a memoization strategy. The part that calls viewportNeedsUpdate may use getDerivedStateFromProps.
  • src/components/tooltip/Tooltip.js (claimed by @Segun-Ogundipe) Maybe moving it to componentDidUpdate works, but this needs careful testing. Possibly a strategy Fully uncontrolled component with a key is better.

Please comment on this issue to claim a component, and I will add your name to it. Please only work on one at a time, and send in 1 PR for each code path. This will make it easy for multiple people to work on this. We can give some more information where needed.

┆Issue is synchronized with this Jira Task

貢獻者指南