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

React: Enable Strict Mode #7202

Merged
merged 1 commit into from Jun 8, 2018
Merged

React: Enable Strict Mode #7202

merged 1 commit into from Jun 8, 2018

Conversation

youknowriad
Copy link
Contributor

In preparation for Future React updates (Async mode), let's enable StrictMode in dev mode to avoid using deprecated APIs in Core and plugins.

This will create a ton of warnings in the console at the moment, but we should make sure to fix them in follow-up PRs.

@youknowriad youknowriad self-assigned this Jun 7, 2018
@youknowriad youknowriad requested review from gziolo and aduth June 7, 2018 09:53
@gziolo
Copy link
Member

gziolo commented Jun 7, 2018

I would be in favor of doing it, it will help to avoid using deprecated lifecycle methods which are going to be renamed (or fully removed) as of React 17.

@gziolo
Copy link
Member

gziolo commented Jun 7, 2018

StrictMode currently helps with:

  • Identifying components with unsafe lifecycles
  • Warning about legacy string ref API usage
  • Detecting unexpected side effects
  • Detecting legacy context API
  • Additional functionality will be added with future releases of React.

The last item on the list might be the biggest issue in our case ...

@gziolo
Copy link
Member

gziolo commented Jun 7, 2018

Should we also update to React 16.4.x in the same PR? There shouldn't be any breaking changes.

I think we can move on with this one as it starts to be noisy only when SCRIPT_DEBUG is set to true in PHP 👍

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get #7206 in first, to remove the noisiest warnings 😃

@youknowriad youknowriad merged commit c7ce08b into master Jun 8, 2018
@youknowriad youknowriad deleted the add/enable-strict-mode branch June 8, 2018 08:40
@youknowriad youknowriad added this to the 3.1 milestone Jun 19, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants