firefox-devtools/profiler

Move to React 16.3 and implement new lifecycle methods

Ouverte

#1 006 ouverte le 17 mai 2018

 (37 commentaires) (0 réaction) (3 personnes assignées)TypeScript (486 forks)auto 404
code maintenancehelp wantedready

Métriques du dépôt

Stars
 (1 515 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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

Guide contributeur