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

Coalesce lifecycle deprecation warnings until the commit phase #12084

Merged
merged 1 commit into from
Jan 25, 2018

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jan 23, 2018

Builds on top of PR #12083 and resolves issue #12044.

Coalesces deprecation warnings until the commit phase. This proposal extends the ReactDebugAsyncWarnings utility introduced in #12060 to also coalesce deprecation warnings.

New warning format will look like this:

componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount.

Please update the following components: Foo, Bar

Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks

@bvaughn bvaughn changed the title 12044 Coalesce lifecycle deprecation warnings until the commit phase Jan 23, 2018
Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

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

It can be a bit confusing that we warn for things that didn't commit. If something starts rendering and then gets aborted, and we commit something else, then it'll list those.

Ideally, it should probably be a new effect type that we can mark on the effect tag of each fiber so that we know to visit them and issue a warning of some sort. That would also avoid flushPendingDeprecationWarnings becoming an ever growing list of things to check for.

Another potential issue that internally we log these warnings. Those will go into tables that can't dedupe these since they will be unique combinations every time if they're aborted at different points.

Builds on top of PR facebook#12083 and resolves issue facebook#12044.

Coalesces deprecation warnings until the commit phase. This proposal extends the  utility introduced in facebook#12060 to also coalesce deprecation warnings.

New warning format will look like this:
> componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount.
>
> Please update the following components: Foo, Bar
>
> Learn more about this warning here:
> https://fb.me/react-async-component-lifecycle-hooks
@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 25, 2018

Rebased on top of master now that #12083 has been merged.

@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 25, 2018

Another potential issue that internally we log these warnings. Those will go into tables that can't dedupe these since they will be unique combinations every time if they're aborted at different points.

This shouldn't be an issue for us, right? We have the codemod (that I've already tested by running internally). It will be easy for us to remove the deprecated methods after we sync.

@bvaughn bvaughn merged commit 6dabfca into facebook:master Jan 25, 2018
@bvaughn bvaughn deleted the 12044 branch January 25, 2018 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants