@office-iss/react-native-win32 0.0.0-canary.298 → 0.0.0-canary.299
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 +5 -3
- package/CHANGELOG.json +28 -1
- package/CHANGELOG.md +16 -6
- package/IntegrationTests/IntegrationTestsApp.js +1 -0
- package/IntegrationTests/LoggingTestModule.js +16 -20
- package/IntegrationTests/TimersTest.js +1 -0
- package/IntegrationTests/WebSocketTest.js +1 -0
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
- package/Libraries/Alert/Alert.js +2 -2
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Alert/RCTAlertManager.android.js +19 -13
- package/Libraries/Alert/RCTAlertManager.ios.js +9 -11
- package/Libraries/Alert/RCTAlertManager.js +1 -3
- package/Libraries/Alert/RCTAlertManager.js.flow +4 -6
- package/Libraries/Animated/AnimatedEvent.js +4 -3
- package/Libraries/Animated/AnimatedExports.js.flow +5 -0
- package/Libraries/Animated/AnimatedImplementation.js +44 -44
- package/Libraries/Animated/AnimatedMock.js +2 -2
- package/Libraries/Animated/NativeAnimatedModule.js +1 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
- package/Libraries/Animated/animations/Animation.js +6 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +6 -5
- package/Libraries/Animated/components/AnimatedText.js +2 -5
- package/Libraries/Animated/components/AnimatedView.js +2 -1
- package/Libraries/Animated/createAnimatedComponent.js +2 -4
- package/Libraries/Animated/nodes/AnimatedProps.js +2 -7
- package/Libraries/AppState/NativeAppState.js +1 -0
- package/Libraries/Blob/NativeBlobModule.js +1 -0
- package/Libraries/Blob/NativeFileReaderModule.js +1 -0
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +1 -2
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfoWin32.js +1 -2
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +1 -2
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +1 -2
- package/Libraries/Components/Button.js +7 -4
- package/Libraries/Components/Button.win32.js +7 -4
- package/Libraries/Components/Clipboard/NativeClipboard.js +1 -2
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +1 -2
- package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +1 -2
- package/Libraries/Components/Pressable/Pressable.js +8 -2
- package/Libraries/Components/Pressable/Pressable.win32.js +8 -8
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +1 -2
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +1 -2
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +1 -0
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -0
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +3 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +1 -2
- package/Libraries/Components/ScrollView/ScrollView.d.ts +10 -1
- package/Libraries/Components/ScrollView/ScrollView.js +3 -1
- package/Libraries/Components/Sound/NativeSoundManager.js +1 -2
- package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +1 -2
- package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +1 -2
- package/Libraries/Components/StatusBar/StatusBar.d.ts +4 -0
- package/Libraries/Components/StatusBar/StatusBar.js +5 -0
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +1 -2
- package/Libraries/Components/Switch/Switch.js +2 -1
- package/Libraries/Components/Switch/SwitchNativeComponent.js +1 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +8 -7
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +1 -2
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -1
- package/Libraries/Components/TextInput/TextInput.js +2 -4
- package/Libraries/Components/TextInput/TextInput.win32.js +28 -3
- package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +1 -2
- package/Libraries/Components/Touchable/Touchable.js +7 -3
- package/Libraries/Components/Touchable/Touchable.win32.js +7 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +5 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +3 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +3 -2
- package/Libraries/Components/Touchable/TouchableOpacity.d.ts +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +3 -2
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +1 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -15
- package/Libraries/Components/View/View.js +17 -18
- package/Libraries/Components/View/View.win32.js +16 -2
- package/Libraries/Components/View/ViewAccessibility.js +0 -7
- package/Libraries/Components/View/ViewAccessibility.win32.js +0 -7
- package/Libraries/Components/View/ViewPropTypes.d.ts +4 -0
- package/Libraries/Components/View/ViewPropTypes.js +8 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +8 -0
- package/Libraries/Core/ExceptionsManager.js +28 -15
- package/Libraries/Core/NativeExceptionsManager.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +1 -0
- package/Libraries/Core/Timers/NativeTiming.js +1 -0
- package/Libraries/Core/checkNativeVersion.js +1 -0
- package/Libraries/Core/setUpReactDevTools.js +21 -4
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +1 -0
- package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
- package/Libraries/Image/Image.android.js +3 -3
- package/Libraries/Image/ImageSource.d.ts +5 -0
- package/Libraries/Image/ImageViewNativeComponent.js +3 -3
- package/Libraries/Image/NativeImageEditor.js +1 -0
- package/Libraries/Image/NativeImageLoaderAndroid.js +1 -0
- package/Libraries/Image/NativeImageLoaderIOS.js +1 -0
- package/Libraries/Image/NativeImageLoaderWin32.js +1 -0
- package/Libraries/Image/NativeImageStoreAndroid.js +1 -0
- package/Libraries/Image/NativeImageStoreIOS.js +1 -0
- package/Libraries/Image/RelativeImageStub.js +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +3 -3
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/NativeFrameRateLogger.js +1 -0
- package/Libraries/Interaction/TaskQueue.js +14 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +12 -8
- package/Libraries/Linking/NativeIntentAndroid.js +1 -0
- package/Libraries/Linking/NativeLinkingManager.js +1 -0
- package/Libraries/Lists/FlatList.js +5 -6
- package/Libraries/Lists/SectionList.js +4 -4
- package/Libraries/Lists/VirtualizedList.js +3 -2
- package/Libraries/LogBox/Data/LogBoxData.js +7 -4
- package/Libraries/LogBox/LogBox.js +72 -101
- package/Libraries/Modal/Modal.d.ts +8 -2
- package/Libraries/Modal/Modal.js +19 -2
- package/Libraries/Modal/NativeModalManager.js +1 -0
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +6 -15
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +6 -15
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +6 -15
- package/Libraries/NativeModules/specs/NativeDevMenu.js +1 -0
- package/Libraries/NativeModules/specs/NativeDevSettings.js +1 -0
- package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +1 -0
- package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +1 -0
- package/Libraries/NativeModules/specs/NativeLogBox.js +1 -0
- package/Libraries/NativeModules/specs/NativeRedBox.js +1 -0
- package/Libraries/NativeModules/specs/NativeSourceCode.js +1 -0
- package/Libraries/Network/NativeNetworkingAndroid.js +1 -0
- package/Libraries/Network/NativeNetworkingIOS.js +1 -0
- package/Libraries/Network/XMLHttpRequest.js +2 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -2
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
- package/Libraries/ReactNative/AppRegistry.flow.js +2 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +0 -10
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +1 -0
- package/Libraries/ReactNative/NativeI18nManager.js +1 -0
- package/Libraries/ReactNative/NativeUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +80 -61
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +2 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -1
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -1
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -12
- package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +3 -12
- package/Libraries/Settings/NativeSettingsManager.js +1 -0
- package/Libraries/Share/NativeShareModule.js +1 -0
- package/Libraries/StyleSheet/StyleSheet.js +1 -0
- package/Libraries/StyleSheet/processAspectRatio.js +2 -0
- package/Libraries/Text/Text.js +4 -6
- package/Libraries/Text/TextAncestor.js +3 -10
- package/Libraries/Text/TextAncestorContext.js +23 -0
- package/Libraries/Text/TextProps.js +2 -2
- package/Libraries/Text/TextProps.win32.js +2 -2
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +1 -0
- package/Libraries/Types/CodegenTypesNamespace.js +1 -0
- package/Libraries/Utilities/HMRClient.js +12 -2
- package/Libraries/Utilities/NativeAppearance.js +1 -0
- package/Libraries/Utilities/NativeDevLoadingView.js +1 -0
- package/Libraries/Utilities/NativeDeviceInfo.js +1 -2
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +1 -0
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +1 -0
- package/Libraries/Utilities/NativePlatformConstantsWin.js +1 -0
- package/Libraries/Utilities/Platform.android.js +1 -4
- package/Libraries/Utilities/Platform.ios.js +1 -4
- package/Libraries/Utilities/Platform.js.flow +2 -2
- package/Libraries/Utilities/Platform.win32.js +1 -4
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +4 -2
- package/Libraries/Utilities/codegenNativeComponent.js +3 -3
- package/Libraries/Utilities/createPerformanceLogger.js +32 -0
- package/Libraries/Vibration/NativeVibration.js +1 -0
- package/Libraries/WebSocket/NativeWebSocketModule.js +1 -0
- package/Libraries/vendor/emitter/EventEmitter.js +6 -6
- package/index.js +21 -0
- package/index.win32.js +12 -1
- package/jest/setup.js +1 -0
- package/overrides.json +25 -25
- package/package.json +11 -11
- package/src/private/animated/createAnimatedPropsHook.js +4 -1
- package/src/private/animated/createAnimatedPropsMemoHook.js +2 -2
- package/src/private/components/virtualview/VirtualView.js +145 -0
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +90 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +43 -23
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +9 -5
- package/src/private/setup/setUpPerformanceObserver.js +7 -0
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +7 -4
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +10 -7
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +5 -4
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +7 -4
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +9 -6
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +9 -6
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +14 -5
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +8 -5
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +5 -5
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +1 -0
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +9 -6
- package/src/private/styles/composeStyles.js +5 -12
- package/src/private/webapis/errors/DOMException.js +1 -1
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +4 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +12 -7
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +13 -0
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +2 -1
- package/src/private/webapis/performance/Performance.js +164 -61
- package/src/private/webapis/performance/PerformanceEntry.js +20 -16
- package/src/private/webapis/performance/PerformanceObserver.js +31 -27
- package/src/private/webapis/performance/ResourceTiming.js +108 -0
- package/src/private/webapis/performance/UserTiming.js +60 -8
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +47 -32
- package/src/private/webapis/performance/specs/NativePerformance.js +13 -1
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +4 -0
- package/Libraries/BugReporting/BugReporting.js +0 -140
- package/Libraries/BugReporting/NativeBugReporting.js +0 -13
- package/Libraries/BugReporting/dumpReactTree.js +0 -151
- package/Libraries/BugReporting/getReactData.js +0 -187
- package/src/private/specs_DEPRECATED/modules/NativeBugReporting.js +0 -20
|
@@ -76,9 +76,6 @@ function reportException(
|
|
|
76
76
|
message = namePrefix + message;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
message =
|
|
80
|
-
e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`;
|
|
81
|
-
|
|
82
79
|
// $FlowFixMe[unclear-type]
|
|
83
80
|
const extraData: Object = {
|
|
84
81
|
// $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow
|
|
@@ -108,15 +105,20 @@ function reportException(
|
|
|
108
105
|
// we feed back into console.error, to make sure any methods that are
|
|
109
106
|
// monkey patched on top of console.error are called when coming from
|
|
110
107
|
// handleException
|
|
111
|
-
console.error(
|
|
108
|
+
console.error(e);
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
if (__DEV__) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
// reportToConsole is only true when coming from handleException,
|
|
113
|
+
// and the error has not yet been logged. If it's false, then it was
|
|
114
|
+
// reported to LogBox in reactConsoleErrorHandler, and we don't need to.
|
|
115
|
+
if (reportToConsole) {
|
|
116
|
+
const LogBox = require('../LogBox/LogBox').default;
|
|
117
|
+
LogBox.addException({
|
|
118
|
+
...data,
|
|
119
|
+
isComponentError: !!e.isComponentError,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
120
122
|
} else if (isFatal || e.type !== 'warn') {
|
|
121
123
|
const NativeExceptionsManager =
|
|
122
124
|
require('./NativeExceptionsManager').default;
|
|
@@ -223,12 +225,6 @@ function reactConsoleErrorHandler(...args) {
|
|
|
223
225
|
error = firstArg;
|
|
224
226
|
} else {
|
|
225
227
|
const stringifySafe = require('../Utilities/stringifySafe').default;
|
|
226
|
-
if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) {
|
|
227
|
-
// React warnings use console.error so that a stack trace is shown, but
|
|
228
|
-
// we don't (currently) want these to show a redbox
|
|
229
|
-
// (Note: Logic duplicated in polyfills/console.js.)
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
228
|
const message = args
|
|
233
229
|
.map(arg => (typeof arg === 'string' ? arg : stringifySafe(arg)))
|
|
234
230
|
.join(' ');
|
|
@@ -243,6 +239,23 @@ function reactConsoleErrorHandler(...args) {
|
|
|
243
239
|
!global.RN$handleException ||
|
|
244
240
|
!global.RN$handleException(error, isFatal, reportToConsole)
|
|
245
241
|
) {
|
|
242
|
+
if (__DEV__) {
|
|
243
|
+
// If we're not reporting to the console in reportException,
|
|
244
|
+
// we need to report it as a console.error here.
|
|
245
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
246
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
247
|
+
if (!reportToConsole) {
|
|
248
|
+
require('../LogBox/LogBox').default.addConsoleLog('error', ...args);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (error.message.startsWith('Warning: ')) {
|
|
252
|
+
// React warnings use console.error so that a stack trace is shown, but
|
|
253
|
+
// we don't (currently) want these to report to native.
|
|
254
|
+
// Note: We can probably remove this, but would be a breaking change
|
|
255
|
+
// if the warning module is still used somewhere.
|
|
256
|
+
// Logic duplicated in polyfills/console.js
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
246
259
|
reportException(
|
|
247
260
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
248
261
|
* parameters */
|
|
@@ -143,10 +143,7 @@ if (__DEV__) {
|
|
|
143
143
|
// Get hostname from development server (packager)
|
|
144
144
|
const devServer = getDevServer();
|
|
145
145
|
const host = devServer.bundleLoadedFromServer
|
|
146
|
-
? devServer.url
|
|
147
|
-
.replace(/https?:\/\//, '')
|
|
148
|
-
.replace(/\/$/, '')
|
|
149
|
-
.split(':')[0]
|
|
146
|
+
? guessHostFromDevServerUrl(devServer.url)
|
|
150
147
|
: 'localhost';
|
|
151
148
|
|
|
152
149
|
// Read the optional global variable for backward compatibility.
|
|
@@ -259,3 +256,23 @@ function readReloadAndProfileConfig(
|
|
|
259
256
|
onReloadAndProfileFlagsReset,
|
|
260
257
|
};
|
|
261
258
|
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* This is a bad, no good, broken hack to get the host from a dev server URL for the purposes
|
|
262
|
+
* of connecting to the legacy React DevTools socket (for the standalone react-devtools package).
|
|
263
|
+
* It has too many bugs to list. Please don't use it in new code.
|
|
264
|
+
*
|
|
265
|
+
* The correct implementation would just be `return new URL(url).host`, but React Native does not
|
|
266
|
+
* ship with a spec-compliant `URL` class yet. Alternatively, this can be deleted when we delete
|
|
267
|
+
* `connectToWSBasedReactDevToolsFrontend`.
|
|
268
|
+
*/
|
|
269
|
+
function guessHostFromDevServerUrl(url: string): string {
|
|
270
|
+
const hopefullyHostAndPort = url
|
|
271
|
+
.replace(/https?:\/\//, '')
|
|
272
|
+
.replace(/\/$/, '');
|
|
273
|
+
// IPv6 addresses contain colons, so the split(':') below will return garbage.
|
|
274
|
+
if (hopefullyHostAndPort.includes(']')) {
|
|
275
|
+
return hopefullyHostAndPort.split(']')[0] + ']';
|
|
276
|
+
}
|
|
277
|
+
return hopefullyHostAndPort.split(':')[0];
|
|
278
|
+
}
|
|
@@ -10,4 +10,5 @@
|
|
|
10
10
|
|
|
11
11
|
export * from '../../src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent';
|
|
12
12
|
import DebuggingOverlayNativeComponent from '../../src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent';
|
|
13
|
+
|
|
13
14
|
export default DebuggingOverlayNativeComponent;
|
|
@@ -32,7 +32,7 @@ export type {EventSubscription, EmitterSubscription};
|
|
|
32
32
|
export type NativeEventSubscription = EventSubscription;
|
|
33
33
|
|
|
34
34
|
// $FlowFixMe[unclear-type] unclear type of events
|
|
35
|
-
type
|
|
35
|
+
type UnsafeNativeEventObject = Object;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* `NativeEventEmitter` is intended for use by Native Modules to emit events to
|
|
@@ -46,8 +46,8 @@ type UnsafeObject = Object;
|
|
|
46
46
|
*/
|
|
47
47
|
export default class NativeEventEmitter<
|
|
48
48
|
TEventToArgsMap: $ReadOnly<
|
|
49
|
-
Record<string, $ReadOnlyArray<
|
|
50
|
-
> = $ReadOnly<Record<string, $ReadOnlyArray<
|
|
49
|
+
Record<string, $ReadOnlyArray<UnsafeNativeEventObject>>,
|
|
50
|
+
> = $ReadOnly<Record<string, $ReadOnlyArray<UnsafeNativeEventObject>>>,
|
|
51
51
|
> implements IEventEmitter<TEventToArgsMap>
|
|
52
52
|
{
|
|
53
53
|
_nativeModule: ?NativeModule;
|
|
@@ -16,7 +16,7 @@ import type {AbstractImageAndroid, ImageAndroid} from './ImageTypes.flow';
|
|
|
16
16
|
|
|
17
17
|
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
18
18
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
19
|
-
import
|
|
19
|
+
import TextAncestorContext from '../Text/TextAncestorContext';
|
|
20
20
|
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
|
|
21
21
|
import {
|
|
22
22
|
unstable_getImageComponentDecorator,
|
|
@@ -222,7 +222,7 @@ let BaseImage: AbstractImageAndroid = ({
|
|
|
222
222
|
}
|
|
223
223
|
: nativeProps;
|
|
224
224
|
return (
|
|
225
|
-
<
|
|
225
|
+
<TextAncestorContext.Consumer>
|
|
226
226
|
{hasTextAncestor => {
|
|
227
227
|
if (hasTextAncestor) {
|
|
228
228
|
return (
|
|
@@ -245,7 +245,7 @@ let BaseImage: AbstractImageAndroid = ({
|
|
|
245
245
|
/>
|
|
246
246
|
);
|
|
247
247
|
}}
|
|
248
|
-
</
|
|
248
|
+
</TextAncestorContext.Consumer>
|
|
249
249
|
);
|
|
250
250
|
}}
|
|
251
251
|
</ImageAnalyticsTagContext.Consumer>
|
|
@@ -26,7 +26,7 @@ import {ConditionallyIgnoredEventHandlers} from '../NativeComponent/ViewConfigIg
|
|
|
26
26
|
import codegenNativeCommands from '../Utilities/codegenNativeCommands';
|
|
27
27
|
import Platform from '../Utilities/Platform';
|
|
28
28
|
|
|
29
|
-
type
|
|
29
|
+
type ImageHostComponentProps = $ReadOnly<{
|
|
30
30
|
...ImageProps,
|
|
31
31
|
...ViewProps,
|
|
32
32
|
|
|
@@ -162,8 +162,8 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
162
162
|
},
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
const ImageViewNativeComponent: HostComponent<
|
|
166
|
-
NativeComponentRegistry.get<
|
|
165
|
+
const ImageViewNativeComponent: HostComponent<ImageHostComponentProps> =
|
|
166
|
+
NativeComponentRegistry.get<ImageHostComponentProps>(
|
|
167
167
|
'RCTImageView',
|
|
168
168
|
() => __INTERNAL_VIEW_CONFIG,
|
|
169
169
|
);
|
|
@@ -18,7 +18,7 @@ import type {ImageResizeMode} from './ImageResizeMode';
|
|
|
18
18
|
|
|
19
19
|
import * as NativeComponentRegistry from '../NativeComponent/NativeComponentRegistry';
|
|
20
20
|
|
|
21
|
-
type
|
|
21
|
+
type RCTTextInlineImageNativeProps = $ReadOnly<{
|
|
22
22
|
...ViewProps,
|
|
23
23
|
resizeMode?: ?ImageResizeMode,
|
|
24
24
|
src?: ?$ReadOnlyArray<?$ReadOnly<{uri?: ?string, ...}>>,
|
|
@@ -40,8 +40,8 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
|
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
const TextInlineImage: HostComponent<
|
|
44
|
-
NativeComponentRegistry.get<
|
|
43
|
+
const TextInlineImage: HostComponent<RCTTextInlineImageNativeProps> =
|
|
44
|
+
NativeComponentRegistry.get<RCTTextInlineImageNativeProps>(
|
|
45
45
|
'RCTTextInlineImage',
|
|
46
46
|
() => __INTERNAL_VIEW_CONFIG,
|
|
47
47
|
);
|
|
@@ -73,6 +73,8 @@ const InteractionManagerImpl = {
|
|
|
73
73
|
* Notify manager that an interaction has started.
|
|
74
74
|
*/
|
|
75
75
|
createInteractionHandle(): Handle {
|
|
76
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
77
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
76
78
|
DEBUG && console.log('InteractionManager: create interaction handle');
|
|
77
79
|
_scheduleUpdate();
|
|
78
80
|
const handle = ++_inc;
|
|
@@ -84,6 +86,8 @@ const InteractionManagerImpl = {
|
|
|
84
86
|
* Notify manager that an interaction has completed.
|
|
85
87
|
*/
|
|
86
88
|
clearInteractionHandle(handle: Handle) {
|
|
89
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
90
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
87
91
|
DEBUG && console.log('InteractionManager: clear interaction handle');
|
|
88
92
|
invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
|
|
89
93
|
_scheduleUpdate();
|
|
@@ -229,7 +233,8 @@ function _processUpdate() {
|
|
|
229
233
|
*/
|
|
230
234
|
const InteractionManager = (
|
|
231
235
|
ReactNativeFeatureFlags.disableInteractionManager()
|
|
232
|
-
?
|
|
236
|
+
? // $FlowFixMe[incompatible-variance]
|
|
237
|
+
require('./InteractionManagerStub').default
|
|
233
238
|
: InteractionManagerImpl
|
|
234
239
|
) as typeof InteractionManagerImpl;
|
|
235
240
|
|
|
@@ -99,9 +99,13 @@ class TaskQueue {
|
|
|
99
99
|
const task = queue.shift();
|
|
100
100
|
try {
|
|
101
101
|
if (typeof task === 'object' && task.gen) {
|
|
102
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
103
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
102
104
|
DEBUG && console.log('TaskQueue: genPromise for task ' + task.name);
|
|
103
105
|
this._genPromise(task);
|
|
104
106
|
} else if (typeof task === 'object' && task.run) {
|
|
107
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
108
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
105
109
|
DEBUG && console.log('TaskQueue: run task ' + task.name);
|
|
106
110
|
task.run();
|
|
107
111
|
} else {
|
|
@@ -110,6 +114,8 @@ class TaskQueue {
|
|
|
110
114
|
'Expected Function, SimpleTask, or PromiseTask, but got:\n' +
|
|
111
115
|
JSON.stringify(task, null, 2),
|
|
112
116
|
);
|
|
117
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
118
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
113
119
|
DEBUG && console.log('TaskQueue: run anonymous task');
|
|
114
120
|
task();
|
|
115
121
|
}
|
|
@@ -139,6 +145,8 @@ class TaskQueue {
|
|
|
139
145
|
this._queueStack.length > 1
|
|
140
146
|
) {
|
|
141
147
|
this._queueStack.pop();
|
|
148
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
149
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
142
150
|
DEBUG &&
|
|
143
151
|
console.log('TaskQueue: popped queue: ', {
|
|
144
152
|
stackIdx,
|
|
@@ -158,11 +166,17 @@ class TaskQueue {
|
|
|
158
166
|
this._queueStack.push({tasks: [], popable: false});
|
|
159
167
|
const stackIdx = this._queueStack.length - 1;
|
|
160
168
|
const stackItem = this._queueStack[stackIdx];
|
|
169
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
170
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
161
171
|
DEBUG && console.log('TaskQueue: push new queue: ', {stackIdx});
|
|
172
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
173
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
162
174
|
DEBUG && console.log('TaskQueue: exec gen task ' + task.name);
|
|
163
175
|
task
|
|
164
176
|
.gen()
|
|
165
177
|
.then(() => {
|
|
178
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
179
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
166
180
|
DEBUG &&
|
|
167
181
|
console.log('TaskQueue: onThen for gen task ' + task.name, {
|
|
168
182
|
stackIdx,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
import type {
|
|
14
|
-
LayoutAnimationConfig
|
|
14
|
+
LayoutAnimationConfig,
|
|
15
15
|
LayoutAnimationProperty,
|
|
16
16
|
LayoutAnimationType,
|
|
17
17
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
@@ -29,7 +29,7 @@ export type {
|
|
|
29
29
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
30
30
|
|
|
31
31
|
// Reexport type
|
|
32
|
-
export type LayoutAnimationConfig
|
|
32
|
+
export type {LayoutAnimationConfig} from '../Renderer/shims/ReactNativeTypes';
|
|
33
33
|
|
|
34
34
|
export type LayoutAnimationTypes = $ReadOnly<{
|
|
35
35
|
[type in LayoutAnimationType]: type,
|
|
@@ -45,7 +45,7 @@ type OnAnimationDidFailCallback = () => void;
|
|
|
45
45
|
let isLayoutAnimationEnabled: boolean =
|
|
46
46
|
ReactNativeFeatureFlags.isLayoutAnimationEnabled();
|
|
47
47
|
|
|
48
|
-
function
|
|
48
|
+
function setLayoutAnimationEnabled(value: boolean) {
|
|
49
49
|
isLayoutAnimationEnabled = isLayoutAnimationEnabled;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -115,7 +115,7 @@ function configureNext(
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function
|
|
118
|
+
function createLayoutAnimation(
|
|
119
119
|
duration: number,
|
|
120
120
|
type?: LayoutAnimationType,
|
|
121
121
|
property?: LayoutAnimationProperty,
|
|
@@ -129,12 +129,16 @@ function create(
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
const Presets = {
|
|
132
|
-
easeInEaseOut: (
|
|
132
|
+
easeInEaseOut: (createLayoutAnimation(
|
|
133
133
|
300,
|
|
134
134
|
'easeInEaseOut',
|
|
135
135
|
'opacity',
|
|
136
136
|
): LayoutAnimationConfig),
|
|
137
|
-
linear: (
|
|
137
|
+
linear: (createLayoutAnimation(
|
|
138
|
+
500,
|
|
139
|
+
'linear',
|
|
140
|
+
'opacity',
|
|
141
|
+
): LayoutAnimationConfig),
|
|
138
142
|
spring: ({
|
|
139
143
|
duration: 700,
|
|
140
144
|
create: {
|
|
@@ -180,7 +184,7 @@ const LayoutAnimation = {
|
|
|
180
184
|
/**
|
|
181
185
|
* Helper for creating a config for `configureNext`.
|
|
182
186
|
*/
|
|
183
|
-
create,
|
|
187
|
+
create: createLayoutAnimation,
|
|
184
188
|
Types: Object.freeze({
|
|
185
189
|
spring: 'spring',
|
|
186
190
|
linear: 'linear',
|
|
@@ -208,7 +212,7 @@ const LayoutAnimation = {
|
|
|
208
212
|
spring: (configureNext.bind(null, Presets.spring): (
|
|
209
213
|
onAnimationDidEnd?: OnAnimationDidEndCallback,
|
|
210
214
|
) => void),
|
|
211
|
-
setEnabled,
|
|
215
|
+
setEnabled: setLayoutAnimationEnabled,
|
|
212
216
|
};
|
|
213
217
|
|
|
214
218
|
export default LayoutAnimation;
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
ListRenderItemInfo,
|
|
16
16
|
ViewabilityConfigCallbackPair,
|
|
17
17
|
ViewToken,
|
|
18
|
+
VirtualizedListProps,
|
|
18
19
|
} from '@react-native/virtualized-lists';
|
|
19
20
|
|
|
20
21
|
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
@@ -32,14 +33,14 @@ const invariant = require('invariant');
|
|
|
32
33
|
const VirtualizedList = VirtualizedLists.VirtualizedList;
|
|
33
34
|
const defaultKeyExtractor = VirtualizedLists.keyExtractor;
|
|
34
35
|
|
|
35
|
-
type
|
|
36
|
+
type RequiredFlatListProps<ItemT> = {
|
|
36
37
|
/**
|
|
37
38
|
* An array (or array-like list) of items to render. Other data types can be
|
|
38
39
|
* used by targeting VirtualizedList directly.
|
|
39
40
|
*/
|
|
40
41
|
data: ?$ReadOnly<$ArrayLike<ItemT>>,
|
|
41
42
|
};
|
|
42
|
-
type
|
|
43
|
+
type OptionalFlatListProps<ItemT> = {
|
|
43
44
|
/**
|
|
44
45
|
* Takes an item from `data` and renders it into the list. Example usage:
|
|
45
46
|
*
|
|
@@ -177,12 +178,10 @@ function isArrayLike(data: mixed): boolean {
|
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
type FlatListBaseProps<ItemT> = {
|
|
180
|
-
...
|
|
181
|
-
...
|
|
181
|
+
...RequiredFlatListProps<ItemT>,
|
|
182
|
+
...OptionalFlatListProps<ItemT>,
|
|
182
183
|
};
|
|
183
184
|
|
|
184
|
-
type VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;
|
|
185
|
-
|
|
186
185
|
export type FlatListProps<ItemT> = {
|
|
187
186
|
...Omit<
|
|
188
187
|
VirtualizedListProps,
|
|
@@ -39,7 +39,7 @@ export type {
|
|
|
39
39
|
ScrollToLocationParamsType as SectionListScrollParams,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
type
|
|
42
|
+
type RequiredSectionListProps<ItemT, SectionT = DefaultSectionT> = {
|
|
43
43
|
/**
|
|
44
44
|
* The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).
|
|
45
45
|
*
|
|
@@ -64,7 +64,7 @@ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
|
|
|
64
64
|
info: SectionListRenderItemInfo<ItemT, SectionT>,
|
|
65
65
|
) => React.Node | null;
|
|
66
66
|
|
|
67
|
-
type
|
|
67
|
+
type OptionalSectionListProps<ItemT, SectionT = DefaultSectionT> = {
|
|
68
68
|
/**
|
|
69
69
|
* Default renderer for every item in every section. Can be over-ridden on a per-section basis.
|
|
70
70
|
*/
|
|
@@ -110,8 +110,8 @@ export type SectionListProps<ItemT, SectionT = DefaultSectionT> = {
|
|
|
110
110
|
VirtualizedSectionListProps<ItemT, SectionT>,
|
|
111
111
|
'getItem' | 'getItemCount' | 'renderItem' | 'keyExtractor',
|
|
112
112
|
>,
|
|
113
|
-
...
|
|
114
|
-
...
|
|
113
|
+
...RequiredSectionListProps<ItemT, SectionT>,
|
|
114
|
+
...OptionalSectionListProps<ItemT, SectionT>,
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/**
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
import VirtualizedLists from '@react-native/virtualized-lists';
|
|
14
14
|
|
|
15
15
|
type VirtualizedListType = typeof VirtualizedLists.VirtualizedList;
|
|
16
|
-
const
|
|
16
|
+
const VirtualizedListComponent: VirtualizedListType =
|
|
17
|
+
VirtualizedLists.VirtualizedList;
|
|
17
18
|
|
|
18
19
|
export type {
|
|
19
20
|
ListRenderItemInfo,
|
|
@@ -21,4 +22,4 @@ export type {
|
|
|
21
22
|
Separators,
|
|
22
23
|
VirtualizedListProps,
|
|
23
24
|
} from '@react-native/virtualized-lists';
|
|
24
|
-
export default
|
|
25
|
+
export default VirtualizedListComponent;
|
|
@@ -413,8 +413,8 @@ export function observe(observer: Observer): Subscription {
|
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
type
|
|
417
|
-
type
|
|
416
|
+
type LogBoxStateSubscriptionProps = $ReadOnly<{}>;
|
|
417
|
+
type LogBoxStateSubscriptionState = $ReadOnly<{
|
|
418
418
|
logs: LogBoxLogs,
|
|
419
419
|
isDisabled: boolean,
|
|
420
420
|
hasError: boolean,
|
|
@@ -432,7 +432,10 @@ type SubscribedComponent = React.ComponentType<
|
|
|
432
432
|
export function withSubscription(
|
|
433
433
|
WrappedComponent: SubscribedComponent,
|
|
434
434
|
): React.ComponentType<{}> {
|
|
435
|
-
class LogBoxStateSubscription extends React.Component<
|
|
435
|
+
class LogBoxStateSubscription extends React.Component<
|
|
436
|
+
LogBoxStateSubscriptionProps,
|
|
437
|
+
LogBoxStateSubscriptionState,
|
|
438
|
+
> {
|
|
436
439
|
static getDerivedStateFromError(): {hasError: boolean} {
|
|
437
440
|
return {hasError: true};
|
|
438
441
|
}
|
|
@@ -446,7 +449,7 @@ export function withSubscription(
|
|
|
446
449
|
|
|
447
450
|
_subscription: ?Subscription;
|
|
448
451
|
|
|
449
|
-
state:
|
|
452
|
+
state: LogBoxStateSubscriptionState = {
|
|
450
453
|
logs: new Set(),
|
|
451
454
|
isDisabled: false,
|
|
452
455
|
hasError: false,
|