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 Legacy ContextTypes API Deprecation / Migration #1128

Open
fbartho opened this issue Aug 9, 2019 · 4 comments
Open

React Legacy ContextTypes API Deprecation / Migration #1128

fbartho opened this issue Aug 9, 2019 · 4 comments
Assignees

Comments

@fbartho
Copy link
Contributor

fbartho commented Aug 9, 2019

Filing a new ticket to track that we need to migrate ReactXP off of the legacy Context APIs and onto a more modern one!

@mikehardy shared the following:

(virtualenv) mike@kunashir:~/work/react-random/reactxp (unsafe-react-names) % grep -ri contexttypes *|grep -v dist | grep -v node_modules
src/web/Link.tsx:    static contextTypes = {
src/web/GestureView.tsx:    static contextTypes: React.ValidationMap<any> = {
src/web/TextInput.tsx:    static contextTypes: React.ValidationMap<any> = {
src/web/RootView.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/web/RootView.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/web/View.tsx:    static contextTypes: React.ValidationMap<any> = {
src/web/View.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/web/Button.tsx:    static contextTypes = {
src/web/Button.tsx:    static childContextTypes = {
src/web/Image.tsx:    static contextTypes: React.ValidationMap<any> = {
src/web/Image.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/web/Text.tsx:    static contextTypes = {
src/web/Text.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/native-desktop/RootView.tsx:        static childContextTypes: React.ValidationMap<any> = {
src/native-common/Link.tsx:    static contextTypes = {
src/native-common/TextInput.tsx:    static contextTypes: React.ValidationMap<any> = {
src/native-common/View.tsx:    static contextTypes: React.ValidationMap<any> = {
src/native-common/View.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/native-common/Button.tsx:    static contextTypes = {
src/native-common/Button.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/native-common/Image.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/native-common/Text.tsx:    static contextTypes: React.ValidationMap<any> = {
src/native-common/Text.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/common/PopupContainerViewBase.tsx:    static contextTypes: React.ValidationMap<any> = {
src/common/PopupContainerViewBase.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/common/utils/FocusManager.ts:    const contextTypes = Component.contextTypes || {};
src/common/utils/FocusManager.ts:    contextTypes.focusManager = PropTypes.object;
src/common/utils/FocusManager.ts:    Component.contextTypes = contextTypes;
src/windows/View.tsx:    static contextTypes: React.ValidationMap<any> = {
src/windows/View.tsx:        ...ViewCommon.contextTypes
src/windows/View.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/windows/View.tsx:        ...ViewCommon.childContextTypes
src/windows/Button.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/windows/Button.tsx:        ...ButtonBase.childContextTypes
src/windows/Text.tsx:    static contextTypes: React.ValidationMap<any> = {
src/windows/Text.tsx:        ...TextBase.contextTypes
src/windows/Text.tsx:    static childContextTypes: React.ValidationMap<any> = {
src/windows/Text.tsx:        ...TextBase.childContextTypes
(virtualenv) mike@kunashir:~/work/react-random/reactxp (unsafe-react-names) % grep -ri getchildcontext *|grep -v dist | grep -v node_modules
src/web/RootView.tsx:    getChildContext(): MainViewContext {
src/web/RootView.tsx:    getChildContext() {
src/web/View.tsx:    getChildContext() {
src/web/Button.tsx:    getChildContext(): ButtonContext {
src/web/Image.tsx:    getChildContext() {
src/web/Text.tsx:    getChildContext() {
src/native-desktop/RootView.tsx:        getChildContext() {
src/native-common/View.tsx:    getChildContext() {
src/native-common/Button.tsx:    getChildContext(): ButtonContext {
src/native-common/Image.tsx:    getChildContext() {
src/native-common/Text.tsx:    getChildContext() {
src/common/PopupContainerViewBase.tsx:    getChildContext() {
src/windows/View.tsx:    getChildContext() {
src/windows/View.tsx:        const childContext: ViewContext = super.getChildContext();
src/windows/Button.tsx:    getChildContext(): ButtonContext {
src/windows/Button.tsx:        const childContext: ButtonContext = super.getChildContext();
src/windows/Text.tsx:    getChildContext(): TextContext {
src/windows/Text.tsx:        const childContext: TextContext = super.getChildContext();

Related Ticket: #1039
Related Twitter Thread: @dan_abramov -- Performance Implications!
Documentation: https://reactjs.org/docs/context.html

This is a breaking change that depends on React >= 16.3.

@fbartho
Copy link
Contributor Author

fbartho commented Jul 22, 2020

@erictraut -- this is still an active concern. -- Do we have a roadmap to when we might be able to declare that reactxp is only compatible with React >=16.3? -- I'm happy to provide the PR if now is a good time.

@erictraut
Copy link
Contributor

In the past, we've said that we will generally support older versions of RN and React for one year after they have been replaced by newer versions. Can you remind me when React 16.3 was released? If it's more than a year ago, then I think we can go ahead and deprecate support in reactxp for older versions.

@fbartho
Copy link
Contributor Author

fbartho commented Jul 22, 2020

@erictraut
Copy link
Contributor

Great, then we can move forward with this deprecation now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants