@office-iss/react-native-win32 0.81.2 → 0.82.0-preview.2
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 +3 -11
- package/CHANGELOG.json +118 -43
- package/CHANGELOG.md +45 -27
- package/IntegrationTests/IntegrationTestsApp.js +2 -2
- package/IntegrationTests/LayoutEventsTest.js +3 -3
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -3
- package/Libraries/Alert/RCTAlertManager.android.js +4 -2
- package/Libraries/Animated/Animated.d.ts +2 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedExports.js.flow +1 -0
- package/Libraries/Animated/AnimatedImplementation.js +4 -2
- package/Libraries/Animated/AnimatedMock.js +1 -1
- package/Libraries/Animated/Easing.js +2 -0
- package/Libraries/Animated/NativeAnimatedAllowlist.js +1 -0
- package/Libraries/Animated/animations/Animation.js +19 -20
- package/Libraries/Animated/animations/TimingAnimation.js +2 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +9 -9
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +14 -7
- package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
- package/Libraries/Animated/nodes/AnimatedProps.js +32 -32
- package/Libraries/Animated/nodes/AnimatedStyle.js +23 -21
- package/Libraries/Animated/nodes/AnimatedTransform.js +6 -6
- package/Libraries/Animated/nodes/AnimatedValue.js +18 -26
- package/Libraries/AppState/AppState.js +8 -4
- package/Libraries/BatchedBridge/BatchedBridge.js +1 -0
- package/Libraries/BatchedBridge/MessageQueue.js +5 -0
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/BlobManager.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +2 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +2 -2
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.win32.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +10 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +13 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +2 -2
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +12 -5
- package/Libraries/Components/TextInput/TextInput.flow.win32.js +12 -5
- package/Libraries/Components/TextInput/TextInput.js +14 -5
- package/Libraries/Components/TextInput/TextInput.win32.js +15 -7
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +2 -3
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -3
- package/Libraries/Components/View/View.js +81 -167
- package/Libraries/Components/View/View.win32.js +3 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.js +1 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +4 -2
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +37 -10
- package/Libraries/Core/Timers/JSTimers.js +4 -1
- package/Libraries/Core/Timers/NativeTiming.js +1 -0
- package/Libraries/Core/Timers/immediateShim.js +2 -1
- package/Libraries/Core/Timers/queueMicrotask.js +1 -0
- package/Libraries/Core/setUpPerformance.js +3 -4
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +5 -3
- package/Libraries/Image/Image.android.js +327 -111
- package/Libraries/Image/Image.ios.js +6 -1
- package/Libraries/Image/Image.win32.js +6 -1
- package/Libraries/Image/ImageSourceUtils.js +8 -2
- package/Libraries/Image/assetPaths.js +1 -1
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Image/resolveAssetSource.win32.js +6 -7
- package/Libraries/Interaction/InteractionManager.js +118 -167
- package/Libraries/Interaction/PanResponder.js +7 -52
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
- package/Libraries/Lists/FlatList.js +5 -6
- package/Libraries/LogBox/Data/LogBoxData.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +1 -1
- package/Libraries/Modal/Modal.js +3 -3
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/NativeComponent/ViewConfig.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.win32.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +20 -5
- package/Libraries/Network/convertRequestBody.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +10 -9
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/HoverState.win32.js +2 -0
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.win32.js +1 -1
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +2 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +3 -3
- package/Libraries/ReactNative/RendererImplementation.js +116 -116
- package/Libraries/ReactNative/UIManager.js +3 -3
- package/Libraries/ReactNative/renderApplication.js +1 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Share/Share.js +4 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +4 -0
- package/Libraries/StyleSheet/StyleSheet.d.ts +7 -22
- package/Libraries/StyleSheet/StyleSheetExports.js +2 -8
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +11 -18
- package/Libraries/StyleSheet/flattenStyle.js +2 -2
- package/Libraries/StyleSheet/processAspectRatio.js +2 -0
- package/Libraries/StyleSheet/processFilter.js +5 -5
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -2
- package/Libraries/Text/Text.js +534 -234
- package/Libraries/Text/Text.win32.js +647 -274
- package/Libraries/Text/TextNativeComponent.js +2 -2
- package/Libraries/Text/TextNativeComponent.win32.js +2 -2
- package/Libraries/Utilities/Appearance.d.ts +3 -5
- package/Libraries/Utilities/Appearance.js +5 -17
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/Platform.android.js +3 -3
- package/Libraries/Utilities/Platform.d.ts +1 -0
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.win32.js +3 -3
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +12 -0
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +32 -0
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +2 -0
- package/Libraries/promiseRejectionTrackingOptions.js +17 -31
- package/Libraries/vendor/emitter/EventEmitter.js +1 -1
- package/flow/bom.js.flow +223 -1
- package/flow/prettier.js.flow +14 -0
- package/index.js +14 -2
- package/index.win32.js +16 -2
- package/jest/local-setup.js +2 -2
- package/jest/mock.js +1 -1
- package/jest/mockComponent.js +9 -9
- package/jest/mockNativeComponent.js +3 -2
- package/jest/mocks/Modal.js +1 -1
- package/jest/mocks/ScrollView.js +1 -1
- package/jest/mocks/ViewNativeComponent.js +1 -1
- package/jest/setup.js +23 -12
- package/overrides.json +23 -23
- package/package.json +28 -27
- package/saveAssetPlugin.js +2 -2
- package/src/private/animated/NativeAnimatedHelper.js +16 -5
- package/src/private/animated/NativeAnimatedHelper.win32.js +16 -5
- package/src/private/animated/createAnimatedPropsHook.js +11 -60
- package/src/private/animated/createAnimatedPropsMemoHook.js +8 -54
- package/src/private/components/virtualview/VirtualView.js +43 -12
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +6 -0
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +85 -52
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -6
- package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
- package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -0
- package/src/private/types/HostInstance.js +4 -1
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +22 -2
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +5 -3
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +16 -13
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +45 -22
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +26 -192
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +15 -12
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +14 -11
- package/src/private/webapis/geometry/DOMRectList.js +2 -2
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +1 -1
- package/src/private/webapis/performance/EventTiming.js +40 -25
- package/src/private/webapis/performance/LongTasks.js +35 -2
- package/src/private/webapis/performance/Performance.js +347 -166
- package/src/private/webapis/performance/PerformanceEntry.js +40 -23
- package/src/private/webapis/performance/PerformanceObserver.js +37 -29
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +3 -24
- package/src/private/webapis/performance/ResourceTiming.js +29 -18
- package/src/private/webapis/performance/UserTiming.js +92 -34
- package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
- package/src/private/webapis/performance/internals/Utilities.js +9 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +23 -23
- package/src/private/webapis/structuredClone/structuredClone.js +10 -10
- package/src-win/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
- package/Libraries/Interaction/InteractionManagerStub.js +0 -184
- package/Libraries/Interaction/TaskQueue.js +0 -183
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
package/flow/bom.js.flow
CHANGED
|
@@ -12,6 +12,71 @@
|
|
|
12
12
|
|
|
13
13
|
declare var window: typeof globalThis;
|
|
14
14
|
|
|
15
|
+
type DevToolsColor =
|
|
16
|
+
| 'primary'
|
|
17
|
+
| 'primary-light'
|
|
18
|
+
| 'primary-dark'
|
|
19
|
+
| 'secondary'
|
|
20
|
+
| 'secondary-light'
|
|
21
|
+
| 'secondary-dark'
|
|
22
|
+
| 'tertiary'
|
|
23
|
+
| 'tertiary-light'
|
|
24
|
+
| 'tertiary-dark'
|
|
25
|
+
| 'warning'
|
|
26
|
+
| 'error';
|
|
27
|
+
|
|
28
|
+
// $FlowExpectedError[libdef-override] Flow core definitions are incomplete.
|
|
29
|
+
declare var console: {
|
|
30
|
+
// Logging
|
|
31
|
+
log(...data: $ReadOnlyArray<mixed>): void,
|
|
32
|
+
trace(...data: $ReadOnlyArray<mixed>): void,
|
|
33
|
+
debug(...data: $ReadOnlyArray<mixed>): void,
|
|
34
|
+
info(...data: $ReadOnlyArray<mixed>): void,
|
|
35
|
+
warn(...data: $ReadOnlyArray<mixed>): void,
|
|
36
|
+
error(...data: $ReadOnlyArray<mixed>): void,
|
|
37
|
+
|
|
38
|
+
// Grouping
|
|
39
|
+
group(...data: $ReadOnlyArray<mixed>): void,
|
|
40
|
+
groupCollapsed(...data: $ReadOnlyArray<mixed>): void,
|
|
41
|
+
groupEnd(): void,
|
|
42
|
+
|
|
43
|
+
// Printing
|
|
44
|
+
table(
|
|
45
|
+
tabularData:
|
|
46
|
+
| $ReadOnly<{[key: string]: mixed, ...}>
|
|
47
|
+
| $ReadOnlyArray<$ReadOnly<{[key: string]: mixed, ...}>>
|
|
48
|
+
| $ReadOnlyArray<$ReadOnlyArray<mixed>>,
|
|
49
|
+
): void,
|
|
50
|
+
dir(...data: $ReadOnlyArray<mixed>): void,
|
|
51
|
+
dirxml(...data: $ReadOnlyArray<mixed>): void,
|
|
52
|
+
clear(): void,
|
|
53
|
+
|
|
54
|
+
// Utilities
|
|
55
|
+
assert(condition: mixed, ...data: $ReadOnlyArray<mixed>): void,
|
|
56
|
+
|
|
57
|
+
// Profiling
|
|
58
|
+
profile(name?: string): void,
|
|
59
|
+
profileEnd(name?: string): void,
|
|
60
|
+
|
|
61
|
+
// Counts
|
|
62
|
+
count(label?: string): void,
|
|
63
|
+
countReset(label?: string): void,
|
|
64
|
+
|
|
65
|
+
// Timing / tracing
|
|
66
|
+
time(label?: string): void,
|
|
67
|
+
timeEnd(label?: string): void,
|
|
68
|
+
timeStamp(
|
|
69
|
+
label?: string,
|
|
70
|
+
start?: string | number,
|
|
71
|
+
end?: string | number,
|
|
72
|
+
trackName?: string,
|
|
73
|
+
trackGroup?: string,
|
|
74
|
+
color?: DevToolsColor,
|
|
75
|
+
): void,
|
|
76
|
+
|
|
77
|
+
...
|
|
78
|
+
};
|
|
79
|
+
|
|
15
80
|
declare class Navigator {
|
|
16
81
|
product: 'ReactNative';
|
|
17
82
|
appName?: ?string;
|
|
@@ -23,12 +88,169 @@ declare var navigator: Navigator;
|
|
|
23
88
|
// https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp
|
|
24
89
|
declare type DOMHighResTimeStamp = number;
|
|
25
90
|
|
|
91
|
+
type PerformanceEntryFilterOptions = {
|
|
92
|
+
entryType: string,
|
|
93
|
+
name: string,
|
|
94
|
+
...
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// https://www.w3.org/TR/performance-timeline-2/
|
|
98
|
+
declare class PerformanceEntry {
|
|
99
|
+
duration: DOMHighResTimeStamp;
|
|
100
|
+
entryType: string;
|
|
101
|
+
name: string;
|
|
102
|
+
startTime: DOMHighResTimeStamp;
|
|
103
|
+
toJSON(): string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// https://w3c.github.io/user-timing/#performancemark
|
|
107
|
+
declare class PerformanceMark extends PerformanceEntry {
|
|
108
|
+
constructor(name: string, markOptions?: PerformanceMarkOptions): void;
|
|
109
|
+
+detail: mixed;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// https://w3c.github.io/user-timing/#performancemeasure
|
|
113
|
+
declare class PerformanceMeasure extends PerformanceEntry {
|
|
114
|
+
+detail: mixed;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// https://w3c.github.io/server-timing/#the-performanceservertiming-interface
|
|
118
|
+
declare class PerformanceServerTiming {
|
|
119
|
+
description: string;
|
|
120
|
+
duration: DOMHighResTimeStamp;
|
|
121
|
+
name: string;
|
|
122
|
+
toJSON(): string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming
|
|
126
|
+
// https://w3c.github.io/server-timing/#extension-to-the-performanceresourcetiming-interface
|
|
127
|
+
declare class PerformanceResourceTiming extends PerformanceEntry {
|
|
128
|
+
connectEnd: number;
|
|
129
|
+
connectStart: number;
|
|
130
|
+
decodedBodySize: number;
|
|
131
|
+
domainLookupEnd: number;
|
|
132
|
+
domainLookupStart: number;
|
|
133
|
+
encodedBodySize: number;
|
|
134
|
+
fetchStart: number;
|
|
135
|
+
initiatorType: string;
|
|
136
|
+
nextHopProtocol: string;
|
|
137
|
+
redirectEnd: number;
|
|
138
|
+
redirectStart: number;
|
|
139
|
+
requestStart: number;
|
|
140
|
+
responseEnd: number;
|
|
141
|
+
responseStart: number;
|
|
142
|
+
secureConnectionStart: number;
|
|
143
|
+
serverTiming: Array<PerformanceServerTiming>;
|
|
144
|
+
transferSize: number;
|
|
145
|
+
workerStart: number;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// https://w3c.github.io/event-timing/#sec-performance-event-timing
|
|
149
|
+
declare class PerformanceEventTiming extends PerformanceEntry {
|
|
150
|
+
cancelable: boolean;
|
|
151
|
+
interactionId: number;
|
|
152
|
+
processingEnd: number;
|
|
153
|
+
processingStart: number;
|
|
154
|
+
target: ?Node;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// https://w3c.github.io/longtasks/#taskattributiontiming
|
|
158
|
+
declare class TaskAttributionTiming extends PerformanceEntry {
|
|
159
|
+
containerId: string;
|
|
160
|
+
containerName: string;
|
|
161
|
+
containerSrc: string;
|
|
162
|
+
containerType: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// https://w3c.github.io/longtasks/#sec-PerformanceLongTaskTiming
|
|
166
|
+
declare class PerformanceLongTaskTiming extends PerformanceEntry {
|
|
167
|
+
attribution: $ReadOnlyArray<TaskAttributionTiming>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// https://www.w3.org/TR/user-timing/#extensions-performance-interface
|
|
171
|
+
declare type PerformanceMarkOptions = {
|
|
172
|
+
detail?: mixed,
|
|
173
|
+
startTime?: number,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
declare type PerformanceMeasureOptions = {
|
|
177
|
+
detail?: mixed,
|
|
178
|
+
duration?: number,
|
|
179
|
+
end?: number | string,
|
|
180
|
+
start?: number | string,
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
type EventCountsForEachCallbackType =
|
|
184
|
+
| (() => void)
|
|
185
|
+
| ((value: number) => void)
|
|
186
|
+
| ((value: number, key: string) => void)
|
|
187
|
+
| ((value: number, key: string, map: Map<string, number>) => void);
|
|
188
|
+
|
|
189
|
+
// https://www.w3.org/TR/event-timing/#eventcounts
|
|
190
|
+
declare interface EventCounts {
|
|
191
|
+
entries(): Iterator<[string, number]>;
|
|
192
|
+
|
|
193
|
+
forEach(callback: EventCountsForEachCallbackType): void;
|
|
194
|
+
get(key: string): ?number;
|
|
195
|
+
has(key: string): boolean;
|
|
196
|
+
keys(): Iterator<string>;
|
|
197
|
+
size: number;
|
|
198
|
+
values(): Iterator<number>;
|
|
199
|
+
}
|
|
200
|
+
|
|
26
201
|
declare class Performance {
|
|
27
|
-
|
|
202
|
+
+eventCounts: EventCounts;
|
|
203
|
+
+timeOrigin: DOMHighResTimeStamp;
|
|
204
|
+
|
|
205
|
+
clearMarks(name?: string): void;
|
|
206
|
+
clearMeasures(name?: string): void;
|
|
207
|
+
getEntries: (
|
|
208
|
+
options?: PerformanceEntryFilterOptions,
|
|
209
|
+
) => Array<PerformanceEntry>;
|
|
210
|
+
getEntriesByName: (name: string, type?: string) => Array<PerformanceEntry>;
|
|
211
|
+
getEntriesByType: (type: string) => Array<PerformanceEntry>;
|
|
212
|
+
mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
|
|
213
|
+
measure(
|
|
214
|
+
name: string,
|
|
215
|
+
startMarkOrOptions?: string | PerformanceMeasureOptions,
|
|
216
|
+
endMark?: string,
|
|
217
|
+
): PerformanceMeasure;
|
|
218
|
+
now(): DOMHighResTimeStamp;
|
|
219
|
+
toJSON(): string;
|
|
28
220
|
}
|
|
29
221
|
|
|
30
222
|
declare var performance: Performance;
|
|
31
223
|
|
|
224
|
+
type PerformanceEntryList = Array<PerformanceEntry>;
|
|
225
|
+
|
|
226
|
+
declare interface PerformanceObserverEntryList {
|
|
227
|
+
getEntries(): PerformanceEntryList;
|
|
228
|
+
getEntriesByName(name: string, type: ?string): PerformanceEntryList;
|
|
229
|
+
getEntriesByType(type: string): PerformanceEntryList;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
type PerformanceObserverInit = {
|
|
233
|
+
buffered?: boolean,
|
|
234
|
+
entryTypes?: Array<string>,
|
|
235
|
+
type?: string,
|
|
236
|
+
...
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
declare class PerformanceObserver {
|
|
240
|
+
constructor(
|
|
241
|
+
callback: (
|
|
242
|
+
entries: PerformanceObserverEntryList,
|
|
243
|
+
observer: PerformanceObserver,
|
|
244
|
+
) => mixed,
|
|
245
|
+
): void;
|
|
246
|
+
|
|
247
|
+
disconnect(): void;
|
|
248
|
+
observe(options: ?PerformanceObserverInit): void;
|
|
249
|
+
static supportedEntryTypes: Array<string>;
|
|
250
|
+
|
|
251
|
+
takeRecords(): PerformanceEntryList;
|
|
252
|
+
}
|
|
253
|
+
|
|
32
254
|
type FormDataEntryValue = string | File;
|
|
33
255
|
|
|
34
256
|
declare class FormData {
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
// $FlowFixMe[unsupported-syntax]
|
|
12
|
+
declare module 'prettier' {
|
|
13
|
+
declare module.exports: $FlowFixMe;
|
|
14
|
+
}
|
package/index.js
CHANGED
|
@@ -86,14 +86,14 @@ module.exports = {
|
|
|
86
86
|
/**
|
|
87
87
|
* @deprecated SafeAreaView has been deprecated and will be removed in a future release.
|
|
88
88
|
* Please use 'react-native-safe-area-context' instead.
|
|
89
|
-
* See https://github.com/
|
|
89
|
+
* See https://github.com/AppAndFlow/react-native-safe-area-context
|
|
90
90
|
*/
|
|
91
91
|
get SafeAreaView() {
|
|
92
92
|
warnOnce(
|
|
93
93
|
'safe-area-view-deprecated',
|
|
94
94
|
'SafeAreaView has been deprecated and will be removed in a future release. ' +
|
|
95
95
|
"Please use 'react-native-safe-area-context' instead. " +
|
|
96
|
-
'See https://github.com/
|
|
96
|
+
'See https://github.com/AppAndFlow/react-native-safe-area-context',
|
|
97
97
|
);
|
|
98
98
|
return require('./Libraries/Components/SafeAreaView/SafeAreaView').default;
|
|
99
99
|
},
|
|
@@ -224,6 +224,12 @@ module.exports = {
|
|
|
224
224
|
* @deprecated
|
|
225
225
|
*/
|
|
226
226
|
get InteractionManager() {
|
|
227
|
+
warnOnce(
|
|
228
|
+
'interaction-manager-deprecated',
|
|
229
|
+
'InteractionManager has been deprecated and will be removed in a ' +
|
|
230
|
+
'future release. Please refactor long tasks into smaller ones, and ' +
|
|
231
|
+
" use 'requestIdleCallback' instead.",
|
|
232
|
+
);
|
|
227
233
|
return require('./Libraries/Interaction/InteractionManager').default;
|
|
228
234
|
},
|
|
229
235
|
get Keyboard() {
|
|
@@ -241,6 +247,9 @@ module.exports = {
|
|
|
241
247
|
get NativeAppEventEmitter() {
|
|
242
248
|
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter').default;
|
|
243
249
|
},
|
|
250
|
+
get NativeComponentRegistry() {
|
|
251
|
+
return require('./Libraries/NativeComponent/NativeComponentRegistry');
|
|
252
|
+
},
|
|
244
253
|
get NativeDialogManagerAndroid() {
|
|
245
254
|
return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
|
|
246
255
|
.default;
|
|
@@ -289,6 +298,9 @@ module.exports = {
|
|
|
289
298
|
get requireNativeComponent() {
|
|
290
299
|
return require('./Libraries/ReactNative/requireNativeComponent').default;
|
|
291
300
|
},
|
|
301
|
+
get ReactNativeVersion() {
|
|
302
|
+
return require('./Libraries/Core/ReactNativeVersion').default;
|
|
303
|
+
},
|
|
292
304
|
get RootTagContext() {
|
|
293
305
|
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
|
294
306
|
},
|
package/index.win32.js
CHANGED
|
@@ -73,6 +73,7 @@ import typeof LogBox from './Libraries/LogBox/LogBox';
|
|
|
73
73
|
import typeof Modal from './Libraries/Modal/Modal';
|
|
74
74
|
// $FlowFixMe[invalid-exported-annotation]
|
|
75
75
|
import typeof NativeDialogManagerAndroid from './Libraries/NativeModules/specs/NativeDialogManagerAndroid';
|
|
76
|
+
import typeof * as NativeComponentRegistry from './Libraries/NativeComponent/NativeComponentRegistry';
|
|
76
77
|
import typeof Networking from './Libraries/Network/RCTNetworking';
|
|
77
78
|
import typeof * as Systrace from './Libraries/Performance/Systrace';
|
|
78
79
|
import typeof PermissionsAndroid from './Libraries/PermissionsAndroid/PermissionsAndroid';
|
|
@@ -106,6 +107,7 @@ import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimension
|
|
|
106
107
|
import typeof Vibration from './Libraries/Vibration/Vibration';
|
|
107
108
|
import typeof DevMenu from './src/private/devsupport/devmenu/DevMenu';
|
|
108
109
|
import typeof registerCallableModule from './Libraries/Core/registerCallableModule';
|
|
110
|
+
import typeof ReactNativeVersion from './Libraries/Core/ReactNativeVersion';
|
|
109
111
|
// Windows]]
|
|
110
112
|
|
|
111
113
|
const warnOnce = require('./Libraries/Utilities/warnOnce').default;
|
|
@@ -173,14 +175,14 @@ module.exports = {
|
|
|
173
175
|
/**
|
|
174
176
|
* @deprecated SafeAreaView has been deprecated and will be removed in a future release.
|
|
175
177
|
* Please use 'react-native-safe-area-context' instead.
|
|
176
|
-
* See https://github.com/
|
|
178
|
+
* See https://github.com/AppAndFlow/react-native-safe-area-context
|
|
177
179
|
*/
|
|
178
180
|
get SafeAreaView(): SafeAreaView {
|
|
179
181
|
warnOnce(
|
|
180
182
|
'safe-area-view-deprecated',
|
|
181
183
|
'SafeAreaView has been deprecated and will be removed in a future release. ' +
|
|
182
184
|
"Please use 'react-native-safe-area-context' instead. " +
|
|
183
|
-
'See https://github.com/
|
|
185
|
+
'See https://github.com/AppAndFlow/react-native-safe-area-context',
|
|
184
186
|
);
|
|
185
187
|
return require('./Libraries/Components/SafeAreaView/SafeAreaView').default;
|
|
186
188
|
},
|
|
@@ -309,6 +311,12 @@ module.exports = {
|
|
|
309
311
|
* @deprecated
|
|
310
312
|
*/
|
|
311
313
|
get InteractionManager(): InteractionManager {
|
|
314
|
+
warnOnce(
|
|
315
|
+
'interaction-manager-deprecated',
|
|
316
|
+
'InteractionManager has been deprecated and will be removed in a ' +
|
|
317
|
+
'future release. Please refactor long tasks into smaller ones, and ' +
|
|
318
|
+
" use 'requestIdleCallback' instead.",
|
|
319
|
+
);
|
|
312
320
|
return require('./Libraries/Interaction/InteractionManager').default;
|
|
313
321
|
},
|
|
314
322
|
get Keyboard(): Keyboard {
|
|
@@ -326,6 +334,9 @@ module.exports = {
|
|
|
326
334
|
get NativeAppEventEmitter(): RCTNativeAppEventEmitter {
|
|
327
335
|
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter').default;
|
|
328
336
|
},
|
|
337
|
+
get NativeComponentRegistry(): NativeComponentRegistry {
|
|
338
|
+
return require('./Libraries/NativeComponent/NativeComponentRegistry');
|
|
339
|
+
},
|
|
329
340
|
get NativeDialogManagerAndroid(): NativeDialogManagerAndroid {
|
|
330
341
|
return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
|
|
331
342
|
.default;
|
|
@@ -377,6 +388,9 @@ module.exports = {
|
|
|
377
388
|
) => HostComponent<T> {
|
|
378
389
|
return require('./Libraries/ReactNative/requireNativeComponent').default;
|
|
379
390
|
},
|
|
391
|
+
get ReactNativeVersion(): ReactNativeVersion {
|
|
392
|
+
return require('./Libraries/Core/ReactNativeVersion').default;
|
|
393
|
+
},
|
|
380
394
|
get RootTagContext(): RootTagContext {
|
|
381
395
|
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
|
382
396
|
},
|
package/jest/local-setup.js
CHANGED
|
@@ -16,13 +16,13 @@ import './setup';
|
|
|
16
16
|
const consoleError = console.error;
|
|
17
17
|
const consoleWarn = console.warn;
|
|
18
18
|
|
|
19
|
-
// $
|
|
19
|
+
// $FlowFixMe[cannot-write]
|
|
20
20
|
console.error = (...args) => {
|
|
21
21
|
consoleError(...args);
|
|
22
22
|
throw new Error('console.error() was called (see error above)');
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
// $
|
|
25
|
+
// $FlowFixMe[cannot-write]
|
|
26
26
|
console.warn = (...args) => {
|
|
27
27
|
consoleWarn(...args);
|
|
28
28
|
throw new Error('console.warn() was called (see warning above)');
|
package/jest/mock.js
CHANGED
package/jest/mockComponent.js
CHANGED
|
@@ -30,9 +30,9 @@ export default function mockComponent<
|
|
|
30
30
|
? ModuleDefault<TComponentModule & typeof instanceMethods>
|
|
31
31
|
: TComponentModule & typeof instanceMethods {
|
|
32
32
|
const RealComponent: TComponentType = isESModule
|
|
33
|
-
? // $
|
|
33
|
+
? // $FlowFixMe[prop-missing]
|
|
34
34
|
jest.requireActual<TComponentModule>(moduleName).default
|
|
35
|
-
: // $
|
|
35
|
+
: // $FlowFixMe[incompatible-type]
|
|
36
36
|
jest.requireActual<TComponentModule>(moduleName);
|
|
37
37
|
|
|
38
38
|
const SuperClass: typeof React.Component<
|
|
@@ -50,7 +50,7 @@ export default function mockComponent<
|
|
|
50
50
|
(RealComponent.render == null
|
|
51
51
|
? 'Unknown'
|
|
52
52
|
: // $FlowFixMe[incompatible-use]
|
|
53
|
-
RealComponent.render.displayName ?? RealComponent.render.name);
|
|
53
|
+
(RealComponent.render.displayName ?? RealComponent.render.name));
|
|
54
54
|
|
|
55
55
|
const nameWithoutPrefix = name.replace(/^(RCT|RK)/, '');
|
|
56
56
|
|
|
@@ -58,7 +58,7 @@ export default function mockComponent<
|
|
|
58
58
|
static displayName: ?string = 'Component';
|
|
59
59
|
|
|
60
60
|
render(): React.Node {
|
|
61
|
-
// $
|
|
61
|
+
// $FlowFixMe[prop-missing]
|
|
62
62
|
const props = {...RealComponent.defaultProps};
|
|
63
63
|
|
|
64
64
|
if (this.props) {
|
|
@@ -74,8 +74,8 @@ export default function mockComponent<
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// $
|
|
78
|
-
// $
|
|
77
|
+
// $FlowFixMe[not-a-function]
|
|
78
|
+
// $FlowFixMe[prop-missing]
|
|
79
79
|
return createElement(nameWithoutPrefix, props, this.props.children);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
@@ -89,16 +89,16 @@ export default function mockComponent<
|
|
|
89
89
|
|
|
90
90
|
Component.displayName = nameWithoutPrefix;
|
|
91
91
|
|
|
92
|
-
// $
|
|
92
|
+
// $FlowFixMe[not-an-object]
|
|
93
93
|
Object.keys(RealComponent).forEach(classStatic => {
|
|
94
94
|
Component[classStatic] = RealComponent[classStatic];
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
if (instanceMethods != null) {
|
|
98
|
-
// $
|
|
98
|
+
// $FlowFixMe[unsafe-object-assign]
|
|
99
99
|
Object.assign(Component.prototype, instanceMethods);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
// $
|
|
102
|
+
// $FlowFixMe[incompatible-type]
|
|
103
103
|
return Component;
|
|
104
104
|
}
|
|
@@ -27,8 +27,8 @@ export default function mockNativeComponent<TProps: {...}>(
|
|
|
27
27
|
_nativeTag: number = nativeTag++;
|
|
28
28
|
|
|
29
29
|
render(): React.Node {
|
|
30
|
-
// $
|
|
31
|
-
// $
|
|
30
|
+
// $FlowFixMe[not-a-function]
|
|
31
|
+
// $FlowFixMe[prop-missing]
|
|
32
32
|
return createElement(viewName, this.props, this.props.children);
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -47,5 +47,6 @@ export default function mockNativeComponent<TProps: {...}>(
|
|
|
47
47
|
Component.displayName = viewName;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// $FlowFixMe[incompatible-type] - Error supressed during the migration of HostInstance to ReactNativeElement
|
|
50
51
|
return Component;
|
|
51
52
|
}
|
package/jest/mocks/Modal.js
CHANGED
|
@@ -22,7 +22,7 @@ const BaseComponent = mockComponent(
|
|
|
22
22
|
true, // isESModule
|
|
23
23
|
) as TModal;
|
|
24
24
|
|
|
25
|
-
// $
|
|
25
|
+
// $FlowFixMe[incompatible-use]
|
|
26
26
|
export default class Modal extends BaseComponent {
|
|
27
27
|
render(): React.Node {
|
|
28
28
|
if (this.props.visible === false) {
|
package/jest/mocks/ScrollView.js
CHANGED
|
@@ -44,7 +44,7 @@ const BaseComponent = mockComponent(
|
|
|
44
44
|
true, // isESModule
|
|
45
45
|
) as TScrollView;
|
|
46
46
|
|
|
47
|
-
// $FlowFixMe[incompatible-
|
|
47
|
+
// $FlowFixMe[incompatible-type]
|
|
48
48
|
// $FlowFixMe[invalid-exported-annotation]
|
|
49
49
|
export default class ScrollViewMock extends BaseComponent {
|
|
50
50
|
render(): React.Node {
|
|
@@ -15,7 +15,7 @@ import {createElement} from 'react';
|
|
|
15
15
|
|
|
16
16
|
export default class View extends React.Component<ViewProps> {
|
|
17
17
|
render(): React.Node {
|
|
18
|
-
// $
|
|
18
|
+
// $FlowFixMe[not-a-function]
|
|
19
19
|
return createElement('View', this.props, this.props.children);
|
|
20
20
|
}
|
|
21
21
|
}
|
package/jest/setup.js
CHANGED
|
@@ -17,7 +17,7 @@ import '@react-native/js-polyfills/error-guard';
|
|
|
17
17
|
|
|
18
18
|
import mock from './mock';
|
|
19
19
|
|
|
20
|
-
// $
|
|
20
|
+
// $FlowFixMe[cannot-write]
|
|
21
21
|
Object.defineProperties(global, {
|
|
22
22
|
__DEV__: {
|
|
23
23
|
configurable: true,
|
|
@@ -43,7 +43,7 @@ Object.defineProperties(global, {
|
|
|
43
43
|
configurable: true,
|
|
44
44
|
enumerable: true,
|
|
45
45
|
value: {
|
|
46
|
-
// $
|
|
46
|
+
// $FlowFixMe[method-unbinding]
|
|
47
47
|
now: jest.fn(Date.now),
|
|
48
48
|
},
|
|
49
49
|
writable: true,
|
|
@@ -70,7 +70,18 @@ Object.defineProperties(global, {
|
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Prettier v3 uses import (cjs/mjs) file formats that jest-runtime does not
|
|
75
|
+
* support. To work around this we need to bypass the jest module system by
|
|
76
|
+
* using the orginal node `require` function.
|
|
77
|
+
*/
|
|
78
|
+
jest.mock('prettier', () => {
|
|
79
|
+
// $FlowExpectedError[underconstrained-implicit-instantiation]
|
|
80
|
+
const module = jest.requireActual('module');
|
|
81
|
+
return module.prototype.require(require.resolve('prettier'));
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// $FlowFixMe[incompatible-type] - `./mocks/AppState` is incomplete.
|
|
74
85
|
mock('m#../Libraries/AppState/AppState', 'm#./mocks/AppState');
|
|
75
86
|
mock('m#../Libraries/BatchedBridge/NativeModules', 'm#./mocks/NativeModules');
|
|
76
87
|
mock(
|
|
@@ -84,41 +95,41 @@ mock(
|
|
|
84
95
|
mock('m#../Libraries/Components/Clipboard/Clipboard', 'm#./mocks/Clipboard');
|
|
85
96
|
mock(
|
|
86
97
|
'm#../Libraries/Components/RefreshControl/RefreshControl',
|
|
87
|
-
// $FlowFixMe[incompatible-
|
|
98
|
+
// $FlowFixMe[incompatible-type] - `../Libraries/Components/RefreshControl/RefreshControl` should export a component type.
|
|
88
99
|
'm#./mocks/RefreshControl',
|
|
89
100
|
);
|
|
90
101
|
// $FlowFixMe[incompatible-exact] - `../Libraries/Components/ScrollView/ScrollView` is... I don't even.
|
|
91
|
-
// $FlowFixMe[
|
|
102
|
+
// $FlowFixMe[incompatible-type]
|
|
92
103
|
mock('m#../Libraries/Components/ScrollView/ScrollView', 'm#./mocks/ScrollView');
|
|
93
104
|
mock('m#../Libraries/Components/TextInput/TextInput', 'm#./mocks/TextInput');
|
|
94
105
|
mock('m#../Libraries/Components/View/View', 'm#./mocks/View');
|
|
95
106
|
mock(
|
|
96
107
|
'm#../Libraries/Components/View/ViewNativeComponent',
|
|
97
|
-
// $FlowFixMe[incompatible-
|
|
108
|
+
// $FlowFixMe[incompatible-type] - `./mocks/ViewNativeComponent` is incomplete.
|
|
98
109
|
// $FlowFixMe[prop-missing]
|
|
99
110
|
'm#./mocks/ViewNativeComponent',
|
|
100
111
|
);
|
|
101
112
|
mock('m#../Libraries/Core/InitializeCore', 'm#./mocks/InitializeCore');
|
|
102
113
|
mock('m#../Libraries/Core/NativeExceptionsManager');
|
|
103
114
|
mock('m#../Libraries/Image/Image', 'm#./mocks/Image');
|
|
104
|
-
// $FlowFixMe[incompatible-
|
|
115
|
+
// $FlowFixMe[incompatible-type] - `./mocks/Linking` is incomplete.
|
|
105
116
|
mock('m#../Libraries/Linking/Linking', 'm#./mocks/Linking');
|
|
106
|
-
// $FlowFixMe[incompatible-
|
|
117
|
+
// $FlowFixMe[incompatible-type] - `../Libraries/Modal/Modal` should export a component type.
|
|
107
118
|
mock('m#../Libraries/Modal/Modal', 'm#./mocks/Modal');
|
|
108
119
|
mock(
|
|
109
120
|
'm#../Libraries/NativeComponent/NativeComponentRegistry',
|
|
110
|
-
// $FlowFixMe[
|
|
121
|
+
// $FlowFixMe[incompatible-type] - `./mocks/NativeComponentRegistry` should export named functions.
|
|
111
122
|
'm#./mocks/NativeComponentRegistry',
|
|
112
123
|
);
|
|
113
|
-
// $FlowFixMe[
|
|
124
|
+
// $FlowFixMe[incompatible-type] - `./mocks/RendererProxy` is incomplete.
|
|
114
125
|
mock('m#../Libraries/ReactNative/RendererProxy', 'm#./mocks/RendererProxy');
|
|
115
126
|
mock(
|
|
116
127
|
'm#../Libraries/ReactNative/requireNativeComponent',
|
|
117
128
|
'm#./mocks/requireNativeComponent',
|
|
118
129
|
);
|
|
119
|
-
// $FlowFixMe[
|
|
130
|
+
// $FlowFixMe[incompatible-type] - `./mocks/UIManager` is incomplete.
|
|
120
131
|
mock('m#../Libraries/ReactNative/UIManager', 'm#./mocks/UIManager');
|
|
121
132
|
mock('m#../Libraries/Text/Text', 'm#./mocks/Text');
|
|
122
133
|
mock('m#../Libraries/Utilities/useColorScheme', 'm#./mocks/useColorScheme');
|
|
123
|
-
// $FlowFixMe[incompatible-
|
|
134
|
+
// $FlowFixMe[incompatible-type]
|
|
124
135
|
mock('m#../Libraries/Vibration/Vibration', 'm#./mocks/Vibration');
|