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

Upgrade to React 16.6 stable APIs #11360

Closed
11 of 12 tasks
youknowriad opened this issue Nov 1, 2018 · 21 comments
Closed
11 of 12 tasks

Upgrade to React 16.6 stable APIs #11360

youknowriad opened this issue Nov 1, 2018 · 21 comments
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript
Milestone

Comments

@youknowriad
Copy link
Contributor

youknowriad commented Nov 1, 2018

Ideally, before upgrading, we can get rid of all deprecated APIs surfaced by StrictMode of React 16.6.

  • findDOMNode
  • The old contextAPI
  • componentWillReceiveProps and other lifecycle hooks.

Remaining instances (feel free to add items to the list when you notice used deprecated APIs)

@youknowriad youknowriad added the Framework Issues related to broader framework topics, especially as it relates to javascript label Nov 1, 2018
@youknowriad youknowriad added this to the 4.3 milestone Nov 1, 2018
@ellatrix
Copy link
Member

ellatrix commented Nov 1, 2018

There's a PR for the TinyMCE one: #8148.

@ellatrix
Copy link
Member

ellatrix commented Nov 1, 2018

I also see one for Resizable:

react-dom.24169eaf.js:526 Warning: Unsafe lifecycle methods were found within a strict-mode tree:
    in Editor (created by ComponentWithSelect)
    in ComponentWithSelect
    in WithSelect(Editor)

componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Resizable

Learn more about this warning here:
https://fb.me/react-strict-mode-warnings

@youknowriad
Copy link
Contributor Author

@iseulde I saw it too, not sure where it come from yet but adding an item to the list above.

@oandregal
Copy link
Member

Riad, #11123 has been merged. Checked the task off from the list.

@youknowriad
Copy link
Contributor Author

youknowriad commented Nov 6, 2018

Remove componentWillUpdate from the Fill component

@aduth when you have some time, I'd appreciate some help on this particular point

@youknowriad youknowriad modified the milestones: 4.3, 4.4 Nov 7, 2018
@oandregal
Copy link
Member

Did not find anything related to the Resizable component, but searching for componentWillReceiveProps did yield one result: the Input leaf component of ColorPicker. I can look into that.

@aduth
Copy link
Member

aduth commented Nov 14, 2018

Given the title of the issue, can this be assumed to be closed by #11840?

Or should we update the title if there are remaining tasks?

@oandregal
Copy link
Member

oandregal commented Nov 14, 2018

I'd rename it to something along the lines of "Upgrade to React 16.6 stable APIs".

@youknowriad
Copy link
Contributor Author

Can we do a push to fix the remaining warnings here?

@coreymckrill
Copy link
Contributor

Looks like there is also usage of componentWillMount in the Latest Posts block. Would that fall within the scope of this issue?

@aduth
Copy link
Member

aduth commented Mar 22, 2019

Looks like there is also usage of componentWillMount in the Latest Posts block. Would that fall within the scope of this issue?

I expect so, yes (and for any other occurrence of componentWillMount, if exists).

Edit: Updated original comment.

@notnownikki
Copy link
Member

PR for LatestPostsEdit is at #14637

@aduth
Copy link
Member

aduth commented Apr 5, 2019

Question: Will using the UNSAFE_-prefixed methods trigger StrictMode warnings? While I'd love to avoid them altogether, I'm personally more inclined to see us using development modes in E2E sooner than later to catch other, legitimate, present issues (related discussion).

Edit: Follow-up issue for SCRIPT_DEBUG at #14845

@chiraggmodi
Copy link

any update on how to solve this issue?

@aduth
Copy link
Member

aduth commented Apr 16, 2019

@chiraggmodi The warnings logged from the React unsafe methods are not ideal, but are safe to ignore. This issue serves as to track progress from the task of updating individual components to avoid warnings being logged, as they are not future-compatible. Feel free to take on any of the items listed which have not been claimed, if you are able to assist in this upgrade.

@gziolo
Copy link
Member

gziolo commented May 9, 2019

It looks like componentWillUpdate in Fill component which blocks us from enabling SCRIPT_DEBUG in e2e tests env. Is anyone working on it?

@youknowriad
Copy link
Contributor Author

I'd really want us to close this issue. I know the Fill issue is not easy though.
Some people running WP in SCRIPT_DEBUG true are getting confused with these warnings.

@gziolo
Copy link
Member

gziolo commented May 9, 2019

I'd really want us to close this issue. I know the Fill issue is not easy though.
Some people running WP in SCRIPT_DEBUG true are getting confused with these warnings.

Has anyone tried using getSnapshotBeforeUpdate instead?

@youknowriad
Copy link
Contributor Author

Most of the warnings are now gone when you open the editor. I'm going to close this at the moment. Let's consider any future warnings as bugs.

@aduth
Copy link
Member

aduth commented May 22, 2019

#14851 will resolve some StrictMode errors for Popover usage (findDOMNode). An issue should be created to remove all findDOMNode warnings caused as a result of using react-click-outside (remove react-click-outside in similar refactoring, only used elsewhere in Modal). Remind me to create this if I forget.

#14845 should be considered a follow-up task here (enable development React and thereby StrictMode in end-to-end testing environments for error log capturing).

@youknowriad
Copy link
Contributor Author

@aduth I created this #15790 to track the Modal refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript
Projects
None yet
Development

No branches or pull requests

9 participants