From f295d7f60843a45bb09fc366e497f512c2bc0046 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Mon, 3 Feb 2020 02:19:23 -0800 Subject: [PATCH] Lean Core: add warnings for extracted components (#27929) Summary: Add warning messages for Clipboard, SegmentedControlIOS, ProgressViewIOS, ProgressBarAndroid that has been published in community repo. ## Changelog [General] [Deprecated] - Add deprecation warnings for Clipboard, SegmentedControlIOS, ProgressViewIOS, ProgressBarAndroid. Pull Request resolved: https://github.com/facebook/react-native/pull/27929 Test Plan: yarn lint Differential Revision: D19690577 Pulled By: cpojer fbshipit-source-id: d53fbe9980c5eb2f7b62deb397064aa727d513bd --- index.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/index.js b/index.js index 0831f7a6a4a6f4..c7bbe8883c900c 100644 --- a/index.js +++ b/index.js @@ -183,9 +183,21 @@ module.exports = { return require('./Libraries/Components/Picker/PickerIOS'); }, get ProgressBarAndroid(): ProgressBarAndroid { + warnOnce( + 'progress-bar-android-moved', + 'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' + + "It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " + + 'See https://github.com/react-native-community/react-native-progress-bar-android', + ); return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid'); }, get ProgressViewIOS(): ProgressViewIOS { + warnOnce( + 'progress-view-ios-moved', + 'ProgressViewIOS has been extracted from react-native core and will be removed in a future release. ' + + "It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. " + + 'See https://github.com/react-native-community/react-native-progress-view', + ); return require('./Libraries/Components/ProgressViewIOS/ProgressViewIOS'); }, get SafeAreaView(): SafeAreaView { @@ -198,6 +210,12 @@ module.exports = { return require('./Libraries/Lists/SectionList'); }, get SegmentedControlIOS(): SegmentedControlIOS { + warnOnce( + 'segmented-control-ios-moved', + 'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' + + "It can now be installed and imported from '@react-native-community/segmented-control' instead of 'react-native'. " + + 'See https://github.com/react-native-community/react-native-segmented-control', + ); return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS'); }, get Slider(): Slider { @@ -281,6 +299,12 @@ module.exports = { return require('./Libraries/Utilities/BackHandler'); }, get Clipboard(): Clipboard { + warnOnce( + 'clipboard-moved', + 'Clipboard has been extracted from react-native core and will be removed in a future release. ' + + "It can now be installed and imported from '@react-native-community/clipboard' instead of 'react-native'. " + + 'See https://github.com/react-native-community/react-native-clipboard', + ); return require('./Libraries/Components/Clipboard/Clipboard'); }, get DatePickerAndroid(): DatePickerAndroid {