@office-iss/react-native-win32 0.0.0-canary.302 → 0.0.0-canary.303
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 +2 -2
- package/CHANGELOG.json +28 -1
- package/CHANGELOG.md +15 -5
- package/IntegrationTests/IntegrationTestsApp.js +1 -1
- package/IntegrationTests/LayoutEventsTest.js +3 -3
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +3 -3
- package/Libraries/Alert/RCTAlertManager.android.js +2 -2
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +2 -2
- package/Libraries/Animated/AnimatedMock.js +1 -1
- package/Libraries/Animated/NativeAnimatedAllowlist.js +1 -0
- package/Libraries/Animated/animations/Animation.js +5 -6
- package/Libraries/Animated/components/AnimatedScrollView.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +9 -9
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -4
- package/Libraries/Animated/nodes/AnimatedProps.js +2 -2
- package/Libraries/Animated/nodes/AnimatedStyle.js +6 -4
- package/Libraries/Animated/nodes/AnimatedTransform.js +1 -1
- package/Libraries/AppState/AppState.js +5 -1
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/BlobManager.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.win32.js +1 -1
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +3 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.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 +9 -4
- package/Libraries/Components/TextInput/TextInput.win32.js +9 -6
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +2 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -1
- 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 +2 -2
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +1 -1
- package/Libraries/Core/Timers/immediateShim.js +1 -1
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +5 -3
- package/Libraries/Image/Image.android.js +318 -111
- package/Libraries/Image/ImageSourceUtils.js +8 -2
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/Lists/FlatList.js +5 -6
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +1 -1
- package/Libraries/Modal/Modal.js +2 -2
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/NativeComponent/ViewConfig.js +1 -1
- 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/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/PushNotificationIOS/PushNotificationIOS.js +2 -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/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/Renderer/shims/ReactFabric.js +1 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +1 -3
- package/Libraries/Renderer/shims/ReactNative.js +1 -3
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +1 -3
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +1 -3
- 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/flattenStyle.js +2 -2
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -2
- package/Libraries/Text/Text.js +509 -235
- package/Libraries/Text/Text.win32.js +622 -275
- package/Libraries/Text/TextNativeComponent.js +2 -2
- package/Libraries/Text/TextNativeComponent.win32.js +2 -2
- package/Libraries/Utilities/HMRClient.js +0 -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/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +1 -1
- package/index.js +3 -0
- package/index.win32.js +4 -0
- package/jest/local-setup.js +2 -2
- package/jest/mock.js +1 -1
- package/jest/mockComponent.js +8 -8
- 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 +12 -12
- package/overrides.json +16 -16
- package/package.json +12 -12
- package/src/private/animated/NativeAnimatedHelper.js +3 -3
- package/src/private/animated/NativeAnimatedHelper.win32.js +3 -3
- package/src/private/animated/createAnimatedPropsHook.js +9 -11
- package/src/private/animated/createAnimatedPropsMemoHook.js +6 -6
- package/src/private/components/virtualview/VirtualView.js +7 -4
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +6 -0
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +9 -8
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
- package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
- 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 +14 -11
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +13 -10
- package/src/private/webapis/geometry/DOMRectList.js +1 -1
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +1 -1
- package/src/private/webapis/performance/EventTiming.js +1 -1
- package/src/private/webapis/performance/Performance.js +12 -30
- package/src/private/webapis/performance/specs/NativePerformance.js +4 -4
- package/src/private/webapis/structuredClone/structuredClone.js +9 -9
|
@@ -23,7 +23,7 @@ const RCTNetworking = {
|
|
|
23
23
|
listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
|
|
24
24
|
context?: mixed,
|
|
25
25
|
): EventSubscription {
|
|
26
|
-
// $FlowFixMe[incompatible-
|
|
26
|
+
// $FlowFixMe[incompatible-type]
|
|
27
27
|
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
28
28
|
},
|
|
29
29
|
|
|
@@ -23,7 +23,7 @@ const RCTNetworking = {
|
|
|
23
23
|
listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
|
|
24
24
|
context?: mixed,
|
|
25
25
|
): EventSubscription {
|
|
26
|
-
// $FlowFixMe[incompatible-
|
|
26
|
+
// $FlowFixMe[incompatible-type]
|
|
27
27
|
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
28
28
|
},
|
|
29
29
|
|
|
@@ -36,7 +36,7 @@ function convertRequestBody(body: RequestBody): Object {
|
|
|
36
36
|
return {formData: body.getParts()};
|
|
37
37
|
}
|
|
38
38
|
if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) {
|
|
39
|
-
/* $FlowFixMe[incompatible-
|
|
39
|
+
/* $FlowFixMe[incompatible-type] : no way to assert that 'body' is indeed
|
|
40
40
|
* an ArrayBufferView */
|
|
41
41
|
return {base64: binaryToBase64(body)};
|
|
42
42
|
}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {DialogOptions} from '../../src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid';
|
|
12
|
+
|
|
11
13
|
import NativeDialogManagerAndroid from '../NativeModules/specs/NativeDialogManagerAndroid';
|
|
12
14
|
import NativePermissionsAndroid from './NativePermissionsAndroid';
|
|
13
15
|
import invariant from 'invariant';
|
|
@@ -249,24 +251,24 @@ class PermissionsAndroidImpl {
|
|
|
249
251
|
|
|
250
252
|
if (shouldShowRationale && !!NativeDialogManagerAndroid) {
|
|
251
253
|
return new Promise((resolve, reject) => {
|
|
252
|
-
|
|
254
|
+
/* $FlowFixMe[incompatible-exact] (>=0.111.0 site=react_native_fb)
|
|
255
|
+
* This comment suppresses an error found when Flow v0.111 was
|
|
256
|
+
* deployed. To see the error, delete this comment and run Flow.
|
|
257
|
+
*/
|
|
258
|
+
const options: DialogOptions = {
|
|
253
259
|
...rationale,
|
|
254
260
|
};
|
|
255
261
|
NativeDialogManagerAndroid.showAlert(
|
|
256
|
-
/* $FlowFixMe[incompatible-exact] (>=0.111.0 site=react_native_fb)
|
|
257
|
-
* This comment suppresses an error found when Flow v0.111 was
|
|
258
|
-
* deployed. To see the error, delete this comment and run Flow.
|
|
259
|
-
*/
|
|
260
262
|
options,
|
|
261
263
|
() => reject(new Error('Error showing rationale')),
|
|
262
264
|
() =>
|
|
263
|
-
// $FlowFixMe[incompatible-
|
|
265
|
+
// $FlowFixMe[incompatible-type]
|
|
264
266
|
resolve(NativePermissionsAndroid.requestPermission(permission)),
|
|
265
267
|
);
|
|
266
268
|
});
|
|
267
269
|
}
|
|
268
270
|
}
|
|
269
|
-
// $FlowFixMe[incompatible-
|
|
271
|
+
// $FlowFixMe[incompatible-type]
|
|
270
272
|
return NativePermissionsAndroid.requestPermission(permission);
|
|
271
273
|
}
|
|
272
274
|
|
|
@@ -291,8 +293,7 @@ class PermissionsAndroidImpl {
|
|
|
291
293
|
NativePermissionsAndroid,
|
|
292
294
|
'PermissionsAndroid is not installed correctly.',
|
|
293
295
|
);
|
|
294
|
-
// $FlowFixMe[incompatible-
|
|
295
|
-
// $FlowFixMe[incompatible-call]
|
|
296
|
+
// $FlowFixMe[incompatible-type]
|
|
296
297
|
return NativePermissionsAndroid.requestMultiplePermissions(permissions);
|
|
297
298
|
}
|
|
298
299
|
}
|
|
@@ -14,6 +14,8 @@ let isEnabled = false;
|
|
|
14
14
|
|
|
15
15
|
/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
|
|
16
16
|
* Platform.flow.js */
|
|
17
|
+
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition roll
|
|
18
|
+
* out. See https://fburl.com/workplace/4oq3zi07. */
|
|
17
19
|
if (Platform.OS === 'web') {
|
|
18
20
|
const canUseDOM = Boolean(
|
|
19
21
|
typeof window !== 'undefined' &&
|
|
@@ -14,6 +14,8 @@ let isEnabled = false;
|
|
|
14
14
|
|
|
15
15
|
/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
|
|
16
16
|
* Platform.flow.js */
|
|
17
|
+
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition roll
|
|
18
|
+
* out. See https://fburl.com/workplace/4oq3zi07. */
|
|
17
19
|
if (Platform.OS === 'web') {
|
|
18
20
|
const canUseDOM = Boolean(
|
|
19
21
|
typeof window !== 'undefined' &&
|
|
@@ -210,7 +210,7 @@ class PushNotificationIOS {
|
|
|
210
210
|
NativePushNotificationManagerIOS,
|
|
211
211
|
'PushNotificationManager is not available.',
|
|
212
212
|
);
|
|
213
|
-
// $FlowFixMe[
|
|
213
|
+
// $FlowFixMe[incompatible-type]
|
|
214
214
|
NativePushNotificationManagerIOS.presentLocalNotification(details);
|
|
215
215
|
}
|
|
216
216
|
|
|
@@ -235,7 +235,7 @@ class PushNotificationIOS {
|
|
|
235
235
|
NativePushNotificationManagerIOS,
|
|
236
236
|
'PushNotificationManager is not available.',
|
|
237
237
|
);
|
|
238
|
-
// $FlowFixMe[
|
|
238
|
+
// $FlowFixMe[incompatible-type]
|
|
239
239
|
NativePushNotificationManagerIOS.scheduleLocalNotification(details);
|
|
240
240
|
}
|
|
241
241
|
|
|
@@ -58,10 +58,12 @@ export default class ReactFabricHostComponent implements NativeMethods {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
blur() {
|
|
61
|
+
// $FlowFixMe - Error supressed during the migration of HostInstance to ReactNativeElement
|
|
61
62
|
TextInputState.blurTextInput(this);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
focus() {
|
|
66
|
+
// $FlowFixMe - Error supressed during the migration of HostInstance to ReactNativeElement
|
|
65
67
|
TextInputState.focusTextInput(this);
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -132,7 +132,7 @@ export function getNodeFromPublicInstance(
|
|
|
132
132
|
RendererProxy = require('../../ReactNative/RendererProxy');
|
|
133
133
|
}
|
|
134
134
|
return RendererProxy.getNodeFromInternalInstanceHandle(
|
|
135
|
-
// $FlowExpectedError[incompatible-
|
|
135
|
+
// $FlowExpectedError[incompatible-type] __internalInstanceHandle is always an InternalInstanceHandle from React when we get here.
|
|
136
136
|
publicInstance.__internalInstanceHandle,
|
|
137
137
|
);
|
|
138
138
|
}
|
|
@@ -143,10 +143,10 @@ export function getInternalInstanceHandleFromPublicInstance(
|
|
|
143
143
|
// TODO(T174762768): Remove this once OSS versions of renderers will be synced.
|
|
144
144
|
// $FlowExpectedError[prop-missing] Keeping this for backwards-compatibility with the renderers versions in open source.
|
|
145
145
|
if (publicInstance._internalInstanceHandle != null) {
|
|
146
|
-
// $FlowExpectedError[incompatible-
|
|
146
|
+
// $FlowExpectedError[incompatible-type] Keeping this for backwards-compatibility with the renderers versions in open source.
|
|
147
147
|
return publicInstance._internalInstanceHandle;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
// $FlowExpectedError[incompatible-
|
|
150
|
+
// $FlowExpectedError[incompatible-type] __internalInstanceHandle is always an InternalInstanceHandle from React when we get here.
|
|
151
151
|
return publicInstance.__internalInstanceHandle;
|
|
152
152
|
}
|
|
@@ -9,19 +9,71 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {HostInstance} from '../../src/private/types/HostInstance';
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '../Renderer/shims/ReactNativeTypes';
|
|
12
|
+
import typeof ReactFabricType from '../Renderer/shims/ReactFabric';
|
|
13
|
+
import typeof ReactNativeType from '../Renderer/shims/ReactNative';
|
|
14
|
+
import type {RootTag} from './RootTag';
|
|
16
15
|
|
|
17
16
|
import {
|
|
18
17
|
onCaughtError,
|
|
19
18
|
onRecoverableError,
|
|
20
19
|
onUncaughtError,
|
|
21
20
|
} from '../../src/private/renderer/errorhandling/ErrorHandlers';
|
|
22
|
-
import {type RootTag} from './RootTag';
|
|
23
21
|
import * as React from 'react';
|
|
24
22
|
|
|
23
|
+
let cachedFabricRenderer;
|
|
24
|
+
let cachedPaperRenderer;
|
|
25
|
+
|
|
26
|
+
function getFabricRenderer(): ReactFabricType {
|
|
27
|
+
if (cachedFabricRenderer == null) {
|
|
28
|
+
cachedFabricRenderer = require('../Renderer/shims/ReactFabric').default;
|
|
29
|
+
}
|
|
30
|
+
return cachedFabricRenderer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getPaperRenderer(): ReactNativeType {
|
|
34
|
+
if (cachedPaperRenderer == null) {
|
|
35
|
+
cachedPaperRenderer = require('../Renderer/shims/ReactNative').default;
|
|
36
|
+
}
|
|
37
|
+
return cachedPaperRenderer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const getMethod: (<MethodName: $Keys<ReactFabricType>>(
|
|
41
|
+
() => ReactFabricType,
|
|
42
|
+
MethodName,
|
|
43
|
+
) => ReactFabricType[MethodName]) &
|
|
44
|
+
(<MethodName: $Keys<ReactNativeType>>(
|
|
45
|
+
() => ReactNativeType,
|
|
46
|
+
MethodName,
|
|
47
|
+
) => ReactNativeType[MethodName]) = (getRenderer, methodName) => {
|
|
48
|
+
let cachedImpl;
|
|
49
|
+
|
|
50
|
+
// $FlowExpectedError
|
|
51
|
+
return function (arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
52
|
+
if (cachedImpl == null) {
|
|
53
|
+
// $FlowExpectedError
|
|
54
|
+
cachedImpl = getRenderer()[methodName];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// $FlowExpectedError
|
|
58
|
+
return cachedImpl(arg1, arg2, arg3, arg4, arg5);
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
function getFabricMethod<MethodName: $Keys<ReactFabricType>>(
|
|
63
|
+
methodName: MethodName,
|
|
64
|
+
): ReactFabricType[MethodName] {
|
|
65
|
+
return getMethod(getFabricRenderer, methodName);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getPaperMethod<MethodName: $Keys<ReactNativeType>>(
|
|
69
|
+
methodName: MethodName,
|
|
70
|
+
): ReactNativeType[MethodName] {
|
|
71
|
+
return getMethod(getPaperRenderer, methodName);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let cachedFabricRender;
|
|
75
|
+
let cachedPaperRender;
|
|
76
|
+
|
|
25
77
|
export function renderElement({
|
|
26
78
|
element,
|
|
27
79
|
rootTag,
|
|
@@ -34,50 +86,30 @@ export function renderElement({
|
|
|
34
86
|
useConcurrentRoot: boolean,
|
|
35
87
|
}): void {
|
|
36
88
|
if (useFabric) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
);
|
|
89
|
+
if (cachedFabricRender == null) {
|
|
90
|
+
cachedFabricRender = getFabricRenderer().render;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
cachedFabricRender(element, rootTag, null, useConcurrentRoot, {
|
|
94
|
+
onCaughtError,
|
|
95
|
+
onUncaughtError,
|
|
96
|
+
onRecoverableError,
|
|
97
|
+
});
|
|
48
98
|
} else {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
undefined,
|
|
53
|
-
{
|
|
54
|
-
onCaughtError,
|
|
55
|
-
onUncaughtError,
|
|
56
|
-
onRecoverableError,
|
|
57
|
-
},
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
99
|
+
if (cachedPaperRender == null) {
|
|
100
|
+
cachedPaperRender = getPaperRenderer().render;
|
|
101
|
+
}
|
|
61
102
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
componentOrHandle,
|
|
69
|
-
);
|
|
103
|
+
cachedPaperRender(element, rootTag, undefined, {
|
|
104
|
+
onCaughtError,
|
|
105
|
+
onUncaughtError,
|
|
106
|
+
onRecoverableError,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
70
109
|
}
|
|
71
110
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
75
|
-
): ?number {
|
|
76
|
-
return require('../Renderer/shims/ReactNative').default.findNodeHandle(
|
|
77
|
-
// $FlowFixMe[incompatible-call]
|
|
78
|
-
componentOrHandle,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
111
|
+
let cachedFabricDispatchCommand;
|
|
112
|
+
let cachedPaperDispatchCommand;
|
|
81
113
|
|
|
82
114
|
export function dispatchCommand(
|
|
83
115
|
handle: HostInstance,
|
|
@@ -87,90 +119,58 @@ export function dispatchCommand(
|
|
|
87
119
|
if (global.RN$Bridgeless === true) {
|
|
88
120
|
// Note: this function has the same implementation in the legacy and new renderer.
|
|
89
121
|
// However, evaluating the old renderer comes with some side effects.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
122
|
+
if (cachedFabricDispatchCommand == null) {
|
|
123
|
+
cachedFabricDispatchCommand = getFabricRenderer().dispatchCommand;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return cachedFabricDispatchCommand(handle, command, args);
|
|
95
127
|
} else {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
);
|
|
128
|
+
if (cachedPaperDispatchCommand == null) {
|
|
129
|
+
cachedPaperDispatchCommand = getPaperRenderer().dispatchCommand;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return cachedPaperDispatchCommand(handle, command, args);
|
|
101
133
|
}
|
|
102
134
|
}
|
|
103
135
|
|
|
104
|
-
export
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
)
|
|
112
|
-
|
|
136
|
+
export const findHostInstance_DEPRECATED: <TElementType: React.ElementType>(
|
|
137
|
+
// $FlowExpectedError[incompatible-type]
|
|
138
|
+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
139
|
+
) => ?HostInstance = getPaperMethod('findHostInstance_DEPRECATED');
|
|
140
|
+
|
|
141
|
+
export const findNodeHandle: <TElementType: React.ElementType>(
|
|
142
|
+
// $FlowExpectedError[incompatible-type]
|
|
143
|
+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
144
|
+
) => ?number = getPaperMethod('findNodeHandle');
|
|
145
|
+
|
|
146
|
+
export const sendAccessibilityEvent: ReactNativeType['sendAccessibilityEvent'] =
|
|
147
|
+
getPaperMethod('sendAccessibilityEvent');
|
|
113
148
|
|
|
114
149
|
/**
|
|
115
150
|
* This method is used by AppRegistry to unmount a root when using the old
|
|
116
151
|
* React Native renderer (Paper).
|
|
117
152
|
*/
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
);
|
|
124
|
-
}
|
|
153
|
+
export const unmountComponentAtNodeAndRemoveContainer: (
|
|
154
|
+
rootTag: RootTag,
|
|
155
|
+
) => void =
|
|
156
|
+
// $FlowExpectedError[incompatible-type]
|
|
157
|
+
getPaperMethod('unmountComponentAtNodeAndRemoveContainer');
|
|
125
158
|
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
bookkeeping: T,
|
|
129
|
-
): void {
|
|
130
|
-
// This doesn't actually do anything when batching updates for a Fabric root.
|
|
131
|
-
return require('../Renderer/shims/ReactNative').default.unstable_batchedUpdates(
|
|
132
|
-
fn,
|
|
133
|
-
bookkeeping,
|
|
134
|
-
);
|
|
135
|
-
}
|
|
159
|
+
export const unstable_batchedUpdates: ReactNativeType['unstable_batchedUpdates'] =
|
|
160
|
+
getPaperMethod('unstable_batchedUpdates');
|
|
136
161
|
|
|
137
|
-
export
|
|
138
|
-
|
|
139
|
-
}
|
|
162
|
+
export const isChildPublicInstance: ReactNativeType['isChildPublicInstance'] =
|
|
163
|
+
getPaperMethod('isChildPublicInstance');
|
|
140
164
|
|
|
141
|
-
export
|
|
142
|
-
|
|
143
|
-
childInstance: HostInstance,
|
|
144
|
-
): boolean {
|
|
145
|
-
return require('../Renderer/shims/ReactNative').default.isChildPublicInstance(
|
|
146
|
-
parentInstance,
|
|
147
|
-
childInstance,
|
|
148
|
-
);
|
|
149
|
-
}
|
|
165
|
+
export const getNodeFromInternalInstanceHandle: ReactFabricType['getNodeFromInternalInstanceHandle'] =
|
|
166
|
+
getFabricMethod('getNodeFromInternalInstanceHandle');
|
|
150
167
|
|
|
151
|
-
export
|
|
152
|
-
|
|
153
|
-
): ?Node {
|
|
154
|
-
// This is only available in Fabric
|
|
155
|
-
return require('../Renderer/shims/ReactFabric').default.getNodeFromInternalInstanceHandle(
|
|
156
|
-
internalInstanceHandle,
|
|
157
|
-
);
|
|
158
|
-
}
|
|
168
|
+
export const getPublicInstanceFromInternalInstanceHandle: ReactFabricType['getPublicInstanceFromInternalInstanceHandle'] =
|
|
169
|
+
getFabricMethod('getPublicInstanceFromInternalInstanceHandle');
|
|
159
170
|
|
|
160
|
-
export
|
|
161
|
-
|
|
162
|
-
): mixed /*PublicInstance | PublicTextInstance | null*/ {
|
|
163
|
-
// This is only available in Fabric
|
|
164
|
-
return require('../Renderer/shims/ReactFabric').default.getPublicInstanceFromInternalInstanceHandle(
|
|
165
|
-
internalInstanceHandle,
|
|
166
|
-
);
|
|
167
|
-
}
|
|
171
|
+
export const getPublicInstanceFromRootTag: ReactFabricType['getPublicInstanceFromRootTag'] =
|
|
172
|
+
getFabricMethod('getPublicInstanceFromRootTag');
|
|
168
173
|
|
|
169
|
-
export function
|
|
170
|
-
|
|
171
|
-
): mixed /*PublicRootInstance | null*/ {
|
|
172
|
-
// This is only available in Fabric
|
|
173
|
-
return require('../Renderer/shims/ReactFabric').default.getPublicInstanceFromRootTag(
|
|
174
|
-
rootTag,
|
|
175
|
-
);
|
|
174
|
+
export function isProfilingRenderer(): boolean {
|
|
175
|
+
return Boolean(__DEV__);
|
|
176
176
|
}
|
|
@@ -45,7 +45,7 @@ const UIManager: UIManagerJSInterface = {
|
|
|
45
45
|
FabricUIManager.measure(shadowNode, callback);
|
|
46
46
|
} else {
|
|
47
47
|
console.warn(`measure cannot find view with tag #${reactTag}`);
|
|
48
|
-
// $FlowFixMe[incompatible-
|
|
48
|
+
// $FlowFixMe[incompatible-type]
|
|
49
49
|
callback();
|
|
50
50
|
}
|
|
51
51
|
} else {
|
|
@@ -71,7 +71,7 @@ const UIManager: UIManagerJSInterface = {
|
|
|
71
71
|
FabricUIManager.measureInWindow(shadowNode, callback);
|
|
72
72
|
} else {
|
|
73
73
|
console.warn(`measure cannot find view with tag #${reactTag}`);
|
|
74
|
-
// $FlowFixMe[incompatible-
|
|
74
|
+
// $FlowFixMe[incompatible-type]
|
|
75
75
|
callback();
|
|
76
76
|
}
|
|
77
77
|
} else {
|
|
@@ -182,7 +182,7 @@ const UIManager: UIManagerJSInterface = {
|
|
|
182
182
|
UIManagerImpl.dispatchViewManagerCommand(
|
|
183
183
|
reactTag,
|
|
184
184
|
// We have some legacy components that are actually already using strings. ¯\_(ツ)_/¯
|
|
185
|
-
// $FlowFixMe[incompatible-
|
|
185
|
+
// $FlowFixMe[incompatible-type]
|
|
186
186
|
commandName,
|
|
187
187
|
commandArgs,
|
|
188
188
|
);
|
|
@@ -86,7 +86,7 @@ module.exports = {
|
|
|
86
86
|
// TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads`
|
|
87
87
|
get flattenStyle(): flattenStyle<DangerouslyImpreciseStyleProp> {
|
|
88
88
|
// $FlowFixMe[underconstrained-implicit-instantiation]
|
|
89
|
-
// $FlowFixMe[incompatible-
|
|
89
|
+
// $FlowFixMe[incompatible-type]
|
|
90
90
|
return require('../StyleSheet/flattenStyle').default;
|
|
91
91
|
},
|
|
92
92
|
get ReactFiberErrorDialog(): ReactFiberErrorDialog {
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict-local
|
|
10
|
-
* @generated SignedSource<<
|
|
11
|
-
*
|
|
12
|
-
* This file was sync'd from the facebook/react repository.
|
|
10
|
+
* @generated SignedSource<<908f5fb85384725318e261f40e49d9a6>>
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
13
|
'use strict';
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict-local
|
|
10
|
-
* @generated SignedSource<<
|
|
11
|
-
*
|
|
12
|
-
* This file was sync'd from the facebook/react repository.
|
|
10
|
+
* @generated SignedSource<<83073425aa3f71ced2c8c51f25a25938>>
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
13
|
'use strict';
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict-local
|
|
10
|
-
* @generated SignedSource<<
|
|
11
|
-
*
|
|
12
|
-
* This file was sync'd from the facebook/react repository.
|
|
10
|
+
* @generated SignedSource<<52163887de05f1cff05388145cf85b3b>>
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
13
|
'use strict';
|
|
@@ -17,7 +17,7 @@ type LocalNativeColorValue = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
20
|
-
/* $FlowExpectedError[incompatible-
|
|
20
|
+
/* $FlowExpectedError[incompatible-type]
|
|
21
21
|
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */
|
|
22
22
|
return ({resource_paths: names}: LocalNativeColorValue);
|
|
23
23
|
};
|
|
@@ -25,7 +25,7 @@ export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
|
25
25
|
export const normalizeColorObject = (
|
|
26
26
|
color: NativeColorValue,
|
|
27
27
|
): ?ProcessedColorValue => {
|
|
28
|
-
/* $FlowExpectedError[incompatible-
|
|
28
|
+
/* $FlowExpectedError[incompatible-type]
|
|
29
29
|
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */
|
|
30
30
|
if ('resource_paths' in (color: LocalNativeColorValue)) {
|
|
31
31
|
return color;
|
|
@@ -23,7 +23,7 @@ type LocalNativeColorValue = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
26
|
-
// $FlowExpectedError[incompatible-
|
|
26
|
+
// $FlowExpectedError[incompatible-type] LocalNativeColorValue is the iOS LocalNativeColorValue type
|
|
27
27
|
return ({semantic: names}: LocalNativeColorValue);
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -44,7 +44,7 @@ export const DynamicColorIOSPrivate = (
|
|
|
44
44
|
highContrastLight: tuple.highContrastLight,
|
|
45
45
|
highContrastDark: tuple.highContrastDark,
|
|
46
46
|
},
|
|
47
|
-
/* $FlowExpectedError[incompatible-
|
|
47
|
+
/* $FlowExpectedError[incompatible-type]
|
|
48
48
|
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on iOS platform */
|
|
49
49
|
}: LocalNativeColorValue);
|
|
50
50
|
};
|
|
@@ -32,6 +32,7 @@ type LocalNativeColorValue =
|
|
|
32
32
|
|
|
33
33
|
export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
34
34
|
// $FlowExpectedError[incompatible-return] LocalNativeColorValue is the Windows LocalNativeColorValue type
|
|
35
|
+
// $FlowExpectedError[incompatible-type]
|
|
35
36
|
return ({resource_paths: names}: LocalNativeColorValue);
|
|
36
37
|
};
|
|
37
38
|
|
|
@@ -39,6 +40,7 @@ export const ColorGradientWin32Private = (
|
|
|
39
40
|
gradientColor: GradientColorValueWin32,
|
|
40
41
|
): ColorValue => {
|
|
41
42
|
// $FlowExpectedError[incompatible-return]
|
|
43
|
+
// $FlowExpectedError[incompatible-type]
|
|
42
44
|
return gradientColor;
|
|
43
45
|
};
|
|
44
46
|
|
|
@@ -49,8 +51,10 @@ export const normalizeColorObject = (
|
|
|
49
51
|
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Windows platform */
|
|
50
52
|
if (
|
|
51
53
|
// $FlowExpectedError[incompatible-cast]
|
|
54
|
+
// $FlowExpectedError[incompatible-type]
|
|
52
55
|
'resource_paths' in (color: LocalNativeColorValue) ||
|
|
53
56
|
// $FlowExpectedError[incompatible-cast]
|
|
57
|
+
// $FlowExpectedError[incompatible-type]
|
|
54
58
|
'gradientDirection' in (color: LocalNativeColorValue)
|
|
55
59
|
) {
|
|
56
60
|
return color;
|
|
@@ -31,7 +31,7 @@ function flattenStyle<
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
if (!Array.isArray(style)) {
|
|
34
|
-
// $FlowFixMe[incompatible-
|
|
34
|
+
// $FlowFixMe[incompatible-type]
|
|
35
35
|
return style;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -49,7 +49,7 @@ function flattenStyle<
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
// $FlowFixMe[incompatible-
|
|
52
|
+
// $FlowFixMe[incompatible-type]
|
|
53
53
|
return result;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -18,9 +18,9 @@ export default function splitLayoutProps(props: ?____ViewStyle_Internal): {
|
|
|
18
18
|
let inner: ?____ViewStyle_Internal = null;
|
|
19
19
|
|
|
20
20
|
if (props != null) {
|
|
21
|
-
// $
|
|
21
|
+
// $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
|
|
22
22
|
outer = {};
|
|
23
|
-
// $
|
|
23
|
+
// $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
|
|
24
24
|
inner = {};
|
|
25
25
|
|
|
26
26
|
for (const prop of Object.keys(props)) {
|