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

Stop warning about setNativeProps being deprecated #17045

Merged
merged 3 commits into from
Oct 8, 2019

Conversation

elicwhite
Copy link
Member

@elicwhite elicwhite commented Oct 8, 2019

I added this code in #14907 and #14912.

This warning was was enabled with a feature flag only at Facebook. We had all these warnings ignored and figured we'd migrate to the new API as part of Fabric.

This actually makes little sense. Importing setNativeProps from 'react-native' won't give us the Fabric version of setNativeProps. The only way to do that is by calling it on a ref. Even with that, we don't know if setNativeProps will exist in fabric, so migrating to a new API just to stop supporting it doesn't make sense. We added a warning and made the implementation in Fabric a no-op here: #15094

All things considered, this change isn't necessary today, adds some bloat, is not used anywhere (it's not even exported by React Native's public API in the current release) and just triggers a ton of warnings for us at Facebook.

Also, none of our other APIs that we are migrating from for Fabric currently show warnings. It doesn't make much sense to have this one warn but none of the others.

Let's remove and revisit if we want some form of this in the future.

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

Makes sense

@sizebot
Copy link

sizebot commented Oct 8, 2019

Details of bundled changes.

Comparing: b71ab61...9ce90ae

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-prod.js -0.2% -0.1% 275.3 KB 274.86 KB 47.04 KB 46.99 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.2% -0.1% 284.84 KB 284.39 KB 48.79 KB 48.74 KB RN_OSS_PROFILING
ReactFabric-prod.js -0.0% -0.0% 266.52 KB 266.48 KB 45.64 KB 45.63 KB RN_OSS_PROD
ReactFabric-profiling.js -0.0% -0.0% 277.17 KB 277.13 KB 47.5 KB 47.49 KB RN_OSS_PROFILING
ReactFabric-dev.js -0.2% -0.1% 751.27 KB 750.1 KB 158.9 KB 158.72 KB RN_FB_DEV
ReactFabric-prod.js -0.0% -0.0% 266.52 KB 266.49 KB 45.65 KB 45.64 KB RN_FB_PROD
ReactNativeRenderer-dev.js -0.3% -0.2% 746.79 KB 744.42 KB 158.19 KB 157.82 KB RN_OSS_DEV
ReactFabric-profiling.js -0.0% -0.0% 277.16 KB 277.13 KB 47.51 KB 47.5 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js -0.3% -0.2% 746.95 KB 744.58 KB 158.26 KB 157.9 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.2% -0.1% 275.3 KB 274.85 KB 47.05 KB 47 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.2% -0.1% 284.83 KB 284.38 KB 48.79 KB 48.74 KB RN_FB_PROFILING
ReactFabric-dev.js -0.2% -0.1% 751.1 KB 749.93 KB 158.82 KB 158.65 KB RN_OSS_DEV

Generated by 🚫 dangerJS against 9ce90ae

@elicwhite elicwhite merged commit 4be45be into facebook:master Oct 8, 2019
@elicwhite elicwhite deleted the setnativeprops-warning branch October 8, 2019 18:21
rickhanlonii pushed a commit to rickhanlonii/react that referenced this pull request Oct 9, 2019
* Stop warning about setNativeProps being deprecated

* Remove ReactNative.setNativeProps

* Remove more Fabric tests
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Oct 9, 2019
Summary:
This diff is a partial sync of React into React Native.

## Source
The source branch is from my fork [here](https://github.com/facebook/react/compare/master...rickhanlonii:react-native-partial-sync-october-9?expand=1)

This branch is created from D17456249 which partially synced Dan's branch [here](facebook/react@master...gaearon:partsync).

To create my branch, I forked from Dan's branch and added two commits from these PRs:

- Joshua's PR to improve view config errors facebook/react#16879
- Eli's PR to remove setNativeProps warning facebook/react#17045

Reviewed By: gaearon

Differential Revision: D17828989

fbshipit-source-id: 75c99737f2dec4889d7d453bbdebaeb47656b5ce
youmoxiyou pushed a commit to youmoxiyou/react-native that referenced this pull request Oct 10, 2019
Summary:
This diff is a partial sync of React into React Native.

## Source
The source branch is from my fork [here](https://github.com/facebook/react/compare/master...rickhanlonii:react-native-partial-sync-october-9?expand=1)

This branch is created from D17456249 which partially synced Dan's branch [here](facebook/react@master...gaearon:partsync).

To create my branch, I forked from Dan's branch and added two commits from these PRs:

- Joshua's PR to improve view config errors facebook/react#16879
- Eli's PR to remove setNativeProps warning facebook/react#17045

Reviewed By: gaearon

Differential Revision: D17828989

fbshipit-source-id: 75c99737f2dec4889d7d453bbdebaeb47656b5ce
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.

4 participants