Summary:
See https://fb.workplace.com/permalink.php?story_fbid=2337018256625463&id=100009037038038&substory_index=58 for motivation.
I opted for using a substring that is unlikely to come up in warnings in product code but is shared across all lean core warnings. I think this is good enough and won't require updates every time we deprecate a new module.
Reviewed By: yungsters
Differential Revision: D16073431
fbshipit-source-id: 136b9e8ab53c85d2de5ed7844780f5d082087a7d
Summary:
`TimePickerAndroid` has been merged With `DatePickerIOS` and `DatePickerAndroid` as part of Lean Core. See [repo](https://github.com/react-native-community/react-native-datetimepicker)
## Changelog
[General] [Deprecate] - Warning for `TimePickerAndroid`
Pull Request resolved: https://github.com/facebook/react-native/pull/25409
Test Plan: Warning prints when user imports `TimePickerAndroid`
Differential Revision: D16028676
Pulled By: cpojer
fbshipit-source-id: 5dfdb6d7cc144f7a171892ebd1f6b6b9b6334b56
Summary:
We should remove all usages of React's legacy context API because it'll be removed from React at some point, it prevents some performance optimizations in updates and can cause conflicts between different context providers (like mixins).
This creates a new Context for `rootTag` (this granularity is intentional) so users that are consuming it via the legacy context API can start migrating away from it.
I didn't create a more generic context (like ReactRootContext, ReactApplicationContext) because having a more granular context makes it easier to track and remove it if we want to, and prevents re-rendering when users only care about certain values.
Reviewed By: rickhanlonii, cpojer
Differential Revision: D14941918
fbshipit-source-id: 7ceea62727d10a591367b7ed7c447309b286758d
Summary:
`DatePickerIOS` and `DatePickerAndroid` have been merged as part of Lean Core. See [repo](https://github.com/react-native-community/react-native-datetimepicker)
## Changelog
[General] [Deprecate] - Warning for `DatePickerIOS` and `DatePickerAndroid`
Pull Request resolved: https://github.com/facebook/react-native/pull/25374
Test Plan: Warning prints when user imports `DatePickerIOS` or `DatePickerAndroid`
Differential Revision: D15983829
Pulled By: cpojer
fbshipit-source-id: dfa35e204bb133a1b8de67c25abaa4338b956901
Summary:
`StatusBarIOS` has been merged with `StatusBar`. See [Implement a StatusBar frame API](https://github.com/facebook/react-native/pull/16478)
## Changelog
[General] [Deprecate] - Warning for `StatusBarIOS`
Pull Request resolved: https://github.com/facebook/react-native/pull/25350
Test Plan: Warning prints when user imports `StatusBarIOS`
Differential Revision: D15963347
Pulled By: cpojer
fbshipit-source-id: 456a7f3ccb245bd89ad322d5a2649e3bf844ba24
Summary:
Since React Native ART has been extracted to community module, we can deprecate it in Core. You can find the community module [here](https://github.com/react-native-community/art).
## Changelog
[General] [Deprecate] - Deprecate React Native ART
Pull Request resolved: https://github.com/facebook/react-native/pull/25321
Test Plan:
Deprecation warning prints when user imports ART from react-native core module.
cc. cpojer
Differential Revision: D15938910
Pulled By: cpojer
fbshipit-source-id: d360fab6582c0d6c9064005246a012d2d5391c5c
Summary:
This module is being removed from React Native via Lean Core. This diff moves all the related JS files to FB internal.
Note: I removed two references to previously removed modules from some files in this diff. I hope you don't mind.
Reviewed By: TheSavior
Differential Revision: D15714919
fbshipit-source-id: 88ea406396b31f5c255e06d9c92b67127c81db4a
Summary: This module is being removed from RN as part of the Lean Core effort.
Reviewed By: TheSavior
Differential Revision: D15714507
fbshipit-source-id: bb5dc2025a25ad450d6971e5948e7a2e678a9a25
Summary: After upgrading `react-native-gesture-handler` in D15701771, we can finally remove this :)
Reviewed By: rubennorte
Differential Revision: D15713072
fbshipit-source-id: 5039478f211a9bdb6ba0d17bed0841e188d00b46
Summary: This is being removed from RN as part of Lean Core.
Reviewed By: rickhanlonii
Differential Revision: D15666249
fbshipit-source-id: 00612b999184f216cc3deb72c6b24af359060abe
Summary: This continues the migration off of haste for react-native-github by changing `react-native-implementation` not to use haste.
Reviewed By: JoshuaGross
Differential Revision: D15575896
fbshipit-source-id: 0de7314b7d038a6d603d09ca910f84d580c5cc33
Summary:
This is an ESLint plugin that infers whether an import looks like a Haste module name. To keep the linter fast and simple, it does not look in the Haste map. Instead, it looks for uppercase characters in single-name import paths, since npm has disallowed uppercase letters in package names for a long time. There are some false negatives (e.g. "merge" is a Haste module and this linter rule would not pick it up) but those are about 1.1% of the module names in the RN repo, and unit tests and integration tests will fail anyway once Haste is turned off.
You can disable the lint rule on varying granular levels with ESLint's normal disabling/enabling mechanisms.
Also rewrote more Haste imports so that the linter passes (i.e. fixed lint errors as part of this PR).
## Changelog
[General] [Changed] - Add a lint rule to disallow Haste imports
Pull Request resolved: https://github.com/facebook/react-native/pull/25058
Differential Revision: D15515826
Pulled By: cpojer
fbshipit-source-id: d58a3c30dfe0887f8a530e3393af4af5a1ec1cac
Summary: I simply removed them from RN but we should give an actionable error message for people who upgrade from older versions of RN and who may be using these old modules, at least in `__DEV__`.
Reviewed By: rickhanlonii
Differential Revision: D15554863
fbshipit-source-id: 1975d4773581258776d2586ae820677bb14488f6
Summary:
React Native Gesture Handler used to eagerly initialize all of its exports and therefore required a bunch of things from React Native eagerly. When we remove things from RN via the Lean Core project, this leads to failures.
I asked Krzysztof to make a patch release that lazily loads them instead: da658c2de2
Reviewed By: rickhanlonii
Differential Revision: D15554658
fbshipit-source-id: aa4b82e5a3c2c837d160da914f41756d26cd6c07
Summary: Adding flow types for DeviceInfo module and migrating our codebase over to using `DeviceInfo.getConstants()`
Reviewed By: fkgozali
Differential Revision: D14645744
fbshipit-source-id: e30a060c6dc92938cd1420ba11a1d837c79d1e32
Summary: This unbreaks an issue at FB.
Reviewed By: rickhanlonii
Differential Revision: D15536623
fbshipit-source-id: 2d59542330d2b951908adf8b6c5c41ca4232bb07
Summary: This removes the JS for ToolbarAndroid from RN and moves it to Ads manager, which has two remaining uses of it. In a follow-up, I will also move the native code.
Reviewed By: rickhanlonii
Differential Revision: D15469117
fbshipit-source-id: 68c3f89b85cc589a48f2dced183267daa791b53b
Summary: Moves relevant JS files to fb internal, removes stuff we don't need in the RN repo any more. Android and iOS will happen in a follow-up.
Reviewed By: rickhanlonii
Differential Revision: D15468419
fbshipit-source-id: 39fffc22f87534e557788e398bbae575043353b6
Summary: This diff fixes the flow errors that surfaced from flow-typing DialogManagerAndorid and deleting NativeDialogManagerAndroid. I also migrated all imports of NativeDialogManagerAndorid to import the module from `react-native-implementation.js`.
Reviewed By: fkgozali
Differential Revision: D15440162
fbshipit-source-id: 2fdfb68104bc8ffb93c0c77fe15aacadc182f62f
Summary: This removes the NetInfo import from RN and moves it to FB internal. Follow-up diffs will move the Android and iOS files as well.
Reviewed By: rubennorte
Differential Revision: D15392486
fbshipit-source-id: b868b671b8d91661bc7634b4662074ae953835be
Summary:
There has been push back to remove this module from React Native. Since it is contentious, let's revert the deprecation and table this conversation until later.
## Changelog
[General] [Changed] - Undeprecate StatusBar for now.
Pull Request resolved: https://github.com/facebook/react-native/pull/24860
Differential Revision: D15351835
Pulled By: cpojer
fbshipit-source-id: 2f40f3a8f17ab7631bf5441cd6528b04103e7821
Summary:
This showcases SampleTurboModule usage in RNTester. Notes:
* iOS only for now, and you must use cocoapods version.
* You cannot use Chrome debugger when loading this specific example.
As illustrated in the example, the callsite should access `NativeSampleTurboModule` to access the native side.
{F155901711}
Reviewed By: cpojer
Differential Revision: D14932537
fbshipit-source-id: a733e1cd3b642b9e572d5ac6347f4775d495578a
Summary:
This diff removes the `WebView` export from React Native. Internally, we are requiring `WebView` directly now and externally people will have to use the community maintained module. This diff does not yet move the WebView files from the repo, this will happen in a follow-up.
Note that I had to remove a test for Cookies that displayed data in a WebView. I don't think there is an easy way to retain this (debugging) information that likely very few people ever take a look at so I think it is fine.
Reviewed By: TheSavior
Differential Revision: D14613077
fbshipit-source-id: b1d412f970d09d7d70ecac2c23e62cfdd09d7c8e
Summary: According to TheSavior this was an experimental module that "accidentally" got added to RN open source. In fact, we only use it in two places internally. This diff moves these files to FB internal and removes them from RN completely. I skipped the deprecation message because it was always an experimental feature and I don't expect anyone out there using it.
Reviewed By: TheSavior
Differential Revision: D14631749
fbshipit-source-id: 87878fcbb901e1e7fa4a3ff3205e09886ff3ed43
Summary:
This module was merged with `Alert`. Landing the removal now will mean that it is gone from 0.61 which means the deprecation warning will have been there for two full versions.
It will also make it easier to ship D14538298.
Reviewed By: rubennorte
Differential Revision: D14539026
fbshipit-source-id: fb36482324866c277811756cc7461451a1482b23
Summary:
Adds a deprecation warning for using status-bar package
Lean Core Issue: #23313
[General] [Deprecated] - Deprecated StatusBar as it has now been moved to react-native-community/statusbar
Pull Request resolved: https://github.com/facebook/react-native/pull/23898
Differential Revision: D14477606
Pulled By: cpojer
fbshipit-source-id: 2955374446f879c3e7cfea97cb8c379ec8b003cd
Summary:
Part of: #23313.
This moves the `RCTTest` lib from `Libraries/RCTTest` to `RNTester/RCTTest`. This also removes `takeSnapshot` from React Native, and implements it as a standalone module in RNTester called `ScreenshotManager`.
[General] [Removed] - RCTTest & ReactNative.takeSnapshot
Pull Request resolved: https://github.com/facebook/react-native/pull/23721
Differential Revision: D14434796
Pulled By: PeteTheHeat
fbshipit-source-id: d6e103a0ea0b6702701cdb5ce8449163ca4628ce
Summary:
Adds a moved warning to the CameraRoll import directing people to the react-native-community/cameraroll package.
[Lean Core] [Warning] add warning that CameraRoll has been moved to RNC
Pull Request resolved: https://github.com/facebook/react-native/pull/23733
Differential Revision: D14298485
Pulled By: cpojer
fbshipit-source-id: cf03660c604a7337f234da107d7069c0ccf99f36
Summary:
This diff removes ListView and SwipeableListView from React Native:
* Removes the code and all examples
* Removes the exports on `react-native-implementation` but leaves an error message in dev mode only
* Uses `deprecated-react-native-listview` for `ListView` and `deprecated-react-native-swipeable-listview` for `SwipeableListView`
Both ListView and SwipeableListView are now fully removed from React Native in open source and we will continue to use the deprecated packages internally.
Reviewed By: TheSavior
Differential Revision: D14181708
fbshipit-source-id: 5030c33791f998567de058fee934449c16fa1d54
Summary:
Part of Lean Core #23313
Removes `SnapshotViewIOS` from the public RN interface.
I think there's a wider discussion to be had here about whether `RCTTest` should be part of the public distribution or at least whether this should be split into a separate utils package. It's mainly used by the RNTester app. It seems to be little known about but there are [some references to it online](https://blog.callstack.io/testing-your-react-native-apps-abfe41903dfd).
[iOS] [Removed] - `SnapshotViewIOS` is no longer publicly exported from RN
Pull Request resolved: https://github.com/facebook/react-native/pull/23497
Differential Revision: D14123280
Pulled By: cpojer
fbshipit-source-id: badaf6cb5d2195268f0f8b429fc11d6525747708
Summary: This module has been deprecated for two years. There is `Vibration`, backed by the same native module, with cross platform support.
Reviewed By: rickhanlonii
Differential Revision: D14080979
fbshipit-source-id: 7bf60cfdca9517c6858b3c7f8a2b16eab0ce8e80
Summary: These modules have been deprecated for at least one release or more. By landing this diff now, they will be fully removed from 0.60 (to be released in ~April).
Reviewed By: rickhanlonii
Differential Revision: D14080869
fbshipit-source-id: cf39cc1782eec1dd09750d20b55c76f580320f4d
Summary:
Itwas merged AlertIOS into Alert and removed type parameter from Alert.alert line 60 at Alert.js
[AlertIOS] [Change and Replace] - Merge AlertIOS into Alert.
Pull Request resolved: https://github.com/facebook/react-native/pull/23318
Reviewed By: mjesun
Differential Revision: D14031421
Pulled By: cpojer
fbshipit-source-id: 98db173adeb65aa90d309f8a583993bc0cddb6e1
Summary:
Add a deprecation warning for the `NetInfo` module as part of #23313.
[General] [Deprecated] - Deprecated NetInfo as it has now been moved to react-native-community/netinfo
Pull Request resolved: https://github.com/facebook/react-native/pull/23383
Differential Revision: D14024702
Pulled By: cpojer
fbshipit-source-id: 353a9fb86feba2ca7f948c618c642e40fcdbfada
Summary:
Introducing the deprecation warning for those who are importing `Slider` component (https://github.com/facebook/react-native/issues/23313)
[General] [Deprecated] - Deprecated Slider as it has now been moved to `react-native-community/slider`
Pull Request resolved: https://github.com/facebook/react-native/pull/23385
Differential Revision: D14029819
Pulled By: cpojer
fbshipit-source-id: 7ad257124756c6bee57c3fbb1a056c09e8cc29a1
Summary:
- Related: #23313
- ImageStore is **iOS only**. AFAIK there is no reason this functionality isn't available on Android.
- base64 is very inefficient with the React Native bridge
- Ideally the `FileSystem` solutions will integrate Turbo Modules to circumvent bridge issues by passing direct references to files.
* [General][added] - A deprecation notice with info about third-party solutions for getting a base64-encoded string.
* [General][fixed] - Missing warnings for unimplemented platform methods.
Pull Request resolved: https://github.com/facebook/react-native/pull/23330
Differential Revision: D14022159
Pulled By: cpojer
fbshipit-source-id: 2a026ebf47cb315e9a0cfe6e3697a1799c5cbe2c
Summary:
This pull request adds a function called `warnOnce` that prints a warning message to the console once per session.
It uses a unique key per callsite to help ensure that the message is not printed multiple times.
[General] [Added] - Added new `warnOnce` function for printing a message to the developer console once per session
[General] [Changed] - Changed the warnings in `react-native-implementation` to use `warnOnce`
Pull Request resolved: https://github.com/facebook/react-native/pull/22109
Differential Revision: D13955887
Pulled By: cpojer
fbshipit-source-id: aa51ac427a80cc0554a6bcc915715821d0bd5439
Summary:
Changelog:
----------
Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.
[General] [Deprecated] - Deprecation warning for WebView as it has been extracted from core.
Pull Request resolved: https://github.com/facebook/react-native/pull/22980
Differential Revision: D13664505
Pulled By: hramos
fbshipit-source-id: 0cfc06015e77c52bed9eeebd97c8cbca6eacd8ce
Summary:
Fixes#20935
Added UTFSequence module to React-Native exports. Put it under // APIs but I'm not certain if it belongs there.
Pull Request resolved: https://github.com/facebook/react-native/pull/20955
Differential Revision: D13396903
Pulled By: cpojer
fbshipit-source-id: 29cb2ee1431132bd7ca4973fecb0025cd6303a14