@office-iss/react-native-win32 0.68.0 → 0.69.0-preview.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -0
- package/.flowconfig +1 -3
- package/CHANGELOG.json +386 -32
- package/CHANGELOG.md +166 -19
- package/IntegrationTests/BUCK +4 -1
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
- package/Libraries/Alert/Alert.win32.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +1 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
- package/Libraries/Animated/NativeAnimatedModule.js +1 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +6 -11
- package/Libraries/Animated/createAnimatedComponent.js +2 -2
- package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
- package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/Blob/URL.js +7 -1
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
- package/Libraries/Components/Pressable/Pressable.js +3 -3
- package/Libraries/Components/Pressable/Pressable.win32.js +3 -3
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
- package/Libraries/Components/ScrollView/ScrollView.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
- package/Libraries/Components/Slider/Slider.js +0 -2
- package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
- package/Libraries/Components/StatusBar/StatusBar.js +6 -1
- package/Libraries/Components/Switch/Switch.js +11 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
- package/Libraries/Components/TextInput/TextInput.js +1 -8
- package/Libraries/Components/TextInput/TextInputState.js +10 -2
- package/Libraries/Components/TextInput/TextInputState.win32.js +10 -2
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
- package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +3 -1
- package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
- package/Libraries/Components/View/View.win32.js +33 -1
- package/Libraries/Components/View/ViewNativeComponent.js +68 -8
- package/Libraries/Components/View/ViewPropTypes.js +36 -4
- package/Libraries/Components/View/ViewPropTypes.win32.js +36 -4
- package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -1
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +1 -1
- package/Libraries/Core/RawEventEmitter.js +38 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/polyfillPromise.js +32 -0
- package/Libraries/Core/setUpReactDevTools.js +3 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
- package/Libraries/Events/CustomEvent.js +32 -0
- package/Libraries/Events/EventPolyfill.js +239 -0
- package/Libraries/Image/Image.android.js +0 -6
- package/Libraries/Image/Image.ios.js +0 -6
- package/Libraries/Image/Image.win32.js +2 -8
- package/Libraries/Image/ImageViewNativeComponent.js +18 -3
- package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
- package/Libraries/Image/resolveAssetSource.win32.js +1 -1
- package/Libraries/Inspector/Inspector.js +2 -4
- package/Libraries/Inspector/Inspector.win32.js +7 -9
- package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
- package/Libraries/Interaction/InteractionManager.js +1 -12
- package/Libraries/Interaction/TaskQueue.js +5 -4
- package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +27 -6
- package/Libraries/Lists/VirtualizedList.js +71 -55
- package/Libraries/Lists/VirtualizedListContext.js +7 -3
- package/Libraries/Lists/VirtualizedSectionList.js +2 -2
- package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
- package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
- package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
- package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
- package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +92 -43
- package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +16 -14
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +2 -21
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +334 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
- package/Libraries/NativeComponent/ViewConfig.js +4 -4
- package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
- package/Libraries/Network/FormData.js +7 -1
- package/Libraries/Network/RCTNetworking.win32.js +1 -1
- package/Libraries/Pressability/Pressability.js +115 -46
- package/Libraries/Pressability/Pressability.win32.js +174 -69
- package/Libraries/Pressability/PressabilityDebug.js +5 -9
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
- package/Libraries/ReactNative/PaperUIManager.win32.js +5 -5
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
- package/Libraries/ReactNative/UIManager.js +2 -3
- package/Libraries/ReactNative/renderApplication.js +4 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
- package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
- package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
- package/Libraries/Text/Text.js +13 -7
- package/Libraries/Text/TextNativeComponent.js +2 -0
- package/Libraries/Text/TextNativeComponent.win32.js +2 -0
- package/Libraries/Text/TextProps.js +10 -0
- package/Libraries/Types/CoreEventTypes.js +13 -1
- package/Libraries/Types/CoreEventTypes.win32.js +26 -1
- package/Libraries/Utilities/Appearance.js +0 -8
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
- package/Libraries/Utilities/codegenNativeComponent.js +16 -6
- package/Libraries/Utilities/stringifySafe.js +4 -1
- package/Libraries/Utilities/useColorScheme.js +9 -15
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
- package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
- package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
- package/flow/{use-subscription.js → use-sync-external-store.js} +4 -4
- package/index.js +30 -25
- package/index.win32.js +30 -25
- package/jest/preprocessor.js +24 -107
- package/jest/preprocessor_DO_NOT_USE.js +122 -0
- package/metro.config.js +3 -47
- package/overrides.json +39 -46
- package/package.json +32 -29
- package/rntypes/index.d.ts +19 -7
- package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +1 -1
- package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +3 -1
- package/src/Libraries/Components/View/ViewWin32.Props.ts +1 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +427 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap +391 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +3 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +4565 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedSectionList-test.js.snap +1153 -0
- package/src/rntypes/index.d.ts +19 -7
- package/typings-index.js +5 -1
- package/typings-index.js.map +1 -1
- package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.js +0 -45
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
- package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +0 -401
- package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
- package/Libraries/ReactNative/UIManagerInjection.js +0 -15
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
- package/flow/Promise.js +0 -47
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @flow
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import PlatformBaseViewConfig from '../NativeComponent/PlatformBaseViewConfig';
|
|
12
12
|
import {type ViewConfig} from '../Renderer/shims/ReactNativeTypes';
|
|
13
13
|
|
|
14
14
|
const IGNORED_KEYS = ['transform', 'hitSlop'];
|
|
@@ -62,7 +62,7 @@ export default function verifyComponentAttributeEquivalence(
|
|
|
62
62
|
|
|
63
63
|
// Return the different key-value pairs of the right object, by iterating through the keys in the left object
|
|
64
64
|
// Note it won't return a difference where a key is missing in the left but exists the right.
|
|
65
|
-
|
|
65
|
+
function lefthandObjectDiff(leftObj: Object, rightObj: Object): Object {
|
|
66
66
|
const differentKeys = {};
|
|
67
67
|
|
|
68
68
|
function compare(leftItem: any, rightItem: any, key: string) {
|
|
@@ -109,7 +109,7 @@ export function getConfigWithoutViewProps(
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
return Object.keys(viewConfig[propName])
|
|
112
|
-
.filter(prop => !
|
|
112
|
+
.filter(prop => !PlatformBaseViewConfig[propName][prop])
|
|
113
113
|
.reduce((obj, prop) => {
|
|
114
114
|
obj[prop] = viewConfig[propName][prop];
|
|
115
115
|
return obj;
|
|
@@ -230,7 +230,7 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
|
|
|
230
230
|
if (ev.id !== this._socketId) {
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
|
-
let data = ev.data;
|
|
233
|
+
let data: Blob | BlobData | ArrayBuffer | string = ev.data;
|
|
234
234
|
switch (ev.type) {
|
|
235
235
|
case 'binary':
|
|
236
236
|
data = base64.toByteArray(ev.data).buffer;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type EventEmitter from './EventEmitter';
|
|
14
14
|
import _EventSubscription from './_EventSubscription';
|
|
15
15
|
import type EventSubscriptionVendor from './_EventSubscriptionVendor';
|
|
16
|
-
import
|
|
16
|
+
import type {EventSubscription} from './EventSubscription';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* EmitterSubscription represents a subscription with listener and context data.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const invariant = require('invariant');
|
|
13
13
|
|
|
14
14
|
import EmitterSubscription from './_EmitterSubscription';
|
|
15
|
-
import
|
|
15
|
+
import type {EventSubscription} from './EventSubscription';
|
|
16
16
|
import EventSubscriptionVendor from './_EventSubscriptionVendor';
|
|
17
17
|
|
|
18
18
|
const sparseFilterPredicate = () => true;
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
declare module 'use-
|
|
15
|
-
declare export function
|
|
16
|
-
getCurrentValue: () => Value,
|
|
14
|
+
declare module 'use-sync-external-store/shim' {
|
|
15
|
+
declare export function useSyncExternalStore<Value>(
|
|
17
16
|
subscribe: (callback: Function) => () => void,
|
|
18
|
-
|
|
17
|
+
getCurrentValue: () => Value,
|
|
18
|
+
): Value;
|
|
19
19
|
}
|
package/index.js
CHANGED
|
@@ -30,7 +30,6 @@ import typeof RefreshControl from './Libraries/Components/RefreshControl/Refresh
|
|
|
30
30
|
import typeof SafeAreaView from './Libraries/Components/SafeAreaView/SafeAreaView';
|
|
31
31
|
import typeof ScrollView from './Libraries/Components/ScrollView/ScrollView';
|
|
32
32
|
import typeof SectionList from './Libraries/Lists/SectionList';
|
|
33
|
-
import typeof SegmentedControlIOS from './Libraries/Components/SegmentedControlIOS/SegmentedControlIOS';
|
|
34
33
|
import typeof Slider from './Libraries/Components/Slider/Slider';
|
|
35
34
|
import typeof StatusBar from './Libraries/Components/StatusBar/StatusBar';
|
|
36
35
|
import typeof Switch from './Libraries/Components/Switch/Switch';
|
|
@@ -193,16 +192,6 @@ module.exports = {
|
|
|
193
192
|
get SectionList(): SectionList {
|
|
194
193
|
return require('./Libraries/Lists/SectionList').default;
|
|
195
194
|
},
|
|
196
|
-
// $FlowFixMe[value-as-type]
|
|
197
|
-
get SegmentedControlIOS(): SegmentedControlIOS {
|
|
198
|
-
warnOnce(
|
|
199
|
-
'segmented-control-ios-moved',
|
|
200
|
-
'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' +
|
|
201
|
-
"It can now be installed and imported from '@react-native-segmented-control/segmented-control' instead of 'react-native'. " +
|
|
202
|
-
'See https://github.com/react-native-segmented-control/segmented-control',
|
|
203
|
-
);
|
|
204
|
-
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
|
|
205
|
-
},
|
|
206
195
|
get Slider(): Slider {
|
|
207
196
|
warnOnce(
|
|
208
197
|
'slider-moved',
|
|
@@ -446,32 +435,32 @@ module.exports = {
|
|
|
446
435
|
},
|
|
447
436
|
// Deprecated Prop Types
|
|
448
437
|
get ColorPropType(): $FlowFixMe {
|
|
449
|
-
|
|
450
|
-
|
|
438
|
+
invariant(
|
|
439
|
+
false,
|
|
440
|
+
'ColorPropType has been removed from React Native. Migrate to ' +
|
|
451
441
|
"ColorPropType exported from 'deprecated-react-native-prop-types'.",
|
|
452
442
|
);
|
|
453
|
-
return require('deprecated-react-native-prop-types').ColorPropType;
|
|
454
443
|
},
|
|
455
444
|
get EdgeInsetsPropType(): $FlowFixMe {
|
|
456
|
-
|
|
457
|
-
|
|
445
|
+
invariant(
|
|
446
|
+
false,
|
|
447
|
+
'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
|
|
458
448
|
"EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
|
|
459
449
|
);
|
|
460
|
-
return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
|
|
461
450
|
},
|
|
462
451
|
get PointPropType(): $FlowFixMe {
|
|
463
|
-
|
|
464
|
-
|
|
452
|
+
invariant(
|
|
453
|
+
false,
|
|
454
|
+
'PointPropType has been removed from React Native. Migrate to ' +
|
|
465
455
|
"PointPropType exported from 'deprecated-react-native-prop-types'.",
|
|
466
456
|
);
|
|
467
|
-
return require('deprecated-react-native-prop-types').PointPropType;
|
|
468
457
|
},
|
|
469
458
|
get ViewPropTypes(): $FlowFixMe {
|
|
470
|
-
|
|
471
|
-
|
|
459
|
+
invariant(
|
|
460
|
+
false,
|
|
461
|
+
'ViewPropTypes has been removed from React Native. Migrate to ' +
|
|
472
462
|
"ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
|
|
473
463
|
);
|
|
474
|
-
return require('deprecated-react-native-prop-types').ViewPropTypes;
|
|
475
464
|
},
|
|
476
465
|
};
|
|
477
466
|
|
|
@@ -647,8 +636,8 @@ if (__DEV__) {
|
|
|
647
636
|
invariant(
|
|
648
637
|
false,
|
|
649
638
|
'ViewPagerAndroid has been removed from React Native. ' +
|
|
650
|
-
"It can now be installed and imported from '
|
|
651
|
-
'See https://github.com/callstack/react-native-
|
|
639
|
+
"It can now be installed and imported from 'react-native-pager-view' instead of 'react-native'. " +
|
|
640
|
+
'See https://github.com/callstack/react-native-pager-view',
|
|
652
641
|
);
|
|
653
642
|
},
|
|
654
643
|
});
|
|
@@ -669,6 +658,22 @@ if (__DEV__) {
|
|
|
669
658
|
},
|
|
670
659
|
});
|
|
671
660
|
|
|
661
|
+
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
|
|
662
|
+
* attempting to access SegmentedControlIOS. */
|
|
663
|
+
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
|
|
664
|
+
* attempting to access SegmentedControlIOS. */
|
|
665
|
+
Object.defineProperty(module.exports, 'SegmentedControlIOS', {
|
|
666
|
+
configurable: true,
|
|
667
|
+
get() {
|
|
668
|
+
invariant(
|
|
669
|
+
false,
|
|
670
|
+
'SegmentedControlIOS has been removed from React Native. ' +
|
|
671
|
+
"It can now be installed and imported from '@react-native-community/segmented-checkbox' instead of 'react-native'." +
|
|
672
|
+
'See https://github.com/react-native-segmented-control/segmented-control',
|
|
673
|
+
);
|
|
674
|
+
},
|
|
675
|
+
});
|
|
676
|
+
|
|
672
677
|
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
|
|
673
678
|
* attempting to access StatusBarIOS. */
|
|
674
679
|
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
|
package/index.win32.js
CHANGED
|
@@ -30,7 +30,6 @@ import typeof RefreshControl from './Libraries/Components/RefreshControl/Refresh
|
|
|
30
30
|
import typeof SafeAreaView from './Libraries/Components/SafeAreaView/SafeAreaView';
|
|
31
31
|
import typeof ScrollView from './Libraries/Components/ScrollView/ScrollView';
|
|
32
32
|
import typeof SectionList from './Libraries/Lists/SectionList';
|
|
33
|
-
import typeof SegmentedControlIOS from './Libraries/Components/SegmentedControlIOS/SegmentedControlIOS';
|
|
34
33
|
import typeof Slider from './Libraries/Components/Slider/Slider';
|
|
35
34
|
import typeof StatusBar from './Libraries/Components/StatusBar/StatusBar';
|
|
36
35
|
import typeof Switch from './Libraries/Components/Switch/Switch';
|
|
@@ -197,16 +196,6 @@ module.exports = {
|
|
|
197
196
|
get SectionList(): SectionList {
|
|
198
197
|
return require('./Libraries/Lists/SectionList').default;
|
|
199
198
|
},
|
|
200
|
-
// $FlowFixMe[value-as-type]
|
|
201
|
-
get SegmentedControlIOS(): SegmentedControlIOS {
|
|
202
|
-
warnOnce(
|
|
203
|
-
'segmented-control-ios-moved',
|
|
204
|
-
'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' +
|
|
205
|
-
"It can now be installed and imported from '@react-native-segmented-control/segmented-control' instead of 'react-native'. " +
|
|
206
|
-
'See https://github.com/react-native-segmented-control/segmented-control',
|
|
207
|
-
);
|
|
208
|
-
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
|
|
209
|
-
},
|
|
210
199
|
get Slider(): Slider {
|
|
211
200
|
warnOnce(
|
|
212
201
|
'slider-moved',
|
|
@@ -456,32 +445,32 @@ module.exports = {
|
|
|
456
445
|
},
|
|
457
446
|
// Deprecated Prop Types
|
|
458
447
|
get ColorPropType(): $FlowFixMe {
|
|
459
|
-
|
|
460
|
-
|
|
448
|
+
invariant(
|
|
449
|
+
false,
|
|
450
|
+
'ColorPropType has been removed from React Native. Migrate to ' +
|
|
461
451
|
"ColorPropType exported from 'deprecated-react-native-prop-types'.",
|
|
462
452
|
);
|
|
463
|
-
return require('deprecated-react-native-prop-types').ColorPropType;
|
|
464
453
|
},
|
|
465
454
|
get EdgeInsetsPropType(): $FlowFixMe {
|
|
466
|
-
|
|
467
|
-
|
|
455
|
+
invariant(
|
|
456
|
+
false,
|
|
457
|
+
'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
|
|
468
458
|
"EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
|
|
469
459
|
);
|
|
470
|
-
return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
|
|
471
460
|
},
|
|
472
461
|
get PointPropType(): $FlowFixMe {
|
|
473
|
-
|
|
474
|
-
|
|
462
|
+
invariant(
|
|
463
|
+
false,
|
|
464
|
+
'PointPropType has been removed from React Native. Migrate to ' +
|
|
475
465
|
"PointPropType exported from 'deprecated-react-native-prop-types'.",
|
|
476
466
|
);
|
|
477
|
-
return require('deprecated-react-native-prop-types').PointPropType;
|
|
478
467
|
},
|
|
479
468
|
get ViewPropTypes(): $FlowFixMe {
|
|
480
|
-
|
|
481
|
-
|
|
469
|
+
invariant(
|
|
470
|
+
false,
|
|
471
|
+
'ViewPropTypes has been removed from React Native. Migrate to ' +
|
|
482
472
|
"ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
|
|
483
473
|
);
|
|
484
|
-
return require('deprecated-react-native-prop-types').ViewPropTypes;
|
|
485
474
|
},
|
|
486
475
|
// Win32 Types (Typescript components exported as flow any)
|
|
487
476
|
get ColorGradientWin32(): ColorGradientWin32 {
|
|
@@ -685,8 +674,8 @@ if (__DEV__) {
|
|
|
685
674
|
invariant(
|
|
686
675
|
false,
|
|
687
676
|
'ViewPagerAndroid has been removed from React Native. ' +
|
|
688
|
-
"It can now be installed and imported from '
|
|
689
|
-
'See https://github.com/callstack/react-native-
|
|
677
|
+
"It can now be installed and imported from 'react-native-pager-view' instead of 'react-native'. " +
|
|
678
|
+
'See https://github.com/callstack/react-native-pager-view',
|
|
690
679
|
);
|
|
691
680
|
},
|
|
692
681
|
});
|
|
@@ -707,6 +696,22 @@ if (__DEV__) {
|
|
|
707
696
|
},
|
|
708
697
|
});
|
|
709
698
|
|
|
699
|
+
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
|
|
700
|
+
* attempting to access SegmentedControlIOS. */
|
|
701
|
+
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
|
|
702
|
+
* attempting to access SegmentedControlIOS. */
|
|
703
|
+
Object.defineProperty(module.exports, 'SegmentedControlIOS', {
|
|
704
|
+
configurable: true,
|
|
705
|
+
get() {
|
|
706
|
+
invariant(
|
|
707
|
+
false,
|
|
708
|
+
'SegmentedControlIOS has been removed from React Native. ' +
|
|
709
|
+
"It can now be installed and imported from '@react-native-community/segmented-checkbox' instead of 'react-native'." +
|
|
710
|
+
'See https://github.com/react-native-segmented-control/segmented-control',
|
|
711
|
+
);
|
|
712
|
+
},
|
|
713
|
+
});
|
|
714
|
+
|
|
710
715
|
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
|
|
711
716
|
* attempting to access StatusBarIOS. */
|
|
712
717
|
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
|
package/jest/preprocessor.js
CHANGED
|
@@ -12,112 +12,29 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
// NOTE: Avoiding using a package like 'chalk' here, for simplicity
|
|
16
|
+
const YELLOW = process.stderr.isTTY ? '\u001b[33m' : '';
|
|
17
|
+
const BOLD = process.stderr.isTTY ? '\u001b[1m' : '';
|
|
18
|
+
const RESET = process.stderr.isTTY ? '\u001b[0m' : '';
|
|
19
|
+
const UNDERLINE = process.stderr.isTTY ? '\u001b[4m' : '';
|
|
20
|
+
|
|
21
|
+
console.warn(
|
|
22
|
+
'\n' +
|
|
23
|
+
YELLOW +
|
|
24
|
+
BOLD +
|
|
25
|
+
'react-native/jest/preprocessor.js' +
|
|
26
|
+
RESET +
|
|
27
|
+
YELLOW +
|
|
28
|
+
' is deprecated and will be removed.\n' +
|
|
29
|
+
'Use "preset": "react-native" in your Jest config instead.\n' +
|
|
30
|
+
'See ' +
|
|
31
|
+
UNDERLINE +
|
|
32
|
+
'https://jestjs.io/docs/tutorial-react-native' +
|
|
33
|
+
RESET +
|
|
34
|
+
YELLOW +
|
|
35
|
+
' for more setup instructions.' +
|
|
36
|
+
RESET +
|
|
37
|
+
'\n',
|
|
26
38
|
);
|
|
27
|
-
const nodeOptions = babelRegisterOnly.config([nodeFiles]);
|
|
28
|
-
|
|
29
|
-
babelRegisterOnly([]);
|
|
30
|
-
|
|
31
|
-
const transformer = require('metro-react-native-babel-transformer');
|
|
32
|
-
module.exports = {
|
|
33
|
-
process(src /*: string */, file /*: string */) /*: string */ {
|
|
34
|
-
if (nodeFiles.test(file)) {
|
|
35
|
-
// node specific transforms only
|
|
36
|
-
return babelTransformSync(src, {
|
|
37
|
-
filename: file,
|
|
38
|
-
sourceType: 'script',
|
|
39
|
-
...nodeOptions,
|
|
40
|
-
ast: false,
|
|
41
|
-
}).code;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const {ast} = transformer.transform({
|
|
45
|
-
filename: file,
|
|
46
|
-
options: {
|
|
47
|
-
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
|
|
48
|
-
dev: true,
|
|
49
|
-
enableBabelRuntime: false,
|
|
50
|
-
experimentalImportSupport: false,
|
|
51
|
-
globalPrefix: '',
|
|
52
|
-
hot: false,
|
|
53
|
-
inlineRequires: true,
|
|
54
|
-
minify: false,
|
|
55
|
-
platform: '',
|
|
56
|
-
projectRoot: '',
|
|
57
|
-
publicPath: '/assets',
|
|
58
|
-
retainLines: true,
|
|
59
|
-
sourceType: 'unambiguous', // b7 required. detects module vs script mode
|
|
60
|
-
},
|
|
61
|
-
src,
|
|
62
|
-
plugins: [
|
|
63
|
-
[require('@babel/plugin-transform-block-scoping')],
|
|
64
|
-
// the flow strip types plugin must go BEFORE class properties!
|
|
65
|
-
// there'll be a test case that fails if you don't.
|
|
66
|
-
[require('@babel/plugin-transform-flow-strip-types')],
|
|
67
|
-
[
|
|
68
|
-
require('@babel/plugin-proposal-class-properties'),
|
|
69
|
-
// use `this.foo = bar` instead of `this.defineProperty('foo', ...)`
|
|
70
|
-
{loose: true},
|
|
71
|
-
],
|
|
72
|
-
[require('@babel/plugin-transform-computed-properties')],
|
|
73
|
-
[require('@babel/plugin-transform-destructuring')],
|
|
74
|
-
[require('@babel/plugin-transform-function-name')],
|
|
75
|
-
[require('@babel/plugin-transform-literals')],
|
|
76
|
-
[require('@babel/plugin-transform-parameters')],
|
|
77
|
-
[require('@babel/plugin-transform-shorthand-properties')],
|
|
78
|
-
[require('@babel/plugin-transform-react-jsx')],
|
|
79
|
-
[require('@babel/plugin-transform-regenerator')],
|
|
80
|
-
[require('@babel/plugin-transform-sticky-regex')],
|
|
81
|
-
[require('@babel/plugin-transform-unicode-regex')],
|
|
82
|
-
[
|
|
83
|
-
require('@babel/plugin-transform-modules-commonjs'),
|
|
84
|
-
{strict: false, allowTopLevelThis: true},
|
|
85
|
-
],
|
|
86
|
-
[require('@babel/plugin-transform-classes')],
|
|
87
|
-
[require('@babel/plugin-transform-arrow-functions')],
|
|
88
|
-
[require('@babel/plugin-transform-spread')],
|
|
89
|
-
[require('@babel/plugin-proposal-object-rest-spread')],
|
|
90
|
-
[
|
|
91
|
-
require('@babel/plugin-transform-template-literals'),
|
|
92
|
-
{loose: true}, // dont 'a'.concat('b'), just use 'a'+'b'
|
|
93
|
-
],
|
|
94
|
-
[require('@babel/plugin-transform-exponentiation-operator')],
|
|
95
|
-
[require('@babel/plugin-transform-object-assign')],
|
|
96
|
-
[require('@babel/plugin-transform-for-of'), {loose: true}],
|
|
97
|
-
[require('@babel/plugin-transform-react-display-name')],
|
|
98
|
-
[require('@babel/plugin-transform-react-jsx-source')],
|
|
99
|
-
],
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
return generate(
|
|
103
|
-
ast,
|
|
104
|
-
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
|
105
|
-
{
|
|
106
|
-
code: true,
|
|
107
|
-
comments: false,
|
|
108
|
-
compact: false,
|
|
109
|
-
filename: file,
|
|
110
|
-
retainLines: true,
|
|
111
|
-
sourceFileName: file,
|
|
112
|
-
sourceMaps: true,
|
|
113
|
-
},
|
|
114
|
-
src,
|
|
115
|
-
).code;
|
|
116
|
-
},
|
|
117
39
|
|
|
118
|
-
|
|
119
|
-
__filename,
|
|
120
|
-
require.resolve('metro-react-native-babel-transformer'),
|
|
121
|
-
require.resolve('@babel/core/package.json'),
|
|
122
|
-
]) /*: any */),
|
|
123
|
-
};
|
|
40
|
+
module.exports = require('./preprocessor_DO_NOT_USE');
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @flow
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* eslint-env node */
|
|
12
|
+
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
const babelRegisterOnly = require('metro-babel-register');
|
|
16
|
+
const createCacheKeyFunction =
|
|
17
|
+
require('@jest/create-cache-key-function').default;
|
|
18
|
+
|
|
19
|
+
const {transformSync: babelTransformSync} = require('@babel/core');
|
|
20
|
+
const generate = require('@babel/generator').default;
|
|
21
|
+
|
|
22
|
+
const nodeFiles = new RegExp(
|
|
23
|
+
[
|
|
24
|
+
'/metro(?:-[^/]*)?/', // metro, metro-core, metro-source-map, metro-etc.
|
|
25
|
+
].join('|'),
|
|
26
|
+
);
|
|
27
|
+
const nodeOptions = babelRegisterOnly.config([nodeFiles]);
|
|
28
|
+
|
|
29
|
+
babelRegisterOnly([]);
|
|
30
|
+
|
|
31
|
+
const transformer = require('metro-react-native-babel-transformer');
|
|
32
|
+
module.exports = {
|
|
33
|
+
process(src /*: string */, file /*: string */) /*: {code: string, ...} */ {
|
|
34
|
+
if (nodeFiles.test(file)) {
|
|
35
|
+
// node specific transforms only
|
|
36
|
+
return babelTransformSync(src, {
|
|
37
|
+
filename: file,
|
|
38
|
+
sourceType: 'script',
|
|
39
|
+
...nodeOptions,
|
|
40
|
+
ast: false,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const {ast} = transformer.transform({
|
|
45
|
+
filename: file,
|
|
46
|
+
options: {
|
|
47
|
+
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
|
|
48
|
+
dev: true,
|
|
49
|
+
enableBabelRuntime: false,
|
|
50
|
+
experimentalImportSupport: false,
|
|
51
|
+
globalPrefix: '',
|
|
52
|
+
hot: false,
|
|
53
|
+
inlineRequires: true,
|
|
54
|
+
minify: false,
|
|
55
|
+
platform: '',
|
|
56
|
+
projectRoot: '',
|
|
57
|
+
publicPath: '/assets',
|
|
58
|
+
retainLines: true,
|
|
59
|
+
sourceType: 'unambiguous', // b7 required. detects module vs script mode
|
|
60
|
+
},
|
|
61
|
+
src,
|
|
62
|
+
plugins: [
|
|
63
|
+
[require('@babel/plugin-transform-block-scoping')],
|
|
64
|
+
// the flow strip types plugin must go BEFORE class properties!
|
|
65
|
+
// there'll be a test case that fails if you don't.
|
|
66
|
+
[require('@babel/plugin-transform-flow-strip-types')],
|
|
67
|
+
[
|
|
68
|
+
require('@babel/plugin-proposal-class-properties'),
|
|
69
|
+
// use `this.foo = bar` instead of `this.defineProperty('foo', ...)`
|
|
70
|
+
{loose: true},
|
|
71
|
+
],
|
|
72
|
+
[require('@babel/plugin-transform-computed-properties')],
|
|
73
|
+
[require('@babel/plugin-transform-destructuring')],
|
|
74
|
+
[require('@babel/plugin-transform-function-name')],
|
|
75
|
+
[require('@babel/plugin-transform-literals')],
|
|
76
|
+
[require('@babel/plugin-transform-parameters')],
|
|
77
|
+
[require('@babel/plugin-transform-shorthand-properties')],
|
|
78
|
+
[require('@babel/plugin-transform-react-jsx')],
|
|
79
|
+
[require('@babel/plugin-transform-regenerator')],
|
|
80
|
+
[require('@babel/plugin-transform-sticky-regex')],
|
|
81
|
+
[require('@babel/plugin-transform-unicode-regex')],
|
|
82
|
+
[
|
|
83
|
+
require('@babel/plugin-transform-modules-commonjs'),
|
|
84
|
+
{strict: false, allowTopLevelThis: true},
|
|
85
|
+
],
|
|
86
|
+
[require('@babel/plugin-transform-classes')],
|
|
87
|
+
[require('@babel/plugin-transform-arrow-functions')],
|
|
88
|
+
[require('@babel/plugin-transform-spread')],
|
|
89
|
+
[require('@babel/plugin-proposal-object-rest-spread')],
|
|
90
|
+
[
|
|
91
|
+
require('@babel/plugin-transform-template-literals'),
|
|
92
|
+
{loose: true}, // dont 'a'.concat('b'), just use 'a'+'b'
|
|
93
|
+
],
|
|
94
|
+
[require('@babel/plugin-transform-exponentiation-operator')],
|
|
95
|
+
[require('@babel/plugin-transform-for-of'), {loose: true}],
|
|
96
|
+
[require('@babel/plugin-transform-react-display-name')],
|
|
97
|
+
[require('@babel/plugin-transform-react-jsx-source')],
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return generate(
|
|
102
|
+
ast,
|
|
103
|
+
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
|
104
|
+
{
|
|
105
|
+
code: true,
|
|
106
|
+
comments: false,
|
|
107
|
+
compact: false,
|
|
108
|
+
filename: file,
|
|
109
|
+
retainLines: true,
|
|
110
|
+
sourceFileName: file,
|
|
111
|
+
sourceMaps: true,
|
|
112
|
+
},
|
|
113
|
+
src,
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
getCacheKey: (createCacheKeyFunction([
|
|
118
|
+
__filename,
|
|
119
|
+
require.resolve('metro-react-native-babel-transformer'),
|
|
120
|
+
require.resolve('@babel/core/package.json'),
|
|
121
|
+
]) /*: any */),
|
|
122
|
+
};
|
package/metro.config.js
CHANGED
|
@@ -1,53 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @format
|
|
3
|
-
*/
|
|
4
1
|
const fs = require('fs');
|
|
5
2
|
const path = require('path');
|
|
6
3
|
|
|
7
|
-
const rnWin32Path = fs.realpathSync(
|
|
8
|
-
path.dirname(require.resolve('@office-iss/react-native-win32/package.json')),
|
|
9
|
-
);
|
|
10
|
-
const rnwTesterPath = fs.realpathSync(
|
|
11
|
-
path.dirname(
|
|
12
|
-
require.resolve('@office-iss/react-native-win32-tester/package.json'),
|
|
13
|
-
),
|
|
14
|
-
);
|
|
15
|
-
const virtualizedListPath = fs.realpathSync(
|
|
16
|
-
path.resolve(
|
|
17
|
-
require.resolve('@react-native-windows/virtualized-list/package.json'),
|
|
18
|
-
'..',
|
|
19
|
-
),
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
module.exports = {
|
|
23
|
-
// WatchFolders is only needed due to the yarn workspace layout of node_modules, we need to watch the symlinked locations separately
|
|
24
|
-
watchFolders: [
|
|
25
|
-
// Include hoisted modules
|
|
26
|
-
path.resolve(__dirname, '../../../node_modules'),
|
|
27
|
-
rnwTesterPath,
|
|
28
|
-
rnWin32Path,
|
|
29
|
-
// Add virtualized-list dependency, whose unsymlinked representation is not in node_modules, only in our repo
|
|
30
|
-
virtualizedListPath,
|
|
31
|
-
],
|
|
32
|
-
|
|
33
|
-
resolver: {
|
|
34
|
-
extraNodeModules: {
|
|
35
|
-
'@office-iss/react-native-win32': rnWin32Path,
|
|
36
|
-
'react-native-win32-tester': rnwTesterPath,
|
|
37
|
-
'@react-native-windows/virtualized-list': virtualizedListPath,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
transformer: {
|
|
42
|
-
getTransformOptions: async () => ({
|
|
43
|
-
transform: {
|
|
44
|
-
experimentalImportSupport: false,
|
|
45
|
-
inlineRequires: true,
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
4
|
// Check that we have built our JS files before running the bundler, otherwise we'll get a harder to diagnose "Unable to resolve module" error
|
|
52
5
|
if (
|
|
53
6
|
!fs.existsSync(
|
|
@@ -58,3 +11,6 @@ if (
|
|
|
58
11
|
'[31m\nThis package must be built before running the bundler. Did you mean to run "[39m[33myarn build[39m[31m" first?[39m\n',
|
|
59
12
|
);
|
|
60
13
|
}
|
|
14
|
+
|
|
15
|
+
const {makeMetroConfig} = require('@rnw-scripts/metro-dev-config');
|
|
16
|
+
module.exports = makeMetroConfig();
|