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

Conversation

Projects
None yet
2 participants
@youknowriad
Contributor

youknowriad commented Jun 7, 2018

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 Jun 7, 2018

@gziolo

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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 👍

@gziolo

gziolo approved these changes Jun 7, 2018

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

@youknowriad youknowriad merged commit c7ce08b into master Jun 8, 2018

2 checks passed

codecov/project 46.62% (-0.01%) compared to 102445b
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@youknowriad youknowriad deleted the add/enable-strict-mode branch Jun 8, 2018

@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