@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
|
@@ -13,41 +13,51 @@
|
|
|
13
13
|
import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes';
|
|
14
14
|
import {unstable_hasComponent} from 'react-native/Libraries/NativeComponent/NativeComponentRegistryUnstable';
|
|
15
15
|
|
|
16
|
+
const errorMessageForMethod = (methodName: string): string =>
|
|
17
|
+
"[ReactNative Architecture][JS] '" +
|
|
18
|
+
methodName +
|
|
19
|
+
"' is not available in the new React Native architecture.";
|
|
20
|
+
|
|
16
21
|
module.exports = {
|
|
17
22
|
getViewManagerConfig: (viewManagerName: string): mixed => {
|
|
18
|
-
console.
|
|
19
|
-
'getViewManagerConfig
|
|
23
|
+
console.error(
|
|
24
|
+
errorMessageForMethod('getViewManagerConfig') +
|
|
25
|
+
'Use hasViewManagerConfig instead. viewManagerName: ' +
|
|
20
26
|
viewManagerName,
|
|
21
27
|
);
|
|
22
|
-
if (viewManagerName === 'RCTVirtualText') {
|
|
23
|
-
return {};
|
|
24
|
-
}
|
|
25
28
|
return null;
|
|
26
29
|
},
|
|
27
30
|
hasViewManagerConfig: (viewManagerName: string): boolean => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
31
|
+
return unstable_hasComponent(viewManagerName);
|
|
32
|
+
},
|
|
33
|
+
getConstants: (): Object => {
|
|
34
|
+
console.error(errorMessageForMethod('getConstants'));
|
|
35
|
+
return {};
|
|
36
|
+
},
|
|
37
|
+
getConstantsForViewManager: (viewManagerName: string): Object => {
|
|
38
|
+
console.error(errorMessageForMethod('getConstantsForViewManager'));
|
|
39
|
+
return {};
|
|
40
|
+
},
|
|
41
|
+
getDefaultEventTypes: (): Array<string> => {
|
|
42
|
+
console.error(errorMessageForMethod('getDefaultEventTypes'));
|
|
43
|
+
return [];
|
|
44
|
+
},
|
|
45
|
+
lazilyLoadView: (name: string): Object => {
|
|
46
|
+
console.error(errorMessageForMethod('lazilyLoadView'));
|
|
47
|
+
return {};
|
|
37
48
|
},
|
|
38
|
-
getConstants: (): {...} => ({}),
|
|
39
|
-
getConstantsForViewManager: (viewManagerName: string) => {},
|
|
40
|
-
getDefaultEventTypes: (): Array<$FlowFixMe> => [],
|
|
41
|
-
lazilyLoadView: (name: string) => {},
|
|
42
49
|
createView: (
|
|
43
50
|
reactTag: ?number,
|
|
44
51
|
viewName: string,
|
|
45
52
|
rootTag: RootTag,
|
|
46
53
|
props: Object,
|
|
47
|
-
) =>
|
|
48
|
-
updateView: (reactTag: number, viewName: string, props: Object) =>
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
): void => console.error(errorMessageForMethod('createView')),
|
|
55
|
+
updateView: (reactTag: number, viewName: string, props: Object): void =>
|
|
56
|
+
console.error(errorMessageForMethod('updateView')),
|
|
57
|
+
focus: (reactTag: ?number): void =>
|
|
58
|
+
console.error(errorMessageForMethod('focus')),
|
|
59
|
+
blur: (reactTag: ?number): void =>
|
|
60
|
+
console.error(errorMessageForMethod('blur')),
|
|
51
61
|
findSubviewIn: (
|
|
52
62
|
reactTag: ?number,
|
|
53
63
|
point: Array<number>,
|
|
@@ -58,12 +68,12 @@ module.exports = {
|
|
|
58
68
|
width: number,
|
|
59
69
|
height: number,
|
|
60
70
|
) => void,
|
|
61
|
-
) =>
|
|
71
|
+
): void => console.error(errorMessageForMethod('findSubviewIn')),
|
|
62
72
|
dispatchViewManagerCommand: (
|
|
63
73
|
reactTag: ?number,
|
|
64
74
|
commandID: number,
|
|
65
75
|
commandArgs: ?Array<string | number | boolean>,
|
|
66
|
-
) =>
|
|
76
|
+
): void => console.error(errorMessageForMethod('dispatchViewManagerCommand')),
|
|
67
77
|
measure: (
|
|
68
78
|
reactTag: ?number,
|
|
69
79
|
callback: (
|
|
@@ -74,16 +84,16 @@ module.exports = {
|
|
|
74
84
|
pageX: number,
|
|
75
85
|
pageY: number,
|
|
76
86
|
) => void,
|
|
77
|
-
) =>
|
|
87
|
+
): void => console.error(errorMessageForMethod('measure')),
|
|
78
88
|
measureInWindow: (
|
|
79
89
|
reactTag: ?number,
|
|
80
90
|
callback: (x: number, y: number, width: number, height: number) => void,
|
|
81
|
-
) =>
|
|
91
|
+
): void => console.error(errorMessageForMethod('measureInWindow')),
|
|
82
92
|
viewIsDescendantOf: (
|
|
83
93
|
reactTag: ?number,
|
|
84
94
|
ancestorReactTag: ?number,
|
|
85
95
|
callback: (result: Array<boolean>) => void,
|
|
86
|
-
) =>
|
|
96
|
+
): void => console.error(errorMessageForMethod('viewIsDescendantOf')),
|
|
87
97
|
measureLayout: (
|
|
88
98
|
reactTag: ?number,
|
|
89
99
|
ancestorReactTag: ?number,
|
|
@@ -94,7 +104,7 @@ module.exports = {
|
|
|
94
104
|
width: number,
|
|
95
105
|
height: number,
|
|
96
106
|
) => void,
|
|
97
|
-
) =>
|
|
107
|
+
): void => console.error(errorMessageForMethod('measureLayout')),
|
|
98
108
|
measureLayoutRelativeToParent: (
|
|
99
109
|
reactTag: ?number,
|
|
100
110
|
errorCallback: (error: Object) => void,
|
|
@@ -104,17 +114,23 @@ module.exports = {
|
|
|
104
114
|
width: number,
|
|
105
115
|
height: number,
|
|
106
116
|
) => void,
|
|
107
|
-
) =>
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
): void =>
|
|
118
|
+
console.error(errorMessageForMethod('measureLayoutRelativeToParent')),
|
|
119
|
+
setJSResponder: (reactTag: ?number, blockNativeResponder: boolean): void =>
|
|
120
|
+
console.error(errorMessageForMethod('setJSResponder')),
|
|
121
|
+
clearJSResponder: (): void => {}, // Don't log error here because we're aware it gets called
|
|
110
122
|
configureNextLayoutAnimation: (
|
|
111
123
|
config: Object,
|
|
112
124
|
callback: () => void,
|
|
113
125
|
errorCallback: (error: Object) => void,
|
|
114
|
-
) =>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
126
|
+
): void =>
|
|
127
|
+
console.error(errorMessageForMethod('configureNextLayoutAnimation')),
|
|
128
|
+
removeSubviewsFromContainerWithID: (containerID: number): void =>
|
|
129
|
+
console.error(errorMessageForMethod('removeSubviewsFromContainerWithID')),
|
|
130
|
+
replaceExistingNonRootView: (reactTag: ?number, newReactTag: ?number): void =>
|
|
131
|
+
console.error(errorMessageForMethod('replaceExistingNonRootView')),
|
|
132
|
+
setChildren: (containerTag: ?number, reactTags: Array<number>): void =>
|
|
133
|
+
console.error(errorMessageForMethod('setChildren')),
|
|
118
134
|
manageChildren: (
|
|
119
135
|
containerTag: ?number,
|
|
120
136
|
moveFromIndices: Array<number>,
|
|
@@ -122,16 +138,22 @@ module.exports = {
|
|
|
122
138
|
addChildReactTags: Array<number>,
|
|
123
139
|
addAtIndices: Array<number>,
|
|
124
140
|
removeAtIndices: Array<number>,
|
|
125
|
-
) =>
|
|
141
|
+
): void => console.error(errorMessageForMethod('manageChildren')),
|
|
126
142
|
|
|
127
143
|
// Android only
|
|
128
|
-
setLayoutAnimationEnabledExperimental: (enabled: boolean) => {
|
|
129
|
-
|
|
144
|
+
setLayoutAnimationEnabledExperimental: (enabled: boolean): void => {
|
|
145
|
+
console.error(
|
|
146
|
+
errorMessageForMethod('setLayoutAnimationEnabledExperimental'),
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
sendAccessibilityEvent: (reactTag: ?number, eventType: number): void =>
|
|
150
|
+
console.error(errorMessageForMethod('sendAccessibilityEvent')),
|
|
130
151
|
showPopupMenu: (
|
|
131
152
|
reactTag: ?number,
|
|
132
153
|
items: Array<string>,
|
|
133
154
|
error: (error: Object) => void,
|
|
134
155
|
success: (event: string, selected?: number) => void,
|
|
135
|
-
) =>
|
|
136
|
-
dismissPopupMenu: () =>
|
|
156
|
+
): void => console.error(errorMessageForMethod('showPopupMenu')),
|
|
157
|
+
dismissPopupMenu: (): void =>
|
|
158
|
+
console.error(errorMessageForMethod('dismissPopupMenu')),
|
|
137
159
|
};
|
|
@@ -123,7 +123,7 @@ function lazifyViewManagerConfig(viewName) {
|
|
|
123
123
|
const viewManager = NativeModules[viewConfig.Manager];
|
|
124
124
|
const constants = {};
|
|
125
125
|
viewManager &&
|
|
126
|
-
Object.keys(viewManager).forEach(
|
|
126
|
+
Object.keys(viewManager).forEach(key => {
|
|
127
127
|
const value = viewManager[key];
|
|
128
128
|
if (typeof value !== 'function') {
|
|
129
129
|
constants[key] = value;
|
|
@@ -138,7 +138,7 @@ function lazifyViewManagerConfig(viewName) {
|
|
|
138
138
|
const commands = {};
|
|
139
139
|
let index = 0;
|
|
140
140
|
viewManager &&
|
|
141
|
-
Object.keys(viewManager).forEach(
|
|
141
|
+
Object.keys(viewManager).forEach(key => {
|
|
142
142
|
const value = viewManager[key];
|
|
143
143
|
if (typeof value === 'function') {
|
|
144
144
|
commands[key] = index++;
|
|
@@ -156,11 +156,11 @@ function lazifyViewManagerConfig(viewName) {
|
|
|
156
156
|
* namespace instead of UIManager, unlike Android.
|
|
157
157
|
*/
|
|
158
158
|
if (Platform.OS === 'ios') {
|
|
159
|
-
Object.keys(getConstants()).forEach(
|
|
159
|
+
Object.keys(getConstants()).forEach(viewName => {
|
|
160
160
|
lazifyViewManagerConfig(viewName);
|
|
161
161
|
});
|
|
162
162
|
} else if (getConstants().ViewManagerNames) {
|
|
163
|
-
NativeUIManager.getConstants().ViewManagerNames.forEach(
|
|
163
|
+
NativeUIManager.getConstants().ViewManagerNames.forEach(viewManagerName => {
|
|
164
164
|
defineLazyObjectProperty(NativeUIManager, viewManagerName, {
|
|
165
165
|
get: () => NativeUIManager.getConstantsForViewManager(viewManagerName),
|
|
166
166
|
});
|
|
@@ -168,7 +168,7 @@ if (Platform.OS === 'ios') {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
if (!global.nativeCallSyncHook) {
|
|
171
|
-
Object.keys(getConstants()).forEach(
|
|
171
|
+
Object.keys(getConstants()).forEach(viewManagerName => {
|
|
172
172
|
if (!UIManagerProperties.includes(viewManagerName)) {
|
|
173
173
|
if (!viewManagerConfigs[viewManagerName]) {
|
|
174
174
|
viewManagerConfigs[viewManagerName] = getConstants()[viewManagerName];
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
export type FeatureFlags = {|
|
|
14
|
+
/**
|
|
15
|
+
* Function used to enable / disabled Layout Animations in React Native.
|
|
16
|
+
* Default value = true.
|
|
17
|
+
*/
|
|
18
|
+
isLayoutAnimationEnabled: () => boolean,
|
|
19
|
+
/**
|
|
20
|
+
* Function used to enable / disable W3C pointer event emitting in React Native.
|
|
21
|
+
* If enabled you must also flip the equivalent native flags on each platform:
|
|
22
|
+
* iOS -> RCTSetDispatchW3CPointerEvents
|
|
23
|
+
* Android -> ReactFeatureFlags.dispatchPointerEvents
|
|
24
|
+
*/
|
|
25
|
+
shouldEmitW3CPointerEvents: () => boolean,
|
|
26
|
+
/**
|
|
27
|
+
* Function used to enable / disable Pressibility from using W3C Pointer Events
|
|
28
|
+
* for its hover callbacks
|
|
29
|
+
*/
|
|
30
|
+
shouldPressibilityUseW3CPointerEventsForHover: () => boolean,
|
|
31
|
+
|};
|
|
32
|
+
|
|
33
|
+
const ReactNativeFeatureFlags: FeatureFlags = {
|
|
34
|
+
isLayoutAnimationEnabled: () => true,
|
|
35
|
+
shouldEmitW3CPointerEvents: () => false,
|
|
36
|
+
shouldPressibilityUseW3CPointerEventsForHover: () => false,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
module.exports = ReactNativeFeatureFlags;
|
|
@@ -33,8 +33,7 @@ export interface UIManagerJSInterface extends Spec {
|
|
|
33
33
|
|
|
34
34
|
const UIManager: UIManagerJSInterface =
|
|
35
35
|
global.RN$Bridgeless === true
|
|
36
|
-
? require('./
|
|
37
|
-
: require('./
|
|
38
|
-
require('./PaperUIManager');
|
|
36
|
+
? require('./BridgelessUIManager')
|
|
37
|
+
: require('./PaperUIManager');
|
|
39
38
|
|
|
40
39
|
module.exports = UIManager;
|
|
@@ -64,6 +64,10 @@ function renderApplication<Props: Object>(
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
performanceLogger.startTimespan('renderApplication_React_render');
|
|
67
|
+
performanceLogger.setExtra(
|
|
68
|
+
'usedReactConcurrentRoot',
|
|
69
|
+
useConcurrentRoot ? '1' : '0',
|
|
70
|
+
);
|
|
67
71
|
performanceLogger.setExtra('usedReactFabric', fabric ? '1' : '0');
|
|
68
72
|
if (fabric) {
|
|
69
73
|
require('../Renderer/shims/ReactFabric').render(
|
|
@@ -21,6 +21,8 @@ import typeof flattenStyle from '../StyleSheet/flattenStyle';
|
|
|
21
21
|
import {type DangerouslyImpreciseStyleProp} from '../StyleSheet/StyleSheet';
|
|
22
22
|
import typeof ReactFiberErrorDialog from '../Core/ReactFiberErrorDialog';
|
|
23
23
|
import typeof legacySendAccessibilityEvent from '../Components/AccessibilityInfo/legacySendAccessibilityEvent';
|
|
24
|
+
import typeof RawEventEmitter from '../Core/RawEventEmitter';
|
|
25
|
+
import typeof CustomEvent from '../Events/CustomEvent';
|
|
24
26
|
|
|
25
27
|
// flowlint unsafe-getters-setters:off
|
|
26
28
|
module.exports = {
|
|
@@ -62,4 +64,10 @@ module.exports = {
|
|
|
62
64
|
get legacySendAccessibilityEvent(): legacySendAccessibilityEvent {
|
|
63
65
|
return require('../Components/AccessibilityInfo/legacySendAccessibilityEvent');
|
|
64
66
|
},
|
|
67
|
+
get RawEventEmitter(): RawEventEmitter {
|
|
68
|
+
return require('../Core/RawEventEmitter').default;
|
|
69
|
+
},
|
|
70
|
+
get CustomEvent(): CustomEvent {
|
|
71
|
+
return require('../Events/CustomEvent').default;
|
|
72
|
+
},
|
|
65
73
|
};
|