You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
timroes opened this issue
Mar 28, 2018
· 3 comments
Labels
choreMetastaleUsed to mark issues that were closed for being staleTeam:CoreCore services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
React will introduce async rendering and deprecate some lifecycle methods in the upcoming 16.x versions, since they are replaced with new lifecycle methods. Since these lifecycle methods, will be removed with React 17.0, we'll need to remove all of the deprecated lifecycle methods, before we update to React 17.0 in the future. This is the meta ticket, to remind us to remove all of those lifecycle methods.
The following lifecycle methods will be removed in the future:
componentWillUpdate
componentWillReceiveProps
componentWillMount
Most of the use-cases of these lifecycle methods can be solved with some other life-cycle method or one of the two new methods:
static getDerivedStateFromProps
getSnapshotBeforeUpdate
More resources
A detailed explanation of the migration with a lot of use-case examples can be found in Facebook's blog post. Since the blog post doesn't have a table of content, here are a list of possible use-cases that used the deprecated lifecycle methods:
Another resource, but not providing any more information than the above blog post, is the React 16.3 release blog post.
To be refactored
All of the following features are currently using componentWillMount and/or componentWillReceiveProps and should thus be refactored before React 17 or replaced completely (like Kibana UI framework).
Kibana Home
Kibana UI Framework
Dashboard Components & Grid
Index Pattern Wizard / Edit Index Patterns
TSVB
Input Control Vis
Markdown Vis
The text was updated successfully, but these errors were encountered:
There's an open issue in eslint-plugin-react about removing a couple of the recommended rules, see jsx-eslint/eslint-plugin-react#1754. From the author:
"componentWillMount", "componentWillUpdate", "componentWillReceiveProps" will be deprecated life-cycle methods (React 16.3.0, introduced these and deprecation warnings are scheduled to come with 16.4.0), and replacements for those will be accordingly "componentWillMount" => "componentDidMount", "componentWillUpdate" => "componentDidUpdate" and "componentWillReceiveProps" => with new introduced "getDerivedStateFromProps".
Therefore it's not relevant to have this rule and existing code bases should be migrated soon enough to match new life-cycles.
We may consider removing those rules from eslint-config-kibana as well, unless we find that it's something we want to explicitly add exceptions to in the code as needed.
jbudz
added
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
and removed
Team:Operations
Team label for Operations Team
labels
Apr 25, 2018
We're moving to React 16.12, there will be lots of deprecation warnings, after #51145 will be merged. There will be a follow up PR with a codemod, but that will just rename the functions to remove the warnings. So we should refactor code to remove those deprecated functions
choreMetastaleUsed to mark issues that were closed for being staleTeam:CoreCore services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Summary
React will introduce async rendering and deprecate some lifecycle methods in the upcoming 16.x versions, since they are replaced with new lifecycle methods. Since these lifecycle methods, will be removed with React 17.0, we'll need to remove all of the deprecated lifecycle methods, before we update to React 17.0 in the future. This is the meta ticket, to remind us to remove all of those lifecycle methods.
The following lifecycle methods will be removed in the future:
componentWillUpdate
componentWillReceiveProps
componentWillMount
Most of the use-cases of these lifecycle methods can be solved with some other life-cycle method or one of the two new methods:
static getDerivedStateFromProps
getSnapshotBeforeUpdate
More resources
A detailed explanation of the migration with a lot of use-case examples can be found in Facebook's blog post. Since the blog post doesn't have a table of content, here are a list of possible use-cases that used the deprecated lifecycle methods:
Another resource, but not providing any more information than the above blog post, is the React 16.3 release blog post.
To be refactored
All of the following features are currently using
componentWillMount
and/orcomponentWillReceiveProps
and should thus be refactored before React 17 or replaced completely (like Kibana UI framework).The text was updated successfully, but these errors were encountered: