@office-iss/react-native-win32 0.0.0-canary.282 → 0.0.0-canary.284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +1 -1
- package/CHANGELOG.json +79 -1
- package/CHANGELOG.md +28 -4
- package/IntegrationTests/AccessibilityManagerTest.js +17 -12
- package/IntegrationTests/AppEventsTest.js +47 -32
- package/IntegrationTests/GlobalEvalWithSourceUrlTest.js +10 -14
- package/IntegrationTests/ImageCachePolicyTest.js +64 -81
- package/IntegrationTests/ImageSnapshotTest.js +17 -20
- package/IntegrationTests/IntegrationTestHarnessTest.js +34 -52
- package/IntegrationTests/IntegrationTestsApp.js +11 -6
- package/IntegrationTests/LayoutEventsTest.js +1 -1
- package/IntegrationTests/LoggingTestModule.js +2 -1
- package/IntegrationTests/PromiseTest.js +51 -43
- package/IntegrationTests/SimpleSnapshotTest.js +19 -24
- package/IntegrationTests/SyncMethodTest.js +9 -13
- package/IntegrationTests/TimersTest.js +3 -3
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +3 -3
- package/Libraries/Alert/Alert.js +1 -1
- package/Libraries/Alert/Alert.win32.js +1 -1
- package/Libraries/Alert/RCTAlertManager.android.js +1 -1
- package/Libraries/Alert/RCTAlertManager.ios.js +1 -1
- package/Libraries/Animated/AnimatedMock.js +1 -1
- package/Libraries/Animated/AnimatedWeb.js +27 -9
- package/Libraries/Animated/nodes/AnimatedValue.js +35 -13
- package/Libraries/Animated/useAnimatedProps.js +47 -85
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/BatchedBridge/BatchedBridge.js +4 -2
- package/Libraries/BatchedBridge/MessageQueue.js +2 -2
- package/Libraries/BatchedBridge/NativeModules.js +4 -3
- package/Libraries/Blob/Blob.js +4 -4
- package/Libraries/Blob/BlobManager.js +3 -2
- package/Libraries/Blob/BlobRegistry.js +3 -9
- package/Libraries/Blob/File.js +3 -2
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/BugReporting/BugReporting.js +2 -2
- package/Libraries/BugReporting/dumpReactTree.js +2 -2
- package/Libraries/BugReporting/getReactData.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.ios.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js +1 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +5 -5
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/Button.win32.js +2 -2
- package/Libraries/Components/Clipboard/Clipboard.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +7 -7
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +1 -2
- package/Libraries/Components/Keyboard/Keyboard.js +9 -9
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +4 -4
- package/Libraries/Components/Pressable/Pressable.js +4 -4
- package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +9 -9
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +10 -11
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +9 -9
- package/Libraries/Components/ScrollView/ScrollView.js +32 -26
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +2 -2
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +2 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/ScrollView/processDecelerationRate.js +1 -1
- package/Libraries/Components/Sound/SoundManager.js +1 -1
- package/Libraries/Components/StaticRenderer.js +4 -4
- package/Libraries/Components/StatusBar/StatusBar.js +33 -18
- package/Libraries/Components/Switch/Switch.js +6 -6
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +31 -31
- package/Libraries/Components/TextInput/InputAccessoryView.js +2 -2
- package/Libraries/Components/TextInput/TextInput.flow.js +35 -35
- package/Libraries/Components/TextInput/TextInput.js +35 -35
- package/Libraries/Components/TextInput/TextInput.win32.js +35 -35
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +1 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +68 -6
- package/Libraries/Components/Touchable/TouchableBounce.js +5 -5
- package/Libraries/Components/Touchable/TouchableHighlight.js +11 -11
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +14 -14
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +6 -6
- package/Libraries/Components/Touchable/TouchableOpacity.js +6 -6
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/UnimplementedViews/UnimplementedView.js +9 -1
- package/Libraries/Components/View/ViewAccessibility.js +2 -2
- package/Libraries/Components/View/ViewAccessibility.win32.js +2 -2
- package/Libraries/Components/View/ViewPropTypes.js +22 -22
- package/Libraries/Components/View/ViewPropTypes.win32.js +22 -22
- package/Libraries/Core/RawEventEmitter.js +2 -2
- package/Libraries/Core/ReactNativeVersion.js +3 -5
- package/Libraries/Core/Timers/JSTimers.js +3 -3
- package/Libraries/Core/polyfillPromise.js +1 -1
- package/Libraries/Core/registerCallableModule.js +1 -1
- package/Libraries/Core/setUpAlert.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +0 -2
- package/Libraries/Core/setUpErrorHandling.js +6 -1
- package/Libraries/Core/setUpReactDevTools.js +1 -1
- package/Libraries/Core/setUpTimers.js +35 -56
- package/Libraries/Core/setUpXHR.js +5 -5
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
- package/Libraries/Events/CustomEvent.js +2 -2
- package/Libraries/Image/AssetRegistry.js +6 -1
- package/Libraries/Image/AssetSourceResolver.js +2 -2
- package/Libraries/Image/ImageProps.js +17 -17
- package/Libraries/Image/nativeImageSource.js +2 -2
- package/Libraries/Inspector/ElementProperties.js +4 -3
- package/Libraries/Inspector/Inspector.js +1 -1
- package/Libraries/Inspector/Inspector.win32.js +1 -1
- package/Libraries/Inspector/InspectorOverlay.js +4 -3
- package/Libraries/Inspector/InspectorOverlay.win32.js +3 -3
- package/Libraries/Inspector/InspectorPanel.js +6 -6
- package/Libraries/Inspector/NetworkOverlay.js +6 -5
- package/Libraries/Inspector/PerformanceOverlay.js +2 -1
- package/Libraries/Inspector/resolveBoxStyle.js +2 -2
- package/Libraries/Interaction/InteractionManager.js +3 -2
- package/Libraries/Interaction/PanResponder.js +6 -6
- package/Libraries/Interaction/TouchHistoryMath.js +26 -0
- package/Libraries/JSInspector/NetworkAgent.js +2 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +0 -1
- package/Libraries/Lists/FlatList.js +9 -10
- package/Libraries/Lists/SectionList.js +7 -9
- package/Libraries/Lists/SectionListModern.js +6 -6
- package/Libraries/LogBox/Data/LogBoxData.js +14 -14
- package/Libraries/LogBox/Data/LogBoxLog.js +51 -29
- package/Libraries/LogBox/Data/parseLogBoxLog.js +10 -10
- package/Libraries/LogBox/LogBox.js +13 -1
- package/Libraries/LogBox/LogBoxInspectorContainer.js +3 -3
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -3
- package/Libraries/LogBox/UI/LogBoxButton.js +4 -4
- package/Libraries/LogBox/UI/LogBoxInspectorBody.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +50 -31
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +50 -31
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -2
- package/Libraries/Modal/Modal.js +7 -7
- package/Libraries/Network/XMLHttpRequest.js +1 -1
- package/Libraries/Network/convertRequestBody.js +3 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
- package/Libraries/Pressability/Pressability.js +10 -10
- package/Libraries/Pressability/Pressability.win32.js +10 -10
- package/Libraries/Pressability/PressabilityDebug.js +2 -2
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +2 -2
- package/Libraries/Promise.js +2 -2
- package/Libraries/ReactNative/AppContainer.js +2 -2
- package/Libraries/ReactNative/BridgelessUIManager.js +3 -8
- package/Libraries/ReactNative/I18nManager.js +3 -2
- package/Libraries/ReactNative/PaperUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.win32.js +1 -1
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +2 -2
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +2 -2
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -2
- package/Libraries/StyleSheet/Rect.js +2 -2
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/private/_TransformStyle.js +18 -18
- package/Libraries/StyleSheet/processBackgroundImage.js +138 -136
- package/Libraries/Text/TextAncestor.js +1 -2
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Types/CodegenTypes.js +2 -1
- package/Libraries/Types/CoreEventTypes.js +40 -40
- package/Libraries/Types/CoreEventTypes.win32.js +40 -40
- package/Libraries/UTFSequence.js +2 -2
- package/Libraries/Utilities/BackHandler.android.js +2 -2
- package/Libraries/Utilities/BackHandler.ios.js +2 -2
- package/Libraries/Utilities/BackHandler.win32.js +2 -2
- package/Libraries/Utilities/HMRClient.js +2 -2
- package/Libraries/Utilities/Platform.android.js +4 -4
- package/Libraries/Utilities/Platform.flow.js +8 -8
- package/Libraries/Utilities/Platform.flow.win32.js +8 -8
- package/Libraries/Utilities/Platform.ios.js +4 -4
- package/Libraries/Utilities/Platform.win32.js +2 -2
- package/Libraries/Utilities/ReactNativeTestTools.js +3 -2
- package/Libraries/Utilities/codegenNativeCommands.js +2 -2
- package/Libraries/Utilities/codegenNativeComponent.js +2 -2
- package/Libraries/Utilities/differ/deepDiffer.js +3 -3
- package/Libraries/Utilities/stringifySafe.js +2 -2
- package/Libraries/Vibration/Vibration.js +1 -1
- package/Libraries/WebSocket/WebSocketEvent.js +1 -1
- package/Libraries/YellowBox/YellowBoxDeprecated.js +4 -3
- package/Libraries/vendor/core/ErrorUtils.js +1 -1
- package/flow/jest.js +14 -14
- package/index.js +16 -13
- package/index.win32.js +16 -13
- package/jest/setup.js +214 -197
- package/overrides.json +26 -26
- package/package.json +16 -16
- package/src/private/featureflags/ReactNativeFeatureFlags.js +11 -30
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -2
- package/src/private/specs/components/ActivityIndicatorViewNativeComponent.js +2 -2
- package/src/private/specs/components/AndroidDrawerLayoutNativeComponent.js +6 -6
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
- package/src/private/specs/components/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
- package/src/private/specs/components/AndroidSwitchNativeComponent.js +4 -4
- package/src/private/specs/components/DebuggingOverlayNativeComponent.js +2 -2
- package/src/private/specs/components/ProgressBarAndroidNativeComponent.js +2 -2
- package/src/private/specs/components/PullToRefreshViewNativeComponent.js +2 -2
- package/src/private/specs/components/RCTInputAccessoryViewNativeComponent.js +2 -2
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +4 -4
- package/src/private/specs/components/RCTSafeAreaViewNativeComponent.js +2 -2
- package/src/private/specs/components/SwitchNativeComponent.js +4 -4
- package/src/private/specs/components/UnimplementedNativeViewNativeComponent.js +2 -2
- package/src/private/specs/modules/NativeAccessibilityManager.js +2 -2
- package/src/private/specs/modules/NativeActionSheetManager.js +7 -7
- package/src/private/specs/modules/NativeAlertManager.js +2 -2
- package/src/private/specs/modules/NativeAnimatedModule.js +2 -2
- package/src/private/specs/modules/NativeAnimatedTurboModule.js +2 -2
- package/src/private/specs/modules/NativeAppState.js +3 -3
- package/src/private/specs/modules/NativeBlobModule.js +1 -1
- package/src/private/specs/modules/NativeClipboard.js +1 -1
- package/src/private/specs/modules/NativeDeviceInfo.js +8 -8
- package/src/private/specs/modules/NativeDialogManagerAndroid.js +4 -4
- package/src/private/specs/modules/NativeExceptionsManager.js +2 -2
- package/src/private/specs/modules/NativeFantom.js +6 -0
- package/src/private/specs/modules/NativeFrameRateLogger.js +1 -1
- package/src/private/specs/modules/NativeI18nManager.js +2 -2
- package/src/private/specs/modules/NativeImageEditor.js +9 -9
- package/src/private/specs/modules/NativeImageLoaderAndroid.js +1 -1
- package/src/private/specs/modules/NativeImageLoaderIOS.js +1 -1
- package/src/private/specs/modules/NativeImageLoaderWin32.js +1 -1
- package/src/private/specs/modules/NativeImageStoreAndroid.js +1 -1
- package/src/private/specs/modules/NativeImageStoreIOS.js +3 -3
- package/src/private/specs/modules/NativeNetworkingIOS.js +2 -2
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +4 -4
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +4 -4
- package/src/private/specs/modules/NativePlatformConstantsWin.js +5 -10
- package/src/private/specs/modules/NativePushNotificationManagerIOS.js +7 -7
- package/src/private/specs/modules/NativeSampleTurboModule.js +2 -2
- package/src/private/specs/modules/NativeSettingsManager.js +2 -2
- package/src/private/specs/modules/NativeShareModule.js +3 -3
- package/src/private/specs/modules/NativeSourceCode.js +2 -2
- package/src/private/specs/modules/NativeStatusBarManagerAndroid.js +4 -4
- package/src/private/specs/modules/NativeStatusBarManagerIOS.js +6 -6
- package/src/private/specs/modules/NativeToastAndroid.js +2 -2
- package/src/private/specs/modules/NativeVibration.js +1 -1
- package/src/private/specs/modules/NativeWebSocketModule.js +1 -1
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +2 -2
- package/src/private/webapis/intersectionobserver/{IntersectionObserverManager.js → internals/IntersectionObserverManager.js} +9 -9
- package/src/private/webapis/mutationobserver/MutationObserver.js +2 -2
- package/src/private/webapis/mutationobserver/{MutationObserverManager.js → internals/MutationObserverManager.js} +8 -8
- package/src/private/webapis/performance/EventTiming.js +1 -1
- package/src/private/webapis/performance/Performance.js +3 -3
- package/src/private/webapis/performance/PerformanceObserver.js +2 -2
- package/src/private/webapis/performance/{RawPerformanceEntry.js → internals/RawPerformanceEntry.js} +6 -6
- package/src/private/webapis/performance/{Utilities.js → internals/Utilities.js} +1 -1
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +1 -1
|
@@ -32,11 +32,14 @@ const TESTS = [
|
|
|
32
32
|
require('./GlobalEvalWithSourceUrlTest'),
|
|
33
33
|
];
|
|
34
34
|
|
|
35
|
-
TESTS.forEach(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
TESTS.forEach(test =>
|
|
36
|
+
AppRegistry.registerComponent(
|
|
37
|
+
test.displayName || test.name || '',
|
|
38
|
+
/* $FlowFixMe[incompatible-call] (>=0.54.0 site=react_native_fb,react_native_
|
|
39
|
+
* oss) This comment suppresses an error found when Flow v0.54 was deployed.
|
|
40
|
+
* To see the error delete this comment and run Flow. */
|
|
41
|
+
() => test,
|
|
42
|
+
),
|
|
40
43
|
);
|
|
41
44
|
|
|
42
45
|
// Modules required for integration tests
|
|
@@ -78,7 +81,9 @@ class IntegrationTestsApp extends React.Component<{...}, $FlowFixMeState> {
|
|
|
78
81
|
* deployed. To see the error, delete this comment and run Flow.
|
|
79
82
|
*/
|
|
80
83
|
style={styles.row}>
|
|
81
|
-
<Text style={styles.testName}>
|
|
84
|
+
<Text style={styles.testName}>
|
|
85
|
+
{test.displayName || test.name}
|
|
86
|
+
</Text>
|
|
82
87
|
</TouchableOpacity>,
|
|
83
88
|
<View style={styles.separator} />,
|
|
84
89
|
])}
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
const invariant = require('invariant');
|
|
13
|
-
const BatchedBridge =
|
|
13
|
+
const BatchedBridge =
|
|
14
|
+
require('react-native/Libraries/BatchedBridge/BatchedBridge').default;
|
|
14
15
|
|
|
15
16
|
const LoggingTestModule = {
|
|
16
17
|
logToConsole: function (str) {
|
|
@@ -10,69 +10,77 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const {TestModule} = ReactNative.NativeModules;
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import {useEffect, useRef} from 'react';
|
|
15
|
+
import {NativeModules, View} from 'react-native';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
shouldResolve: boolean = false;
|
|
20
|
-
shouldReject: boolean = false;
|
|
21
|
-
shouldSucceedAsync: boolean = false;
|
|
22
|
-
shouldThrowAsync: boolean = false;
|
|
17
|
+
const {TestModule} = NativeModules;
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.testShouldSucceedAsync(),
|
|
30
|
-
this.testShouldThrowAsync(),
|
|
31
|
-
]).then(() =>
|
|
32
|
-
TestModule.markTestPassed(
|
|
33
|
-
this.shouldResolve &&
|
|
34
|
-
this.shouldReject &&
|
|
35
|
-
this.shouldSucceedAsync &&
|
|
36
|
-
this.shouldThrowAsync,
|
|
37
|
-
),
|
|
38
|
-
);
|
|
39
|
-
}
|
|
19
|
+
function PromiseTest(): React.Node {
|
|
20
|
+
const shouldResolve = useRef(false);
|
|
21
|
+
const shouldReject = useRef(false);
|
|
22
|
+
const shouldSucceedAsync = useRef(false);
|
|
23
|
+
const shouldThrowAsync = useRef(false);
|
|
40
24
|
|
|
41
|
-
testShouldResolve
|
|
25
|
+
const testShouldResolve = () => {
|
|
42
26
|
return TestModule.shouldResolve()
|
|
43
|
-
.then(() =>
|
|
44
|
-
|
|
27
|
+
.then(() => {
|
|
28
|
+
shouldResolve.current = true;
|
|
29
|
+
})
|
|
30
|
+
.catch(() => {
|
|
31
|
+
shouldResolve.current = false;
|
|
32
|
+
});
|
|
45
33
|
};
|
|
46
34
|
|
|
47
|
-
testShouldReject
|
|
35
|
+
const testShouldReject = () => {
|
|
48
36
|
return TestModule.shouldReject()
|
|
49
|
-
.then(() =>
|
|
50
|
-
|
|
37
|
+
.then(() => {
|
|
38
|
+
shouldReject.current = false;
|
|
39
|
+
})
|
|
40
|
+
.catch(() => {
|
|
41
|
+
shouldReject.current = true;
|
|
42
|
+
});
|
|
51
43
|
};
|
|
52
44
|
|
|
53
|
-
testShouldSucceedAsync
|
|
45
|
+
const testShouldSucceedAsync = async () => {
|
|
54
46
|
try {
|
|
55
47
|
await TestModule.shouldResolve();
|
|
56
|
-
|
|
48
|
+
shouldSucceedAsync.current = true;
|
|
57
49
|
} catch (e) {
|
|
58
|
-
|
|
50
|
+
shouldSucceedAsync.current = false;
|
|
59
51
|
}
|
|
60
52
|
};
|
|
61
53
|
|
|
62
|
-
testShouldThrowAsync
|
|
54
|
+
const testShouldThrowAsync = async () => {
|
|
63
55
|
try {
|
|
64
56
|
await TestModule.shouldReject();
|
|
65
|
-
|
|
57
|
+
shouldThrowAsync.current = false;
|
|
66
58
|
} catch (e) {
|
|
67
|
-
|
|
59
|
+
shouldThrowAsync.current = true;
|
|
68
60
|
}
|
|
69
61
|
};
|
|
70
62
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
async function runTests() {
|
|
65
|
+
await Promise.all([
|
|
66
|
+
testShouldResolve(),
|
|
67
|
+
testShouldReject(),
|
|
68
|
+
testShouldSucceedAsync(),
|
|
69
|
+
testShouldThrowAsync(),
|
|
70
|
+
]);
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
TestModule.markTestPassed(
|
|
73
|
+
shouldResolve.current &&
|
|
74
|
+
shouldReject.current &&
|
|
75
|
+
shouldSucceedAsync.current &&
|
|
76
|
+
shouldThrowAsync.current,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
runTests().catch(console.error);
|
|
81
|
+
}, []);
|
|
82
|
+
|
|
83
|
+
return <View />;
|
|
84
|
+
}
|
|
77
85
|
|
|
78
|
-
|
|
86
|
+
export default PromiseTest;
|
|
@@ -10,32 +10,29 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import {useEffect} from 'react';
|
|
15
|
+
import {NativeModules, StyleSheet, View} from 'react-native';
|
|
15
16
|
|
|
16
|
-
const {
|
|
17
|
-
const {TestModule} = ReactNative.NativeModules;
|
|
17
|
+
const {TestModule} = NativeModules;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
function SimpleSnapshotTest(): React.Node {
|
|
20
|
+
const done = (success: boolean) => {
|
|
21
|
+
TestModule.markTestPassed(success);
|
|
22
|
+
};
|
|
23
|
+
useEffect(() => {
|
|
21
24
|
if (!TestModule.verifySnapshot) {
|
|
22
25
|
throw new Error('TestModule.verifySnapshot not defined.');
|
|
23
26
|
}
|
|
24
|
-
requestAnimationFrame(() => TestModule.verifySnapshot(
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<View style={styles.container}>
|
|
34
|
-
<View style={styles.box1} />
|
|
35
|
-
<View style={styles.box2} />
|
|
36
|
-
</View>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
27
|
+
requestAnimationFrame(() => TestModule.verifySnapshot(done));
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={styles.container}>
|
|
32
|
+
<View style={styles.box1} />
|
|
33
|
+
<View style={styles.box2} />
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
const styles = StyleSheet.create({
|
|
@@ -57,6 +54,4 @@ const styles = StyleSheet.create({
|
|
|
57
54
|
},
|
|
58
55
|
});
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
module.exports = SimpleSnapshotTest;
|
|
57
|
+
export default SimpleSnapshotTest;
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import {useEffect} from 'react';
|
|
15
|
+
import {NativeModules, View} from 'react-native';
|
|
16
16
|
|
|
17
|
-
const {TestModule, RNTesterTestModule} =
|
|
17
|
+
const {TestModule, RNTesterTestModule} = NativeModules;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
function SyncMethodTest(): React.Node {
|
|
20
|
+
useEffect(() => {
|
|
21
21
|
if (
|
|
22
22
|
RNTesterTestModule.echoString('test string value') !== 'test string value'
|
|
23
23
|
) {
|
|
@@ -41,13 +41,9 @@ class SyncMethodTest extends React.Component<{...}> {
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
}, []);
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
return <View />;
|
|
48
|
-
}
|
|
46
|
+
return <View />;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
module.exports = SyncMethodTest;
|
|
49
|
+
export default SyncMethodTest;
|
|
@@ -15,12 +15,12 @@ const ReactNative = require('react-native');
|
|
|
15
15
|
const {StyleSheet, Text, View} = ReactNative;
|
|
16
16
|
const {TestModule} = ReactNative.NativeModules;
|
|
17
17
|
|
|
18
|
-
type Props = $ReadOnly<{
|
|
18
|
+
type Props = $ReadOnly<{}>;
|
|
19
19
|
|
|
20
|
-
type State = {
|
|
20
|
+
type State = {
|
|
21
21
|
count: number,
|
|
22
22
|
done: boolean,
|
|
23
|
-
|
|
23
|
+
};
|
|
24
24
|
|
|
25
25
|
type ImmediateID = Object;
|
|
26
26
|
|
|
@@ -40,7 +40,7 @@ const ActionSheetIOS = {
|
|
|
40
40
|
* See https://reactnative.dev/docs/actionsheetios#showactionsheetwithoptions
|
|
41
41
|
*/
|
|
42
42
|
showActionSheetWithOptions(
|
|
43
|
-
options: {
|
|
43
|
+
options: {
|
|
44
44
|
+title?: ?string,
|
|
45
45
|
+message?: ?string,
|
|
46
46
|
+options: Array<string>,
|
|
@@ -52,7 +52,7 @@ const ActionSheetIOS = {
|
|
|
52
52
|
+disabledButtonTintColor?: ColorValue | ProcessedColorValue,
|
|
53
53
|
+userInterfaceStyle?: string,
|
|
54
54
|
+disabledButtonIndices?: Array<number>,
|
|
55
|
-
|
|
55
|
+
},
|
|
56
56
|
callback: (buttonIndex: number) => void,
|
|
57
57
|
) {
|
|
58
58
|
invariant(
|
|
@@ -172,4 +172,4 @@ const ActionSheetIOS = {
|
|
|
172
172
|
},
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
export default ActionSheetIOS;
|
package/Libraries/Alert/Alert.js
CHANGED
|
@@ -11,7 +11,7 @@ import NativeDialogManagerAndroid from '../NativeModules/specs/NativeDialogManag
|
|
|
11
11
|
|
|
12
12
|
function emptyCallback() {}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
export default {
|
|
15
15
|
alertWithArgs: function (args, callback) {
|
|
16
16
|
// TODO(5998984): Polyfill it correctly with DialogManagerAndroid
|
|
17
17
|
if (!NativeDialogManagerAndroid) {
|
|
@@ -10,17 +10,35 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import type {AnimatedComponentType} from './createAnimatedComponent';
|
|
14
|
+
|
|
13
15
|
import AnimatedImplementation from './AnimatedImplementation';
|
|
16
|
+
import React from 'react';
|
|
14
17
|
|
|
15
18
|
export default {
|
|
16
19
|
...AnimatedImplementation,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
div: AnimatedImplementation.createAnimatedComponent<
|
|
21
|
+
React.PropsOf<'div'>,
|
|
22
|
+
mixed,
|
|
23
|
+
>(
|
|
24
|
+
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
|
25
|
+
* types. Plain intrinsic components can't be typed like this */
|
|
26
|
+
'div',
|
|
27
|
+
) as AnimatedComponentType<React.PropsOf<'div'>>,
|
|
28
|
+
span: AnimatedImplementation.createAnimatedComponent<
|
|
29
|
+
React.PropsOf<'span'>,
|
|
30
|
+
mixed,
|
|
31
|
+
>(
|
|
32
|
+
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
|
33
|
+
* types. Plain intrinsic components can't be typed like this */
|
|
34
|
+
'span',
|
|
35
|
+
) as AnimatedComponentType<React.PropsOf<'span'>>,
|
|
36
|
+
img: AnimatedImplementation.createAnimatedComponent<
|
|
37
|
+
React.PropsOf<'img'>,
|
|
38
|
+
mixed,
|
|
39
|
+
>(
|
|
40
|
+
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
|
41
|
+
* types. Plain intrinsic components can't be typed like this */
|
|
42
|
+
'img',
|
|
43
|
+
) as AnimatedComponentType<React.PropsOf<'img'>>,
|
|
26
44
|
};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
12
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
12
13
|
import type Animation, {EndCallback} from '../animations/Animation';
|
|
13
14
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
14
15
|
import type AnimatedNode from './AnimatedNode';
|
|
@@ -84,6 +85,7 @@ function _executeAsAnimatedBatch(id: string, operation: () => void) {
|
|
|
84
85
|
* See https://reactnative.dev/docs/animatedvalue
|
|
85
86
|
*/
|
|
86
87
|
export default class AnimatedValue extends AnimatedWithChildren {
|
|
88
|
+
#listenerCount: number = 0;
|
|
87
89
|
#updateSubscription: ?EventSubscription = null;
|
|
88
90
|
|
|
89
91
|
_value: number;
|
|
@@ -105,20 +107,8 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
__detach() {
|
|
109
111
|
if (this.__isNative) {
|
|
110
|
-
// NOTE: In theory, we should only need to call this when any listeners
|
|
111
|
-
// are added. However, there is a global `onUserDrivenAnimationEnded`
|
|
112
|
-
// listener that relies on `onAnimatedValueUpdate` having fired to update
|
|
113
|
-
// the values in JavaScript. If that listener is removed, this could be
|
|
114
|
-
// re-optimized.
|
|
115
|
-
this.#ensureUpdateSubscriptionExists();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
__detach(): void {
|
|
120
|
-
if (this.__isNative) {
|
|
121
|
-
this.#updateSubscription?.remove();
|
|
122
112
|
NativeAnimatedAPI.getValue(this.__getNativeTag(), value => {
|
|
123
113
|
this._value = value - this._offset;
|
|
124
114
|
});
|
|
@@ -131,6 +121,38 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
131
121
|
return this._value + this._offset;
|
|
132
122
|
}
|
|
133
123
|
|
|
124
|
+
__makeNative(platformConfig: ?PlatformConfig): void {
|
|
125
|
+
super.__makeNative(platformConfig);
|
|
126
|
+
if (this.#listenerCount > 0) {
|
|
127
|
+
this.#ensureUpdateSubscriptionExists();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
addListener(callback: (value: any) => mixed): string {
|
|
132
|
+
const id = super.addListener(callback);
|
|
133
|
+
this.#listenerCount++;
|
|
134
|
+
if (this.__isNative) {
|
|
135
|
+
this.#ensureUpdateSubscriptionExists();
|
|
136
|
+
}
|
|
137
|
+
return id;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
removeListener(id: string): void {
|
|
141
|
+
super.removeListener(id);
|
|
142
|
+
this.#listenerCount--;
|
|
143
|
+
if (this.__isNative && this.#listenerCount === 0) {
|
|
144
|
+
this.#updateSubscription?.remove();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
removeAllListeners(): void {
|
|
149
|
+
super.removeAllListeners();
|
|
150
|
+
this.#listenerCount = 0;
|
|
151
|
+
if (this.__isNative) {
|
|
152
|
+
this.#updateSubscription?.remove();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
134
156
|
#ensureUpdateSubscriptionExists(): void {
|
|
135
157
|
if (this.#updateSubscription != null) {
|
|
136
158
|
return;
|