@office-iss/react-native-win32 0.0.0-canary.292 → 0.0.0-canary.293
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/.flowconfig +1 -1
- package/CHANGELOG.json +28 -1
- package/CHANGELOG.md +14 -4
- package/Libraries/Blob/URL.js +13 -1
- package/Libraries/Components/Pressable/Pressable.js +4 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +4 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
- package/Libraries/Components/Switch/Switch.js +7 -3
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -0
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +25 -0
- package/Libraries/Components/TextInput/TextInput.flow.win32.js +25 -1
- package/Libraries/Components/TextInput/TextInput.js +2 -0
- package/Libraries/Components/TextInput/TextInput.win32.js +2 -0
- package/Libraries/Components/View/View.js +18 -21
- package/Libraries/Components/View/View.win32.js +21 -24
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +5 -5
- package/Libraries/Image/ImageProps.js +2 -3
- package/Libraries/Image/ImageSource.js +3 -1
- package/Libraries/Image/ImageSourceUtils.js +4 -2
- package/Libraries/Lists/FlatList.d.ts +2 -2
- package/Libraries/Lists/SectionListModern.js +1 -2
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
- package/Libraries/ReactNative/AppContainer-dev.js +3 -2
- package/Libraries/ReactNative/RendererImplementation.js +6 -5
- package/Libraries/ReactNative/renderApplication.js +9 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
- package/Libraries/Renderer/shims/ReactFabric.js +3 -1
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
- package/Libraries/Renderer/shims/ReactNative.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +47 -3
- package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
- package/Libraries/Text/TextNativeComponent.js +0 -4
- package/Libraries/Text/TextNativeComponent.win32.js +0 -4
- package/index.js +1 -288
- package/index.win32.js +3 -292
- package/overrides.json +11 -11
- package/package.json +15 -15
- package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +5 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +7 -5
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +10 -9
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +13 -11
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +4 -3
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +8 -7
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +9 -8
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +6 -5
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +5 -4
- package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.win32.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
- package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
- package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -17
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -4
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
- package/src/private/types/HostInstance.js +2 -2
- package/types/index.d.ts +1 -1
- package/types/public/ReactNativeTypes.d.ts +2 -2
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
- package/Libraries/Blob/__mocks__/BlobModule.js +0 -16
- package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
- package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
- package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
- package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
- package/jest/__tests__/setup-test.js +0 -18
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
- /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
- /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<074f41df4d09a9053b71cf4255b144a5>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -51,14 +51,15 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
|
|
51
51
|
cxxNativeAnimatedEnabled: Getter<boolean>,
|
|
52
52
|
disableMainQueueSyncDispatchIOS: Getter<boolean>,
|
|
53
53
|
disableMountItemReorderingAndroid: Getter<boolean>,
|
|
54
|
-
disableShadowNodeOnNewArchitectureAndroid: Getter<boolean>,
|
|
55
54
|
enableAccessibilityOrder: Getter<boolean>,
|
|
56
55
|
enableAccumulatedUpdatesInRawPropsAndroid: Getter<boolean>,
|
|
57
56
|
enableBridgelessArchitecture: Getter<boolean>,
|
|
58
57
|
enableCppPropsIteratorSetter: Getter<boolean>,
|
|
58
|
+
enableCustomFocusSearchOnClippedElementsAndroid: Getter<boolean>,
|
|
59
59
|
enableEagerRootViewAttachment: Getter<boolean>,
|
|
60
60
|
enableFabricLogs: Getter<boolean>,
|
|
61
61
|
enableFabricRenderer: Getter<boolean>,
|
|
62
|
+
enableFixForParentTagDuringReparenting: Getter<boolean>,
|
|
62
63
|
enableFontScaleChangesUpdatingLayout: Getter<boolean>,
|
|
63
64
|
enableIOSViewClipToPaddingBox: Getter<boolean>,
|
|
64
65
|
enableJSRuntimeGCOnMemoryPressureOnIOS: Getter<boolean>,
|
|
@@ -68,7 +69,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
|
|
68
69
|
enableNativeCSSParsing: Getter<boolean>,
|
|
69
70
|
enableNewBackgroundAndBorderDrawables: Getter<boolean>,
|
|
70
71
|
enablePropsUpdateReconciliationAndroid: Getter<boolean>,
|
|
71
|
-
enableReportEventPaintTime: Getter<boolean>,
|
|
72
72
|
enableSynchronousStateUpdates: Getter<boolean>,
|
|
73
73
|
enableViewCulling: Getter<boolean>,
|
|
74
74
|
enableViewRecycling: Getter<boolean>,
|
|
@@ -77,14 +77,15 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
|
|
77
77
|
fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean>,
|
|
78
78
|
fuseboxEnabledRelease: Getter<boolean>,
|
|
79
79
|
fuseboxNetworkInspectionEnabled: Getter<boolean>,
|
|
80
|
-
removeTurboModuleManagerDelegateMutex: Getter<boolean>,
|
|
81
80
|
traceTurboModulePromiseRejectionsOnAndroid: Getter<boolean>,
|
|
81
|
+
updateRuntimeShadowNodeReferencesOnCommit: Getter<boolean>,
|
|
82
82
|
useAlwaysAvailableJSErrorHandling: Getter<boolean>,
|
|
83
83
|
useEditTextStockAndroidFocusBehavior: Getter<boolean>,
|
|
84
84
|
useFabricInterop: Getter<boolean>,
|
|
85
85
|
useNativeViewConfigsInBridgelessMode: Getter<boolean>,
|
|
86
86
|
useOptimizedEventBatchingOnAndroid: Getter<boolean>,
|
|
87
87
|
useRawPropsJsiValue: Getter<boolean>,
|
|
88
|
+
useShadowNodeStateOnClone: Getter<boolean>,
|
|
88
89
|
useTurboModuleInterop: Getter<boolean>,
|
|
89
90
|
useTurboModules: Getter<boolean>,
|
|
90
91
|
}>;
|
|
@@ -173,10 +174,6 @@ export const disableMainQueueSyncDispatchIOS: Getter<boolean> = createNativeFlag
|
|
|
173
174
|
* Prevent FabricMountingManager from reordering mountItems, which may lead to invalid state on the UI thread
|
|
174
175
|
*/
|
|
175
176
|
export const disableMountItemReorderingAndroid: Getter<boolean> = createNativeFlagGetter('disableMountItemReorderingAndroid', false);
|
|
176
|
-
/**
|
|
177
|
-
* Disables the use of ShadowNode (to calculate ViewConfigs) on apps that are fully running on the new architecture on Android
|
|
178
|
-
*/
|
|
179
|
-
export const disableShadowNodeOnNewArchitectureAndroid: Getter<boolean> = createNativeFlagGetter('disableShadowNodeOnNewArchitectureAndroid', true);
|
|
180
177
|
/**
|
|
181
178
|
* When enabled, the accessibilityOrder prop will propagate to native platforms and define the accessibility order.
|
|
182
179
|
*/
|
|
@@ -193,6 +190,10 @@ export const enableBridgelessArchitecture: Getter<boolean> = createNativeFlagGet
|
|
|
193
190
|
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
|
|
194
191
|
*/
|
|
195
192
|
export const enableCppPropsIteratorSetter: Getter<boolean> = createNativeFlagGetter('enableCppPropsIteratorSetter', false);
|
|
193
|
+
/**
|
|
194
|
+
* This enables the fabric implementation of focus search so that we can focus clipped elements
|
|
195
|
+
*/
|
|
196
|
+
export const enableCustomFocusSearchOnClippedElementsAndroid: Getter<boolean> = createNativeFlagGetter('enableCustomFocusSearchOnClippedElementsAndroid', true);
|
|
196
197
|
/**
|
|
197
198
|
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
|
|
198
199
|
*/
|
|
@@ -205,6 +206,10 @@ export const enableFabricLogs: Getter<boolean> = createNativeFlagGetter('enableF
|
|
|
205
206
|
* Enables the use of the Fabric renderer in the whole app.
|
|
206
207
|
*/
|
|
207
208
|
export const enableFabricRenderer: Getter<boolean> = createNativeFlagGetter('enableFabricRenderer', false);
|
|
209
|
+
/**
|
|
210
|
+
* This feature flag enables a fix for reparenting fix in differentiator
|
|
211
|
+
*/
|
|
212
|
+
export const enableFixForParentTagDuringReparenting: Getter<boolean> = createNativeFlagGetter('enableFixForParentTagDuringReparenting', false);
|
|
208
213
|
/**
|
|
209
214
|
* Enables font scale changes updating layout for measurable nodes.
|
|
210
215
|
*/
|
|
@@ -236,15 +241,11 @@ export const enableNativeCSSParsing: Getter<boolean> = createNativeFlagGetter('e
|
|
|
236
241
|
/**
|
|
237
242
|
* Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable
|
|
238
243
|
*/
|
|
239
|
-
export const enableNewBackgroundAndBorderDrawables: Getter<boolean> = createNativeFlagGetter('enableNewBackgroundAndBorderDrawables',
|
|
244
|
+
export const enableNewBackgroundAndBorderDrawables: Getter<boolean> = createNativeFlagGetter('enableNewBackgroundAndBorderDrawables', true);
|
|
240
245
|
/**
|
|
241
246
|
* When enabled, Android will receive prop updates based on the differences between the last rendered shadow node and the last committed shadow node.
|
|
242
247
|
*/
|
|
243
248
|
export const enablePropsUpdateReconciliationAndroid: Getter<boolean> = createNativeFlagGetter('enablePropsUpdateReconciliationAndroid', false);
|
|
244
|
-
/**
|
|
245
|
-
* Report paint time inside the Event Timing API implementation (PerformanceObserver).
|
|
246
|
-
*/
|
|
247
|
-
export const enableReportEventPaintTime: Getter<boolean> = createNativeFlagGetter('enableReportEventPaintTime', false);
|
|
248
249
|
/**
|
|
249
250
|
* Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).
|
|
250
251
|
*/
|
|
@@ -277,14 +278,14 @@ export const fuseboxEnabledRelease: Getter<boolean> = createNativeFlagGetter('fu
|
|
|
277
278
|
* Enable network inspection support in the React Native DevTools CDP backend. Requires `enableBridgelessArchitecture`. This flag is global and should not be changed across React Host lifetimes.
|
|
278
279
|
*/
|
|
279
280
|
export const fuseboxNetworkInspectionEnabled: Getter<boolean> = createNativeFlagGetter('fuseboxNetworkInspectionEnabled', false);
|
|
280
|
-
/**
|
|
281
|
-
* When enabled, mutex _turboModuleManagerDelegateMutex in RCTTurboModuleManager will not be used
|
|
282
|
-
*/
|
|
283
|
-
export const removeTurboModuleManagerDelegateMutex: Getter<boolean> = createNativeFlagGetter('removeTurboModuleManagerDelegateMutex', false);
|
|
284
281
|
/**
|
|
285
282
|
* Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
|
|
286
283
|
*/
|
|
287
284
|
export const traceTurboModulePromiseRejectionsOnAndroid: Getter<boolean> = createNativeFlagGetter('traceTurboModulePromiseRejectionsOnAndroid', false);
|
|
285
|
+
/**
|
|
286
|
+
* When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
|
|
287
|
+
*/
|
|
288
|
+
export const updateRuntimeShadowNodeReferencesOnCommit: Getter<boolean> = createNativeFlagGetter('updateRuntimeShadowNodeReferencesOnCommit', false);
|
|
288
289
|
/**
|
|
289
290
|
* In Bridgeless mode, use the always available javascript error reporting pipeline.
|
|
290
291
|
*/
|
|
@@ -309,6 +310,10 @@ export const useOptimizedEventBatchingOnAndroid: Getter<boolean> = createNativeF
|
|
|
309
310
|
* Instead of using folly::dynamic as internal representation in RawProps and RawValue, use jsi::Value
|
|
310
311
|
*/
|
|
311
312
|
export const useRawPropsJsiValue: Getter<boolean> = createNativeFlagGetter('useRawPropsJsiValue', false);
|
|
313
|
+
/**
|
|
314
|
+
* Use the state stored on the source shadow node when cloning it instead of reading in the most recent state on the shadow node family.
|
|
315
|
+
*/
|
|
316
|
+
export const useShadowNodeStateOnClone: Getter<boolean> = createNativeFlagGetter('useShadowNodeStateOnClone', false);
|
|
312
317
|
/**
|
|
313
318
|
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
|
|
314
319
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<e0337d40c3467e2e65e4c2bd27519f9a>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -29,14 +29,15 @@ export interface Spec extends TurboModule {
|
|
|
29
29
|
+cxxNativeAnimatedEnabled?: () => boolean;
|
|
30
30
|
+disableMainQueueSyncDispatchIOS?: () => boolean;
|
|
31
31
|
+disableMountItemReorderingAndroid?: () => boolean;
|
|
32
|
-
+disableShadowNodeOnNewArchitectureAndroid?: () => boolean;
|
|
33
32
|
+enableAccessibilityOrder?: () => boolean;
|
|
34
33
|
+enableAccumulatedUpdatesInRawPropsAndroid?: () => boolean;
|
|
35
34
|
+enableBridgelessArchitecture?: () => boolean;
|
|
36
35
|
+enableCppPropsIteratorSetter?: () => boolean;
|
|
36
|
+
+enableCustomFocusSearchOnClippedElementsAndroid?: () => boolean;
|
|
37
37
|
+enableEagerRootViewAttachment?: () => boolean;
|
|
38
38
|
+enableFabricLogs?: () => boolean;
|
|
39
39
|
+enableFabricRenderer?: () => boolean;
|
|
40
|
+
+enableFixForParentTagDuringReparenting?: () => boolean;
|
|
40
41
|
+enableFontScaleChangesUpdatingLayout?: () => boolean;
|
|
41
42
|
+enableIOSViewClipToPaddingBox?: () => boolean;
|
|
42
43
|
+enableJSRuntimeGCOnMemoryPressureOnIOS?: () => boolean;
|
|
@@ -46,7 +47,6 @@ export interface Spec extends TurboModule {
|
|
|
46
47
|
+enableNativeCSSParsing?: () => boolean;
|
|
47
48
|
+enableNewBackgroundAndBorderDrawables?: () => boolean;
|
|
48
49
|
+enablePropsUpdateReconciliationAndroid?: () => boolean;
|
|
49
|
-
+enableReportEventPaintTime?: () => boolean;
|
|
50
50
|
+enableSynchronousStateUpdates?: () => boolean;
|
|
51
51
|
+enableViewCulling?: () => boolean;
|
|
52
52
|
+enableViewRecycling?: () => boolean;
|
|
@@ -55,14 +55,15 @@ export interface Spec extends TurboModule {
|
|
|
55
55
|
+fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean;
|
|
56
56
|
+fuseboxEnabledRelease?: () => boolean;
|
|
57
57
|
+fuseboxNetworkInspectionEnabled?: () => boolean;
|
|
58
|
-
+removeTurboModuleManagerDelegateMutex?: () => boolean;
|
|
59
58
|
+traceTurboModulePromiseRejectionsOnAndroid?: () => boolean;
|
|
59
|
+
+updateRuntimeShadowNodeReferencesOnCommit?: () => boolean;
|
|
60
60
|
+useAlwaysAvailableJSErrorHandling?: () => boolean;
|
|
61
61
|
+useEditTextStockAndroidFocusBehavior?: () => boolean;
|
|
62
62
|
+useFabricInterop?: () => boolean;
|
|
63
63
|
+useNativeViewConfigsInBridgelessMode?: () => boolean;
|
|
64
64
|
+useOptimizedEventBatchingOnAndroid?: () => boolean;
|
|
65
65
|
+useRawPropsJsiValue?: () => boolean;
|
|
66
|
+
+useShadowNodeStateOnClone?: () => boolean;
|
|
66
67
|
+useTurboModuleInterop?: () => boolean;
|
|
67
68
|
+useTurboModules?: () => boolean;
|
|
68
69
|
}
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ExtendedError} from '../../../../Libraries/Core/ExtendedError';
|
|
12
|
-
import type {Component as ReactComponent} from 'react';
|
|
13
12
|
|
|
14
13
|
import ExceptionsManager, {
|
|
15
14
|
SyntheticError,
|
|
16
15
|
} from '../../../../Libraries/Core/ExceptionsManager';
|
|
16
|
+
import * as React from 'react';
|
|
17
17
|
|
|
18
18
|
type ErrorInfo = {
|
|
19
19
|
+componentStack?: ?string,
|
|
20
20
|
// $FlowFixMe[unclear-type] unknown props and state.
|
|
21
|
-
+errorBoundary?: ?
|
|
21
|
+
+errorBoundary?: ?React.Component<any, any>,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
function getExtendedError(
|
|
@@ -59,6 +59,9 @@ export interface Spec extends TurboModule {
|
|
|
59
59
|
+voidFuncAssert?: () => void;
|
|
60
60
|
+getObjectAssert?: (arg: Object) => Object;
|
|
61
61
|
+promiseAssert?: () => Promise<void>;
|
|
62
|
+
|
|
63
|
+
// Android-only
|
|
64
|
+
+getImageUrl?: () => Promise<string | null>;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
|
@@ -38,7 +38,7 @@ export type MeasureLayoutOnSuccessCallback = (
|
|
|
38
38
|
* The methods described here are available on most of the default components provided by React Native.
|
|
39
39
|
* Note, however, that they are not available on composite components that aren't directly backed by a
|
|
40
40
|
* native view. This will generally include most components that you define in your own app.
|
|
41
|
-
* For more information, see [Direct Manipulation](https://reactnative.dev/docs/direct-manipulation).
|
|
41
|
+
* For more information, see [Direct Manipulation](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture).
|
|
42
42
|
* @see https://github.com/facebook/react-native/blob/master/Libraries/Renderer/shims/ReactNativeTypes.js#L87
|
|
43
43
|
*/
|
|
44
44
|
export interface LegacyHostInstanceMethods {
|
|
@@ -100,7 +100,7 @@ export interface LegacyHostInstanceMethods {
|
|
|
100
100
|
* This function sends props straight to native. They will not participate in
|
|
101
101
|
* future diff process - this means that if you do not include them in the
|
|
102
102
|
* next render, they will remain active (see [Direct
|
|
103
|
-
* Manipulation](https://reactnative.dev/docs/direct-manipulation)).
|
|
103
|
+
* Manipulation](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture)).
|
|
104
104
|
*/
|
|
105
105
|
setNativeProps(nativeProps: {...}): void;
|
|
106
106
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ export * as CodegenTypes from '../Libraries/Types/CodegenTypesNamespace';
|
|
|
143
143
|
export * from '../Libraries/Types/CoreEventTypes';
|
|
144
144
|
export * from '../Libraries/Utilities/Appearance';
|
|
145
145
|
export * from '../Libraries/Utilities/BackHandler';
|
|
146
|
-
export * from '../src/private/devmenu/DevMenu';
|
|
146
|
+
export * from '../src/private/devsupport/devmenu/DevMenu';
|
|
147
147
|
export * from '../Libraries/Utilities/DevSettings';
|
|
148
148
|
export * from '../Libraries/Utilities/Dimensions';
|
|
149
149
|
export * from '../Libraries/Utilities/PixelRatio';
|
|
@@ -39,7 +39,7 @@ export type MeasureLayoutOnSuccessCallback = (
|
|
|
39
39
|
* The methods described here are available on most of the default components provided by React Native.
|
|
40
40
|
* Note, however, that they are not available on composite components that aren't directly backed by a
|
|
41
41
|
* native view. This will generally include most components that you define in your own app.
|
|
42
|
-
* For more information, see [Direct Manipulation](https://reactnative.dev/docs/direct-manipulation).
|
|
42
|
+
* For more information, see [Direct Manipulation](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture).
|
|
43
43
|
* @see https://github.com/facebook/react-native/blob/master/Libraries/Renderer/shims/ReactNativeTypes.js#L87
|
|
44
44
|
*/
|
|
45
45
|
export interface NativeMethods {
|
|
@@ -95,7 +95,7 @@ export interface NativeMethods {
|
|
|
95
95
|
* This function sends props straight to native. They will not participate in
|
|
96
96
|
* future diff process - this means that if you do not include them in the
|
|
97
97
|
* next render, they will remain active (see [Direct
|
|
98
|
-
* Manipulation](https://reactnative.dev/docs/direct-manipulation)).
|
|
98
|
+
* Manipulation](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture)).
|
|
99
99
|
*/
|
|
100
100
|
setNativeProps(nativeProps: object): void;
|
|
101
101
|
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
// These don't actually exist anywhere in the code.
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
import type {ModuleConfig} from '../NativeModules';
|
|
16
|
-
|
|
17
|
-
const remoteModulesConfig: $ReadOnlyArray<ModuleConfig> = [
|
|
18
|
-
[
|
|
19
|
-
'RemoteModule1',
|
|
20
|
-
null,
|
|
21
|
-
['remoteMethod', 'promiseMethod', 'promiseReturningMethod', 'syncMethod'],
|
|
22
|
-
[2 /* promiseReturningMethod */],
|
|
23
|
-
[3 /* syncMethod */],
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
'RemoteModule2',
|
|
27
|
-
null,
|
|
28
|
-
['remoteMethod', 'promiseMethod', 'promiseReturningMethod', 'syncMethod'],
|
|
29
|
-
[2 /* promiseReturningMethod */],
|
|
30
|
-
[3 /* syncMethod */],
|
|
31
|
-
],
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const MessageQueueTestConfig = {
|
|
35
|
-
remoteModuleConfig: remoteModulesConfig,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
module.exports = MessageQueueTestConfig;
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Dummy module that only exists for the sake of proving that the message queue
|
|
14
|
-
* correctly dispatches to commonJS modules. The `testHook` is overridden by test
|
|
15
|
-
* cases.
|
|
16
|
-
*/
|
|
17
|
-
const MessageQueueTestModule = {
|
|
18
|
-
testHook1: function () {},
|
|
19
|
-
testHook2: function () {},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
module.exports = MessageQueueTestModule;
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const BlobModule = {
|
|
12
|
-
createFromParts() {},
|
|
13
|
-
release() {},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
module.exports = BlobModule;
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const FileReaderModule = {
|
|
12
|
-
async readAsText(): Promise<string> {
|
|
13
|
-
return '';
|
|
14
|
-
},
|
|
15
|
-
async readAsDataURL(): Promise<string> {
|
|
16
|
-
return 'data:text/plain;base64,NDI=';
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
module.exports = FileReaderModule;
|
|
@@ -1,32 +0,0 @@
|
|
|
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 strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
import type {HostComponent} from '../../../../src/private/types/HostComponent';
|
|
14
|
-
|
|
15
|
-
import requireNativeComponent from '../../../ReactNative/requireNativeComponent';
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
|
|
18
|
-
const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
|
|
19
|
-
'RCTRefreshControl',
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
class RefreshControlMock extends React.Component<{...}> {
|
|
23
|
-
static latestRef: ?RefreshControlMock;
|
|
24
|
-
componentDidMount() {
|
|
25
|
-
RefreshControlMock.latestRef = this;
|
|
26
|
-
}
|
|
27
|
-
render(): React.MixedElement {
|
|
28
|
-
return <RCTRefreshControl />;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = RefreshControlMock;
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
*/
|
|
9
|
-
|
|
10
|
-
// This mock only provides short-circuited methods of applyWithGuard and guard.
|
|
11
|
-
// A lot of modules rely on these two functions. This mock relieves their tests
|
|
12
|
-
// from depending on the real ErrorUtils module. If you need real error handling
|
|
13
|
-
// don't use this mock.
|
|
14
|
-
'use strict';
|
|
15
|
-
|
|
16
|
-
function execute(fun, context, args) {
|
|
17
|
-
return fun.apply(context, args);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function reportError(error) {
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const ErrorUtils = {
|
|
25
|
-
apply: jest.fn(execute),
|
|
26
|
-
applyWithGuard: jest.fn(execute),
|
|
27
|
-
guard: jest.fn(callback => callback),
|
|
28
|
-
inGuard: jest.fn().mockReturnValue(true),
|
|
29
|
-
reportError: jest.fn(reportError),
|
|
30
|
-
setGlobalHandler: jest.fn(),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
module.exports = ErrorUtils;
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
8
|
-
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import typeof NativeExceptionsManager from '../NativeExceptionsManager';
|
|
13
|
-
|
|
14
|
-
export default ({
|
|
15
|
-
reportFatalException: jest.fn(),
|
|
16
|
-
reportSoftException: jest.fn(),
|
|
17
|
-
dismissRedbox: jest.fn(),
|
|
18
|
-
reportException: jest.fn(),
|
|
19
|
-
}: NativeExceptionsManager);
|
|
@@ -1,49 +0,0 @@
|
|
|
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 strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {
|
|
12
|
-
EventSubscription,
|
|
13
|
-
IEventEmitter,
|
|
14
|
-
} from '../../vendor/emitter/EventEmitter';
|
|
15
|
-
|
|
16
|
-
import RCTDeviceEventEmitter from '../RCTDeviceEventEmitter';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Mock `NativeEventEmitter` to ignore Native Modules.
|
|
20
|
-
*/
|
|
21
|
-
export default class NativeEventEmitter<
|
|
22
|
-
TEventToArgsMap: $ReadOnly<Record<string, $ReadOnlyArray<mixed>>>,
|
|
23
|
-
> implements IEventEmitter<TEventToArgsMap>
|
|
24
|
-
{
|
|
25
|
-
addListener<TEvent: $Keys<TEventToArgsMap>>(
|
|
26
|
-
eventType: TEvent,
|
|
27
|
-
listener: (...args: TEventToArgsMap[TEvent]) => mixed,
|
|
28
|
-
context?: mixed,
|
|
29
|
-
): EventSubscription {
|
|
30
|
-
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
emit<TEvent: $Keys<TEventToArgsMap>>(
|
|
34
|
-
eventType: TEvent,
|
|
35
|
-
...args: TEventToArgsMap[TEvent]
|
|
36
|
-
): void {
|
|
37
|
-
RCTDeviceEventEmitter.emit(eventType, ...args);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
removeAllListeners<TEvent: $Keys<TEventToArgsMap>>(
|
|
41
|
-
eventType?: ?TEvent,
|
|
42
|
-
): void {
|
|
43
|
-
RCTDeviceEventEmitter.removeAllListeners(eventType);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
listenerCount<TEvent: $Keys<TEventToArgsMap>>(eventType: TEvent): number {
|
|
47
|
-
return RCTDeviceEventEmitter.listenerCount(eventType);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
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
|
-
const FlatList = require('../FlatList').default;
|
|
14
|
-
const React = require('react');
|
|
15
|
-
|
|
16
|
-
function renderMyListItem(info: {
|
|
17
|
-
item: {title: string, ...},
|
|
18
|
-
index: number,
|
|
19
|
-
...
|
|
20
|
-
}) {
|
|
21
|
-
return <span />;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = {
|
|
25
|
-
testEverythingIsFine(): React.Node {
|
|
26
|
-
const data = [
|
|
27
|
-
{
|
|
28
|
-
title: 'Title Text',
|
|
29
|
-
key: 1,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
return <FlatList renderItem={renderMyListItem} data={data} />;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
testBadDataWithTypicalItem(): React.Node {
|
|
36
|
-
const data = [
|
|
37
|
-
{
|
|
38
|
-
title: 6,
|
|
39
|
-
key: 1,
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
// $FlowExpectedError - bad title type 6, should be string
|
|
43
|
-
return <FlatList renderItem={renderMyListItem} data={data} />;
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
testMissingFieldWithTypicalItem(): React.Node {
|
|
47
|
-
const data = [
|
|
48
|
-
{
|
|
49
|
-
key: 1,
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
|
-
// $FlowExpectedError - missing title
|
|
53
|
-
return <FlatList renderItem={renderMyListItem} data={data} />;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
testGoodDataWithBadCustomRenderItemFunction(): React.Node {
|
|
57
|
-
const data = [
|
|
58
|
-
{
|
|
59
|
-
widget: 6,
|
|
60
|
-
key: 1,
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
return (
|
|
64
|
-
<FlatList
|
|
65
|
-
renderItem={info => (
|
|
66
|
-
<span>
|
|
67
|
-
{
|
|
68
|
-
// $FlowExpectedError - bad widgetCount type 6, should be Object
|
|
69
|
-
info.item.widget.missingProp
|
|
70
|
-
}
|
|
71
|
-
</span>
|
|
72
|
-
)}
|
|
73
|
-
data={data}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
|
|
79
|
-
const data = [
|
|
80
|
-
{
|
|
81
|
-
title: 'foo',
|
|
82
|
-
key: 1,
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
return [
|
|
86
|
-
// $FlowExpectedError - title should be inside `item`
|
|
87
|
-
<FlatList renderItem={(info: {title: string}) => <span />} data={data} />,
|
|
88
|
-
<FlatList
|
|
89
|
-
// $FlowExpectedError - bad index type string, should be number
|
|
90
|
-
renderItem={(info: {item: any, index: string}) => <span />}
|
|
91
|
-
data={data}
|
|
92
|
-
/>,
|
|
93
|
-
<FlatList
|
|
94
|
-
// $FlowExpectedError - bad title type number, should be string
|
|
95
|
-
renderItem={(info: {item: {title: number}}) => <span />}
|
|
96
|
-
// $FlowExpectedError - bad title type number, should be string
|
|
97
|
-
data={data}
|
|
98
|
-
/>,
|
|
99
|
-
// EverythingIsFine
|
|
100
|
-
<FlatList
|
|
101
|
-
// $FlowExpectedError - bad title type number, should be string
|
|
102
|
-
renderItem={(info: {item: {title: string, ...}, ...}) => <span />}
|
|
103
|
-
data={data}
|
|
104
|
-
/>,
|
|
105
|
-
];
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
testOtherBadProps(): $ReadOnlyArray<React.Node> {
|
|
109
|
-
return [
|
|
110
|
-
// $FlowExpectedError - bad numColumns type "lots"
|
|
111
|
-
<FlatList renderItem={renderMyListItem} data={[]} numColumns="lots" />,
|
|
112
|
-
// $FlowExpectedError - bad windowSize type "big"
|
|
113
|
-
<FlatList renderItem={renderMyListItem} data={[]} windowSize="big" />,
|
|
114
|
-
// $FlowExpectedError - missing `data` prop
|
|
115
|
-
<FlatList renderItem={renderMyListItem} />,
|
|
116
|
-
];
|
|
117
|
-
},
|
|
118
|
-
};
|