Skip to content

Coalesce lifecycle deprecation warnings until the commit phase - #12084

Merged
bvaughn merged 1 commit into
react:masterfrom
bvaughn:12044
Jan 25, 2018
Merged

Coalesce lifecycle deprecation warnings until the commit phase#12084
bvaughn merged 1 commit into
react:masterfrom
bvaughn:12044

Conversation

@bvaughn

@bvaughn bvaughn commented Jan 23, 2018

Copy link
Copy Markdown
Contributor

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

@sebmarkbage sebmarkbage left a comment

Copy link
Copy Markdown
Contributor

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 react#12083 and resolves issue react#12044.

Coalesces deprecation warnings until the commit phase. This proposal extends the  utility introduced in react#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 commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

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

@bvaughn

bvaughn commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

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 react:master Jan 25, 2018
@bvaughn
bvaughn deleted the 12044 branch January 25, 2018 05:41
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
…#12084)

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

Coalesces deprecation warnings until the commit phase. This proposal extends the  utility introduced in react#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
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.

3 participants