From 8ba46aa86cb33c6cbb1e807ada4117606d09281b Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Mon, 30 Mar 2020 15:14:28 -0700 Subject: [PATCH] chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e --- index.js | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index e9b7b659f6..987fc7f2aa 100644 --- a/index.js +++ b/index.js @@ -130,7 +130,7 @@ module.exports = { 'DatePickerIOS-merged', 'DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. ' + "It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-datetimepicker', + 'See https://github.com/react-native-community/datetimepicker', ); return require('./Libraries/Components/DatePicker/DatePickerIOS'); }, @@ -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/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/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/segmented-control', + ); return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS'); }, get Slider(): Slider { @@ -273,7 +291,7 @@ module.exports = { 'async-storage-moved', 'AsyncStorage 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/async-storage' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-async-storage', + 'See https://github.com/react-native-community/async-storage', ); return require('./Libraries/Storage/AsyncStorage'); }, @@ -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/clipboard', + ); return require('./Libraries/Components/Clipboard/Clipboard'); }, get DatePickerAndroid(): DatePickerAndroid { @@ -288,7 +312,7 @@ module.exports = { 'DatePickerAndroid-merged', 'DatePickerAndroid has been merged with DatePickerIOS and will be removed in a future release. ' + "It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-datetimepicker', + 'See https://github.com/react-native-community/datetimepicker', ); return require('./Libraries/Components/DatePickerAndroid/DatePickerAndroid'); }, @@ -356,7 +380,7 @@ module.exports = { 'pushNotificationIOS-moved', 'PushNotificationIOS 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/push-notification-ios' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-push-notification-ios', + 'See https://github.com/react-native-community/push-notification-ios', ); return require('./Libraries/PushNotificationIOS/PushNotificationIOS'); }, @@ -466,7 +490,7 @@ if (__DEV__) { false, 'ART has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/art' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-art', + 'See https://github.com/react-native-community/art', ); }, }); @@ -571,7 +595,7 @@ if (__DEV__) { false, 'TimePickerAndroid has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-datetimepicker', + 'See https://github.com/react-native-community/datetimepicker', ); }, });