@office-iss/react-native-win32 0.0.0-canary.270 → 0.0.0-canary.272
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 +31 -1
- package/CHANGELOG.md +20 -4
- package/Libraries/Animated/animations/Animation.js +63 -24
- package/Libraries/Animated/animations/DecayAnimation.js +26 -38
- package/Libraries/Animated/animations/SpringAnimation.js +33 -39
- package/Libraries/Animated/animations/TimingAnimation.js +34 -42
- package/Libraries/Animated/createAnimatedComponent.js +46 -32
- package/Libraries/Animated/nodes/AnimatedProps.js +16 -10
- package/Libraries/Animated/nodes/AnimatedStyle.js +4 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +61 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +61 -3
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
- package/Libraries/Components/Button.js +9 -4
- package/Libraries/Components/Button.win32.js +12 -4
- package/Libraries/Components/Pressable/Pressable.js +4 -4
- package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +9 -6
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
- package/Libraries/Components/ScrollView/ScrollView.js +10 -10
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +4 -4
- package/Libraries/Components/Switch/Switch.js +8 -6
- package/Libraries/Components/TextInput/TextInput.d.ts +4 -4
- package/Libraries/Components/TextInput/TextInput.flow.js +7 -10
- package/Libraries/Components/TextInput/TextInput.js +11 -11
- package/Libraries/Components/TextInput/TextInput.win32.js +11 -11
- package/Libraries/Components/TextInput/TextInputState.js +11 -13
- package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
- package/Libraries/Components/Touchable/TouchableBounce.js +4 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +4 -4
- package/Libraries/Components/Touchable/TouchableOpacity.js +4 -4
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Components/View/View.js +4 -4
- package/Libraries/Components/View/View.win32.js +4 -4
- package/Libraries/Components/View/ViewNativeComponent.js +3 -10
- package/Libraries/Core/ExceptionsManager.js +3 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -10
- package/Libraries/Core/setUpReactDevTools.js +3 -3
- package/Libraries/Core/setUpSegmentFetcher.js +1 -0
- package/Libraries/Core/setUpTimers.js +8 -8
- package/Libraries/Debugging/DebuggingOverlay.js +4 -5
- package/Libraries/Image/ImageBackground.js +2 -5
- package/Libraries/Image/ImageProps.js +5 -5
- package/Libraries/Image/ImageTypes.flow.js +11 -9
- package/Libraries/Image/ImageViewNativeComponent.js +2 -2
- package/Libraries/Inspector/ReactDevToolsOverlay.js +0 -1
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +1 -2
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/LogBox.js +18 -5
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
- package/Libraries/Network/XMLHttpRequest.js +26 -1
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/HoverState.win32.js +2 -0
- package/Libraries/Pressability/Pressability.js +2 -3
- package/Libraries/Pressability/Pressability.win32.js +2 -3
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
- package/Libraries/ReactNative/RendererImplementation.js +4 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +13 -18
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +13 -0
- package/Libraries/StyleSheet/processTransform.js +3 -34
- package/Libraries/Text/Text.js +248 -249
- package/Libraries/Text/Text.win32.js +282 -295
- package/Libraries/Types/CoreEventTypes.d.ts +3 -10
- package/Libraries/Types/CoreEventTypes.js +4 -6
- package/Libraries/Types/CoreEventTypes.win32.js +4 -6
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -2
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +5 -4
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/index.js +5 -2
- package/index.win32.js +5 -2
- package/jest/setup.js +30 -0
- package/overrides.json +21 -21
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +2 -4
- package/src/private/animated/NativeAnimatedHelper.win32.js +2 -3
- package/src/private/components/HScrollViewNativeComponents.js +4 -5
- package/src/private/components/VScrollViewNativeComponents.js +4 -5
- package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +13 -22
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -5
- package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +3 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +3 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
- package/src/private/specs/modules/NativeAppearance.js +4 -10
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
- package/src/private/webapis/performance/EventTiming.js +13 -8
- package/src/private/webapis/performance/Performance.js +30 -40
- package/src/private/webapis/performance/PerformanceEntry.js +2 -5
- package/src/private/webapis/performance/PerformanceObserver.js +20 -32
- package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +6 -2
- package/src/private/webapis/performance/Utilities.js +0 -7
- package/src/private/webapis/performance/specs/NativePerformance.js +53 -0
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +247 -0
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/types/public/ReactNativeTypes.d.ts +4 -4
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -69
- package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -69
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -154
- /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
- /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.android.js +0 -0
- /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.ios.js +0 -0
- /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.win32.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<<1ef57002084a2e38a69b43b7d4d557a9>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -36,6 +36,7 @@ export type ReactNativeFeatureFlagsJsOnly = {
|
|
|
36
36
|
enableAnimatedPropsMemo: Getter<boolean>,
|
|
37
37
|
enableOptimisedVirtualizedCells: Getter<boolean>,
|
|
38
38
|
isLayoutAnimationEnabled: Getter<boolean>,
|
|
39
|
+
scheduleAnimatedEndCallbackInMicrotask: Getter<boolean>,
|
|
39
40
|
shouldSkipStateUpdatesForLoopingAnimations: Getter<boolean>,
|
|
40
41
|
shouldUseAnimatedObjectForTransform: Getter<boolean>,
|
|
41
42
|
shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean>,
|
|
@@ -53,10 +54,8 @@ export type ReactNativeFeatureFlags = {
|
|
|
53
54
|
allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter<boolean>,
|
|
54
55
|
batchRenderingUpdatesInEventLoop: Getter<boolean>,
|
|
55
56
|
completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean>,
|
|
56
|
-
destroyFabricSurfacesInReactInstanceManager: Getter<boolean>,
|
|
57
57
|
enableAlignItemsBaselineOnFabricIOS: Getter<boolean>,
|
|
58
58
|
enableAndroidLineHeightCentering: Getter<boolean>,
|
|
59
|
-
enableBackgroundStyleApplicator: Getter<boolean>,
|
|
60
59
|
enableBridgelessArchitecture: Getter<boolean>,
|
|
61
60
|
enableCleanTextInputYogaNode: Getter<boolean>,
|
|
62
61
|
enableDeletionOfUnmountedViews: Getter<boolean>,
|
|
@@ -67,6 +66,7 @@ export type ReactNativeFeatureFlags = {
|
|
|
67
66
|
enableFabricRendererExclusively: Getter<boolean>,
|
|
68
67
|
enableGranularShadowTreeStateReconciliation: Getter<boolean>,
|
|
69
68
|
enableIOSViewClipToPaddingBox: Getter<boolean>,
|
|
69
|
+
enableLayoutAnimationsOnAndroid: Getter<boolean>,
|
|
70
70
|
enableLayoutAnimationsOnIOS: Getter<boolean>,
|
|
71
71
|
enableLongTaskAPI: Getter<boolean>,
|
|
72
72
|
enableMicrotasks: Getter<boolean>,
|
|
@@ -94,11 +94,9 @@ export type ReactNativeFeatureFlags = {
|
|
|
94
94
|
useImmediateExecutorInAndroidBridgeless: Getter<boolean>,
|
|
95
95
|
useModernRuntimeScheduler: Getter<boolean>,
|
|
96
96
|
useNativeViewConfigsInBridgelessMode: Getter<boolean>,
|
|
97
|
-
useNewReactImageViewBackgroundDrawing: Getter<boolean>,
|
|
98
97
|
useOptimisedViewPreallocationOnAndroid: Getter<boolean>,
|
|
99
98
|
useOptimizedEventBatchingOnAndroid: Getter<boolean>,
|
|
100
99
|
useRuntimeShadowNodeReferenceUpdate: Getter<boolean>,
|
|
101
|
-
useRuntimeShadowNodeReferenceUpdateOnLayout: Getter<boolean>,
|
|
102
100
|
useTurboModuleInterop: Getter<boolean>,
|
|
103
101
|
useTurboModules: Getter<boolean>,
|
|
104
102
|
}
|
|
@@ -148,6 +146,11 @@ export const enableOptimisedVirtualizedCells: Getter<boolean> = createJavaScript
|
|
|
148
146
|
*/
|
|
149
147
|
export const isLayoutAnimationEnabled: Getter<boolean> = createJavaScriptFlagGetter('isLayoutAnimationEnabled', true);
|
|
150
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Changes the completion callback supplied via `Animation#start` to be scheduled in a microtask instead of synchronously executed.
|
|
151
|
+
*/
|
|
152
|
+
export const scheduleAnimatedEndCallbackInMicrotask: Getter<boolean> = createJavaScriptFlagGetter('scheduleAnimatedEndCallbackInMicrotask', false);
|
|
153
|
+
|
|
151
154
|
/**
|
|
152
155
|
* If the animation is within Animated.loop, we do not send state updates to React.
|
|
153
156
|
*/
|
|
@@ -199,10 +202,6 @@ export const batchRenderingUpdatesInEventLoop: Getter<boolean> = createNativeFla
|
|
|
199
202
|
* Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on Android
|
|
200
203
|
*/
|
|
201
204
|
export const completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean> = createNativeFlagGetter('completeReactInstanceCreationOnBgThreadOnAndroid', false);
|
|
202
|
-
/**
|
|
203
|
-
* When enabled, ReactInstanceManager will clean up Fabric surfaces on destroy().
|
|
204
|
-
*/
|
|
205
|
-
export const destroyFabricSurfacesInReactInstanceManager: Getter<boolean> = createNativeFlagGetter('destroyFabricSurfacesInReactInstanceManager', false);
|
|
206
205
|
/**
|
|
207
206
|
* Kill-switch to turn off support for aling-items:baseline on Fabric iOS.
|
|
208
207
|
*/
|
|
@@ -211,10 +210,6 @@ export const enableAlignItemsBaselineOnFabricIOS: Getter<boolean> = createNative
|
|
|
211
210
|
* When enabled, custom line height calculation will be centered from top to bottom.
|
|
212
211
|
*/
|
|
213
212
|
export const enableAndroidLineHeightCentering: Getter<boolean> = createNativeFlagGetter('enableAndroidLineHeightCentering', false);
|
|
214
|
-
/**
|
|
215
|
-
* Use BackgroundStyleApplicator in place of other background/border drawing code
|
|
216
|
-
*/
|
|
217
|
-
export const enableBackgroundStyleApplicator: Getter<boolean> = createNativeFlagGetter('enableBackgroundStyleApplicator', true);
|
|
218
213
|
/**
|
|
219
214
|
* Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flags: `useTurboModules` & `enableFabricRenderer.
|
|
220
215
|
*/
|
|
@@ -255,6 +250,10 @@ export const enableGranularShadowTreeStateReconciliation: Getter<boolean> = crea
|
|
|
255
250
|
* iOS Views will clip to their padding box vs border box
|
|
256
251
|
*/
|
|
257
252
|
export const enableIOSViewClipToPaddingBox: Getter<boolean> = createNativeFlagGetter('enableIOSViewClipToPaddingBox', false);
|
|
253
|
+
/**
|
|
254
|
+
* When enabled, LayoutAnimations API will animate state changes on Android.
|
|
255
|
+
*/
|
|
256
|
+
export const enableLayoutAnimationsOnAndroid: Getter<boolean> = createNativeFlagGetter('enableLayoutAnimationsOnAndroid', false);
|
|
258
257
|
/**
|
|
259
258
|
* When enabled, LayoutAnimations API will animate state changes on iOS.
|
|
260
259
|
*/
|
|
@@ -342,7 +341,7 @@ export const removeNestedCallsToDispatchMountItemsOnAndroid: Getter<boolean> = c
|
|
|
342
341
|
/**
|
|
343
342
|
* Propagate layout direction to Android views.
|
|
344
343
|
*/
|
|
345
|
-
export const setAndroidLayoutDirection: Getter<boolean> = createNativeFlagGetter('setAndroidLayoutDirection',
|
|
344
|
+
export const setAndroidLayoutDirection: Getter<boolean> = createNativeFlagGetter('setAndroidLayoutDirection', true);
|
|
346
345
|
/**
|
|
347
346
|
* Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
|
|
348
347
|
*/
|
|
@@ -363,10 +362,6 @@ export const useModernRuntimeScheduler: Getter<boolean> = createNativeFlagGetter
|
|
|
363
362
|
* When enabled, the native view configs are used in bridgeless mode.
|
|
364
363
|
*/
|
|
365
364
|
export const useNativeViewConfigsInBridgelessMode: Getter<boolean> = createNativeFlagGetter('useNativeViewConfigsInBridgelessMode', false);
|
|
366
|
-
/**
|
|
367
|
-
* Use shared background drawing code for ReactImageView instead of using Fresco to manipulate the bitmap
|
|
368
|
-
*/
|
|
369
|
-
export const useNewReactImageViewBackgroundDrawing: Getter<boolean> = createNativeFlagGetter('useNewReactImageViewBackgroundDrawing', false);
|
|
370
365
|
/**
|
|
371
366
|
* Moves more of the work in view preallocation to the main thread to free up JS thread.
|
|
372
367
|
*/
|
|
@@ -379,10 +374,6 @@ export const useOptimizedEventBatchingOnAndroid: Getter<boolean> = createNativeF
|
|
|
379
374
|
* When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.
|
|
380
375
|
*/
|
|
381
376
|
export const useRuntimeShadowNodeReferenceUpdate: Getter<boolean> = createNativeFlagGetter('useRuntimeShadowNodeReferenceUpdate', false);
|
|
382
|
-
/**
|
|
383
|
-
* When enabled, cloning shadow nodes during layout will update the reference held by the current JS fiber tree.
|
|
384
|
-
*/
|
|
385
|
-
export const useRuntimeShadowNodeReferenceUpdateOnLayout: Getter<boolean> = createNativeFlagGetter('useRuntimeShadowNodeReferenceUpdateOnLayout', false);
|
|
386
377
|
/**
|
|
387
378
|
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
|
|
388
379
|
*/
|
|
@@ -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<<e6477fcd9bf64a5c84496dfb55ae3700>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -27,10 +27,8 @@ export interface Spec extends TurboModule {
|
|
|
27
27
|
+allowRecursiveCommitsWithSynchronousMountOnAndroid?: () => boolean;
|
|
28
28
|
+batchRenderingUpdatesInEventLoop?: () => boolean;
|
|
29
29
|
+completeReactInstanceCreationOnBgThreadOnAndroid?: () => boolean;
|
|
30
|
-
+destroyFabricSurfacesInReactInstanceManager?: () => boolean;
|
|
31
30
|
+enableAlignItemsBaselineOnFabricIOS?: () => boolean;
|
|
32
31
|
+enableAndroidLineHeightCentering?: () => boolean;
|
|
33
|
-
+enableBackgroundStyleApplicator?: () => boolean;
|
|
34
32
|
+enableBridgelessArchitecture?: () => boolean;
|
|
35
33
|
+enableCleanTextInputYogaNode?: () => boolean;
|
|
36
34
|
+enableDeletionOfUnmountedViews?: () => boolean;
|
|
@@ -41,6 +39,7 @@ export interface Spec extends TurboModule {
|
|
|
41
39
|
+enableFabricRendererExclusively?: () => boolean;
|
|
42
40
|
+enableGranularShadowTreeStateReconciliation?: () => boolean;
|
|
43
41
|
+enableIOSViewClipToPaddingBox?: () => boolean;
|
|
42
|
+
+enableLayoutAnimationsOnAndroid?: () => boolean;
|
|
44
43
|
+enableLayoutAnimationsOnIOS?: () => boolean;
|
|
45
44
|
+enableLongTaskAPI?: () => boolean;
|
|
46
45
|
+enableMicrotasks?: () => boolean;
|
|
@@ -68,11 +67,9 @@ export interface Spec extends TurboModule {
|
|
|
68
67
|
+useImmediateExecutorInAndroidBridgeless?: () => boolean;
|
|
69
68
|
+useModernRuntimeScheduler?: () => boolean;
|
|
70
69
|
+useNativeViewConfigsInBridgelessMode?: () => boolean;
|
|
71
|
-
+useNewReactImageViewBackgroundDrawing?: () => boolean;
|
|
72
70
|
+useOptimisedViewPreallocationOnAndroid?: () => boolean;
|
|
73
71
|
+useOptimizedEventBatchingOnAndroid?: () => boolean;
|
|
74
72
|
+useRuntimeShadowNodeReferenceUpdate?: () => boolean;
|
|
75
|
-
+useRuntimeShadowNodeReferenceUpdateOnLayout?: () => boolean;
|
|
76
73
|
+useTurboModuleInterop?: () => boolean;
|
|
77
74
|
+useTurboModules?: () => boolean;
|
|
78
75
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
|
13
|
+
|
|
14
|
+
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
15
|
+
|
|
16
|
+
export type ReloadAndProfileConfig = {
|
|
17
|
+
shouldReloadAndProfile: boolean,
|
|
18
|
+
recordChangeDescriptions: boolean,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Linter doesn't speak Flow's `Partial` type
|
|
22
|
+
export type PartialReloadAndProfileConfig = {
|
|
23
|
+
shouldReloadAndProfile?: boolean,
|
|
24
|
+
recordChangeDescriptions?: boolean,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export interface Spec extends TurboModule {
|
|
28
|
+
+setReloadAndProfileConfig: (config: PartialReloadAndProfileConfig) => void;
|
|
29
|
+
+getReloadAndProfileConfig: () => ReloadAndProfileConfig;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default (TurboModuleRegistry.get<Spec>(
|
|
33
|
+
'ReactDevToolsRuntimeSettingsModule',
|
|
34
|
+
): ?Spec);
|
|
@@ -16,6 +16,9 @@ export interface Spec extends TurboModule {
|
|
|
16
16
|
+isReduceMotionEnabled: (
|
|
17
17
|
onSuccess: (isReduceMotionEnabled: boolean) => void,
|
|
18
18
|
) => void;
|
|
19
|
+
+isHighTextContrastEnabled?: (
|
|
20
|
+
onSuccess: (isHighTextContrastEnabled: boolean) => void,
|
|
21
|
+
) => void;
|
|
19
22
|
+isTouchExplorationEnabled: (
|
|
20
23
|
onSuccess: (isScreenReaderEnabled: boolean) => void,
|
|
21
24
|
) => void;
|
|
@@ -16,6 +16,9 @@ export interface Spec extends TurboModule {
|
|
|
16
16
|
+isReduceMotionEnabled: (
|
|
17
17
|
onSuccess: (isReduceMotionEnabled: boolean) => void,
|
|
18
18
|
) => void;
|
|
19
|
+
+isHighTextContrastEnabled?: (
|
|
20
|
+
onSuccess: (isHighTextContrastEnabled: boolean) => void,
|
|
21
|
+
) => void;
|
|
19
22
|
+isTouchExplorationEnabled: (
|
|
20
23
|
onSuccess: (isScreenReaderEnabled: boolean) => void,
|
|
21
24
|
) => void;
|
|
@@ -29,6 +29,10 @@ export interface Spec extends TurboModule {
|
|
|
29
29
|
onSuccess: (isReduceMotionEnabled: boolean) => void,
|
|
30
30
|
onError: (error: Object) => void,
|
|
31
31
|
) => void;
|
|
32
|
+
+getCurrentDarkerSystemColorsState?: (
|
|
33
|
+
onSuccess: (isDarkerSystemColorsEnabled: boolean) => void,
|
|
34
|
+
onError: (error: Object) => void,
|
|
35
|
+
) => void;
|
|
32
36
|
+getCurrentPrefersCrossFadeTransitionsState?: (
|
|
33
37
|
onSuccess: (prefersCrossFadeTransitions: boolean) => void,
|
|
34
38
|
onError: (error: Object) => void,
|
|
@@ -12,21 +12,15 @@ import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
|
|
12
12
|
|
|
13
13
|
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
14
14
|
|
|
15
|
-
export type ColorSchemeName = 'light' | 'dark';
|
|
15
|
+
export type ColorSchemeName = 'light' | 'dark' | 'unspecified';
|
|
16
16
|
|
|
17
17
|
export type AppearancePreferences = {
|
|
18
|
-
|
|
19
|
-
// types.
|
|
20
|
-
/* 'light' | 'dark' */
|
|
21
|
-
colorScheme?: ?string,
|
|
18
|
+
colorScheme?: ?ColorSchemeName,
|
|
22
19
|
};
|
|
23
20
|
|
|
24
21
|
export interface Spec extends TurboModule {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/* 'light' | 'dark' */
|
|
28
|
-
+getColorScheme: () => ?string;
|
|
29
|
-
+setColorScheme: (colorScheme: string) => void;
|
|
22
|
+
+getColorScheme: () => ?ColorSchemeName;
|
|
23
|
+
+setColorScheme: (colorScheme: ColorSchemeName) => void;
|
|
30
24
|
|
|
31
25
|
// RCTEventEmitter
|
|
32
26
|
+addListener: (eventName: string) => void;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// flowlint unsafe-getters-setters:off
|
|
12
12
|
|
|
13
13
|
import type {
|
|
14
|
-
|
|
14
|
+
HostInstance,
|
|
15
15
|
INativeMethods,
|
|
16
16
|
InternalInstanceHandle,
|
|
17
17
|
MeasureInWindowOnSuccessCallback,
|
|
@@ -19,7 +19,6 @@ import type {
|
|
|
19
19
|
MeasureOnSuccessCallback,
|
|
20
20
|
ViewConfig,
|
|
21
21
|
} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
22
|
-
import type {ElementRef} from 'react';
|
|
23
22
|
|
|
24
23
|
import TextInputState from '../../../../../Libraries/Components/TextInput/TextInputState';
|
|
25
24
|
import {getFabricUIManager} from '../../../../../Libraries/ReactNative/FabricUIManager';
|
|
@@ -143,7 +142,7 @@ export default class ReactNativeElement
|
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
measureLayout(
|
|
146
|
-
relativeToNativeNode: number |
|
|
145
|
+
relativeToNativeNode: number | HostInstance,
|
|
147
146
|
onSuccess: MeasureLayoutOnSuccessCallback,
|
|
148
147
|
onFail?: () => void /* currently unused */,
|
|
149
148
|
) {
|
|
@@ -16,8 +16,8 @@ import type {
|
|
|
16
16
|
} from './PerformanceEntry';
|
|
17
17
|
|
|
18
18
|
import {PerformanceEntry} from './PerformanceEntry';
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
19
|
+
import {warnNoNativePerformance} from './Utilities';
|
|
20
|
+
import NativePerformance from './specs/NativePerformance';
|
|
21
21
|
|
|
22
22
|
export type PerformanceEventTimingJSON = {
|
|
23
23
|
...PerformanceEntryJSON,
|
|
@@ -85,14 +85,18 @@ function getCachedEventCounts(): Map<string, number> {
|
|
|
85
85
|
if (cachedEventCounts) {
|
|
86
86
|
return cachedEventCounts;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
|
|
89
|
+
if (!NativePerformance || !NativePerformance?.getEventCounts) {
|
|
90
|
+
warnNoNativePerformance();
|
|
91
|
+
cachedEventCounts = new Map();
|
|
92
|
+
return cachedEventCounts;
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
const eventCounts = new Map<string, number>(
|
|
96
|
+
NativePerformance.getEventCounts?.() ?? [],
|
|
95
97
|
);
|
|
98
|
+
cachedEventCounts = eventCounts;
|
|
99
|
+
|
|
96
100
|
// $FlowFixMe[incompatible-call]
|
|
97
101
|
global.queueMicrotask(() => {
|
|
98
102
|
// To be consistent with the calls to the API from the same task,
|
|
@@ -101,7 +105,8 @@ function getCachedEventCounts(): Map<string, number> {
|
|
|
101
105
|
// after the current task is guaranteed to have finished.
|
|
102
106
|
cachedEventCounts = null;
|
|
103
107
|
});
|
|
104
|
-
|
|
108
|
+
|
|
109
|
+
return eventCounts;
|
|
105
110
|
}
|
|
106
111
|
|
|
107
112
|
/**
|
|
@@ -13,22 +13,18 @@
|
|
|
13
13
|
import type {
|
|
14
14
|
DOMHighResTimeStamp,
|
|
15
15
|
PerformanceEntryType,
|
|
16
|
+
PerformanceEntryList,
|
|
16
17
|
} from './PerformanceEntry';
|
|
17
|
-
import type {PerformanceEntryList} from './PerformanceObserver';
|
|
18
18
|
import type {DetailType, PerformanceMarkOptions} from './UserTiming';
|
|
19
19
|
|
|
20
20
|
import {EventCounts} from './EventTiming';
|
|
21
21
|
import MemoryInfo from './MemoryInfo';
|
|
22
|
-
import {ALWAYS_LOGGED_ENTRY_TYPES} from './PerformanceEntry';
|
|
23
|
-
import {warnNoNativePerformanceObserver} from './Utilities';
|
|
24
22
|
import {
|
|
25
23
|
performanceEntryTypeToRaw,
|
|
26
24
|
rawToPerformanceEntry,
|
|
27
25
|
} from './RawPerformanceEntry';
|
|
28
|
-
import {RawPerformanceEntryTypeValues} from './RawPerformanceEntry';
|
|
29
26
|
import ReactNativeStartupTiming from './ReactNativeStartupTiming';
|
|
30
27
|
import NativePerformance from './specs/NativePerformance';
|
|
31
|
-
import NativePerformanceObserver from './specs/NativePerformanceObserver';
|
|
32
28
|
import {PerformanceMark, PerformanceMeasure} from './UserTiming';
|
|
33
29
|
import {warnNoNativePerformance} from './Utilities';
|
|
34
30
|
|
|
@@ -47,6 +43,9 @@ export type PerformanceMeasureOptions = {
|
|
|
47
43
|
end?: DOMHighResTimeStamp,
|
|
48
44
|
};
|
|
49
45
|
|
|
46
|
+
const ENTRY_TYPES_AVAILABLE_FROM_TIMELINE: $ReadOnlyArray<PerformanceEntryType> =
|
|
47
|
+
['mark', 'measure'];
|
|
48
|
+
|
|
50
49
|
/**
|
|
51
50
|
* Partial implementation of the Performance interface for RN,
|
|
52
51
|
* corresponding to the standard in
|
|
@@ -122,15 +121,12 @@ export default class Performance {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
clearMarks(markName?: string): void {
|
|
125
|
-
if (!
|
|
126
|
-
|
|
124
|
+
if (!NativePerformance?.clearMarks) {
|
|
125
|
+
warnNoNativePerformance();
|
|
127
126
|
return;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
RawPerformanceEntryTypeValues.MARK,
|
|
132
|
-
markName,
|
|
133
|
-
);
|
|
129
|
+
NativePerformance.clearMarks(markName);
|
|
134
130
|
}
|
|
135
131
|
|
|
136
132
|
measure(
|
|
@@ -209,15 +205,12 @@ export default class Performance {
|
|
|
209
205
|
}
|
|
210
206
|
|
|
211
207
|
clearMeasures(measureName?: string): void {
|
|
212
|
-
if (!
|
|
213
|
-
|
|
208
|
+
if (!NativePerformance?.clearMeasures) {
|
|
209
|
+
warnNoNativePerformance();
|
|
214
210
|
return;
|
|
215
211
|
}
|
|
216
212
|
|
|
217
|
-
|
|
218
|
-
RawPerformanceEntryTypeValues.MEASURE,
|
|
219
|
-
measureName,
|
|
220
|
-
);
|
|
213
|
+
NativePerformance?.clearMeasures(measureName);
|
|
221
214
|
}
|
|
222
215
|
|
|
223
216
|
/**
|
|
@@ -234,28 +227,28 @@ export default class Performance {
|
|
|
234
227
|
* https://www.w3.org/TR/performance-timeline/#extensions-to-the-performance-interface
|
|
235
228
|
*/
|
|
236
229
|
getEntries(): PerformanceEntryList {
|
|
237
|
-
if (!
|
|
238
|
-
|
|
230
|
+
if (!NativePerformance?.getEntries) {
|
|
231
|
+
warnNoNativePerformance();
|
|
239
232
|
return [];
|
|
240
233
|
}
|
|
241
|
-
return
|
|
234
|
+
return NativePerformance.getEntries().map(rawToPerformanceEntry);
|
|
242
235
|
}
|
|
243
236
|
|
|
244
237
|
getEntriesByType(entryType: PerformanceEntryType): PerformanceEntryList {
|
|
245
|
-
if (
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
);
|
|
238
|
+
if (
|
|
239
|
+
entryType != null &&
|
|
240
|
+
!ENTRY_TYPES_AVAILABLE_FROM_TIMELINE.includes(entryType)
|
|
241
|
+
) {
|
|
242
|
+
console.warn('Deprecated API for given entry type.');
|
|
251
243
|
return [];
|
|
252
244
|
}
|
|
253
245
|
|
|
254
|
-
if (!
|
|
255
|
-
|
|
246
|
+
if (!NativePerformance?.getEntriesByType) {
|
|
247
|
+
warnNoNativePerformance();
|
|
256
248
|
return [];
|
|
257
249
|
}
|
|
258
|
-
|
|
250
|
+
|
|
251
|
+
return NativePerformance.getEntriesByType(
|
|
259
252
|
performanceEntryTypeToRaw(entryType),
|
|
260
253
|
).map(rawToPerformanceEntry);
|
|
261
254
|
}
|
|
@@ -265,24 +258,21 @@ export default class Performance {
|
|
|
265
258
|
entryType?: PerformanceEntryType,
|
|
266
259
|
): PerformanceEntryList {
|
|
267
260
|
if (
|
|
268
|
-
entryType
|
|
269
|
-
!
|
|
261
|
+
entryType != null &&
|
|
262
|
+
!ENTRY_TYPES_AVAILABLE_FROM_TIMELINE.includes(entryType)
|
|
270
263
|
) {
|
|
271
|
-
console.warn(
|
|
272
|
-
`Performance.getEntriesByName: Only valid for ${JSON.stringify(
|
|
273
|
-
ALWAYS_LOGGED_ENTRY_TYPES,
|
|
274
|
-
)} entry types, got ${entryType}`,
|
|
275
|
-
);
|
|
264
|
+
console.warn('Deprecated API for given entry type.');
|
|
276
265
|
return [];
|
|
277
266
|
}
|
|
278
267
|
|
|
279
|
-
if (!
|
|
280
|
-
|
|
268
|
+
if (!NativePerformance?.getEntriesByName) {
|
|
269
|
+
warnNoNativePerformance();
|
|
281
270
|
return [];
|
|
282
271
|
}
|
|
283
|
-
|
|
284
|
-
|
|
272
|
+
|
|
273
|
+
return NativePerformance.getEntriesByName(
|
|
285
274
|
entryName,
|
|
275
|
+
entryType != null ? performanceEntryTypeToRaw(entryType) : undefined,
|
|
286
276
|
).map(rawToPerformanceEntry);
|
|
287
277
|
}
|
|
288
278
|
}
|
|
@@ -21,11 +21,6 @@ export type PerformanceEntryJSON = {
|
|
|
21
21
|
...
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export const ALWAYS_LOGGED_ENTRY_TYPES: $ReadOnlyArray<PerformanceEntryType> = [
|
|
25
|
-
'mark',
|
|
26
|
-
'measure',
|
|
27
|
-
];
|
|
28
|
-
|
|
29
24
|
export class PerformanceEntry {
|
|
30
25
|
#name: string;
|
|
31
26
|
#entryType: PerformanceEntryType;
|
|
@@ -69,3 +64,5 @@ export class PerformanceEntry {
|
|
|
69
64
|
};
|
|
70
65
|
}
|
|
71
66
|
}
|
|
67
|
+
|
|
68
|
+
export type PerformanceEntryList = $ReadOnlyArray<PerformanceEntry>;
|
|
@@ -11,20 +11,18 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
DOMHighResTimeStamp,
|
|
13
13
|
PerformanceEntryType,
|
|
14
|
+
PerformanceEntryList,
|
|
14
15
|
} from './PerformanceEntry';
|
|
15
16
|
|
|
16
17
|
import {PerformanceEventTiming} from './EventTiming';
|
|
17
|
-
import {PerformanceEntry} from './PerformanceEntry';
|
|
18
18
|
import {
|
|
19
19
|
performanceEntryTypeToRaw,
|
|
20
20
|
rawToPerformanceEntry,
|
|
21
21
|
rawToPerformanceEntryType,
|
|
22
22
|
} from './RawPerformanceEntry';
|
|
23
|
-
import
|
|
24
|
-
import type {OpaqueNativeObserverHandle} from './specs/
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
export type PerformanceEntryList = $ReadOnlyArray<PerformanceEntry>;
|
|
23
|
+
import NativePerformance from './specs/NativePerformance';
|
|
24
|
+
import type {OpaqueNativeObserverHandle} from './specs/NativePerformance';
|
|
25
|
+
import {warnNoNativePerformance} from './Utilities';
|
|
28
26
|
|
|
29
27
|
export {PerformanceEntry} from './PerformanceEntry';
|
|
30
28
|
|
|
@@ -76,15 +74,15 @@ export type PerformanceObserverInit = {
|
|
|
76
74
|
};
|
|
77
75
|
|
|
78
76
|
function getSupportedPerformanceEntryTypes(): $ReadOnlyArray<PerformanceEntryType> {
|
|
79
|
-
if (!
|
|
77
|
+
if (!NativePerformance) {
|
|
80
78
|
return Object.freeze([]);
|
|
81
79
|
}
|
|
82
|
-
if (!
|
|
80
|
+
if (!NativePerformance.getSupportedPerformanceEntryTypes) {
|
|
83
81
|
// fallback if getSupportedPerformanceEntryTypes is not defined on native side
|
|
84
82
|
return Object.freeze(['mark', 'measure', 'event']);
|
|
85
83
|
}
|
|
86
84
|
return Object.freeze(
|
|
87
|
-
|
|
85
|
+
NativePerformance.getSupportedPerformanceEntryTypes().map(
|
|
88
86
|
rawToPerformanceEntryType,
|
|
89
87
|
),
|
|
90
88
|
);
|
|
@@ -121,11 +119,8 @@ export class PerformanceObserver {
|
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
observe(options: PerformanceObserverInit): void {
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
NativePerformanceObserver.observe == null
|
|
127
|
-
) {
|
|
128
|
-
warnNoNativePerformanceObserver();
|
|
122
|
+
if (!NativePerformance || NativePerformance.observe == null) {
|
|
123
|
+
warnNoNativePerformance();
|
|
129
124
|
return;
|
|
130
125
|
}
|
|
131
126
|
|
|
@@ -137,12 +132,12 @@ export class PerformanceObserver {
|
|
|
137
132
|
|
|
138
133
|
if (options.entryTypes) {
|
|
139
134
|
this.#type = 'multiple';
|
|
140
|
-
|
|
135
|
+
NativePerformance.observe?.(this.#nativeObserverHandle, {
|
|
141
136
|
entryTypes: options.entryTypes.map(performanceEntryTypeToRaw),
|
|
142
137
|
});
|
|
143
138
|
} else if (options.type) {
|
|
144
139
|
this.#type = 'single';
|
|
145
|
-
|
|
140
|
+
NativePerformance.observe?.(this.#nativeObserverHandle, {
|
|
146
141
|
type: performanceEntryTypeToRaw(options.type),
|
|
147
142
|
buffered: options.buffered,
|
|
148
143
|
durationThreshold: options.durationThreshold,
|
|
@@ -151,35 +146,28 @@ export class PerformanceObserver {
|
|
|
151
146
|
}
|
|
152
147
|
|
|
153
148
|
disconnect(): void {
|
|
154
|
-
if (!
|
|
155
|
-
|
|
149
|
+
if (!NativePerformance) {
|
|
150
|
+
warnNoNativePerformance();
|
|
156
151
|
return;
|
|
157
152
|
}
|
|
158
153
|
|
|
159
|
-
if (
|
|
160
|
-
this.#nativeObserverHandle == null ||
|
|
161
|
-
!NativePerformanceObserver.disconnect
|
|
162
|
-
) {
|
|
154
|
+
if (this.#nativeObserverHandle == null || !NativePerformance.disconnect) {
|
|
163
155
|
return;
|
|
164
156
|
}
|
|
165
157
|
|
|
166
|
-
|
|
158
|
+
NativePerformance.disconnect(this.#nativeObserverHandle);
|
|
167
159
|
}
|
|
168
160
|
|
|
169
161
|
#createNativeObserver(): OpaqueNativeObserverHandle {
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
!NativePerformanceObserver.createObserver
|
|
173
|
-
) {
|
|
174
|
-
warnNoNativePerformanceObserver();
|
|
162
|
+
if (!NativePerformance || !NativePerformance.createObserver) {
|
|
163
|
+
warnNoNativePerformance();
|
|
175
164
|
return;
|
|
176
165
|
}
|
|
177
166
|
|
|
178
167
|
this.#calledAtLeastOnce = false;
|
|
179
168
|
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
const rawEntries = NativePerformanceObserver.takeRecords?.(
|
|
169
|
+
return NativePerformance.createObserver(() => {
|
|
170
|
+
const rawEntries = NativePerformance.takeRecords?.(
|
|
183
171
|
this.#nativeObserverHandle,
|
|
184
172
|
true, // sort records
|
|
185
173
|
);
|
|
@@ -193,7 +181,7 @@ export class PerformanceObserver {
|
|
|
193
181
|
let droppedEntriesCount = 0;
|
|
194
182
|
if (!this.#calledAtLeastOnce) {
|
|
195
183
|
droppedEntriesCount =
|
|
196
|
-
|
|
184
|
+
NativePerformance.getDroppedEntriesCount?.(
|
|
197
185
|
this.#nativeObserverHandle,
|
|
198
186
|
) ?? 0;
|
|
199
187
|
this.#calledAtLeastOnce = true;
|
|
@@ -12,7 +12,7 @@ import type {PerformanceEntryType} from './PerformanceEntry';
|
|
|
12
12
|
import type {
|
|
13
13
|
RawPerformanceEntry,
|
|
14
14
|
RawPerformanceEntryType,
|
|
15
|
-
} from './specs/
|
|
15
|
+
} from './specs/NativePerformance';
|
|
16
16
|
|
|
17
17
|
import {PerformanceEventTiming} from './EventTiming';
|
|
18
18
|
import {PerformanceLongTaskTiming} from './LongTasks';
|
|
@@ -30,7 +30,7 @@ export type PerformanceMeasureInit = {
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export class PerformanceMark extends PerformanceEntry {
|
|
33
|
-
detail: DetailType;
|
|
33
|
+
#detail: DetailType;
|
|
34
34
|
|
|
35
35
|
constructor(markName: string, markOptions?: PerformanceMarkOptions) {
|
|
36
36
|
super({
|
|
@@ -41,9 +41,13 @@ export class PerformanceMark extends PerformanceEntry {
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
if (markOptions) {
|
|
44
|
-
this
|
|
44
|
+
this.#detail = markOptions.detail;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
get detail(): DetailType {
|
|
49
|
+
return this.#detail;
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
export class PerformanceMeasure extends PerformanceEntry {
|
|
@@ -16,10 +16,3 @@ export function warnNoNativePerformance() {
|
|
|
16
16
|
'Missing native implementation of Performance',
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
export function warnNoNativePerformanceObserver() {
|
|
21
|
-
warnOnce(
|
|
22
|
-
'missing-native-performance-observer',
|
|
23
|
-
'Missing native implementation of PerformanceObserver',
|
|
24
|
-
);
|
|
25
|
-
}
|