react-native-macos 0.0.0-d74468479 → 0.0.0-d7b3947f3
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/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +2 -3
- package/Libraries/Alert/Alert.js +2 -2
- package/Libraries/Alert/RCTAlertManager.android.js +1 -1
- package/Libraries/Animated/AnimatedEvent.js +10 -5
- package/Libraries/Animated/AnimatedImplementation.js +92 -60
- package/Libraries/Animated/AnimatedMock.js +14 -11
- package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/Animated/AnimatedPlatformConfig.js} +6 -5
- package/Libraries/Animated/Easing.js +36 -36
- package/Libraries/Animated/NativeAnimatedHelper.js +23 -20
- package/Libraries/Animated/animations/Animation.js +5 -3
- package/Libraries/Animated/animations/DecayAnimation.js +5 -0
- package/Libraries/Animated/animations/SpringAnimation.js +15 -0
- package/Libraries/Animated/animations/TimingAnimation.js +14 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +5 -4
- package/Libraries/Animated/nodes/AnimatedColor.js +266 -0
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +4 -3
- package/Libraries/Animated/nodes/AnimatedDivision.js +5 -4
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -3
- package/Libraries/Animated/nodes/AnimatedModulo.js +4 -3
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +5 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +27 -14
- package/Libraries/Animated/nodes/AnimatedProps.js +11 -3
- package/Libraries/Animated/nodes/AnimatedStyle.js +6 -4
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +5 -4
- package/Libraries/Animated/nodes/AnimatedTracking.js +7 -5
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -3
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -0
- package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +5 -4
- package/Libraries/AppState/AppState.js +8 -7
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +2 -2
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -20
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -2
- package/Libraries/Components/Button.js +1 -2
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +6 -7
- package/Libraries/Components/Keyboard/Keyboard.js +8 -7
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +8 -13
- package/Libraries/Components/Pressable/Pressable.js +1 -2
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +2 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +2 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +2 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -0
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +15 -5
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +3 -5
- package/Libraries/Components/ScrollView/ScrollView.js +34 -100
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +134 -71
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -2
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +2 -8
- package/Libraries/Components/Slider/SliderNativeComponent.js +2 -2
- package/Libraries/Components/Sound/SoundManager.js +1 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +115 -2
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -2
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +9 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +5 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +33 -8
- package/Libraries/Components/TextInput/TextInput.js +137 -11
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +3 -3
- package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +3 -3
- package/Libraries/Components/Touchable/BoundingDimensions.js +2 -2
- package/Libraries/Components/Touchable/PooledClass.js +6 -6
- package/Libraries/Components/Touchable/Position.js +1 -1
- package/Libraries/Components/Touchable/Touchable.js +26 -25
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -2
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -11
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -3
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -0
- package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +3 -3
- package/Libraries/Components/View/View.js +0 -7
- package/Libraries/Components/View/ViewNativeComponent.js +3 -4
- package/Libraries/Components/View/ViewPropTypes.js +17 -6
- package/Libraries/Core/Devtools/parseHermesStack.js +2 -1
- package/Libraries/Core/ExceptionsManager.js +2 -2
- package/Libraries/Core/NativeExceptionsManager.js +2 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/ReactNativeVersionCheck.js +1 -0
- package/Libraries/Core/Timers/JSTimers.js +34 -41
- package/Libraries/Core/setUpAlert.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/Core/setUpRegeneratorRuntime.js +1 -1
- package/Libraries/Core/setUpSegmentFetcher.js +4 -4
- package/Libraries/EventEmitter/NativeEventEmitter.js +2 -1
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -1
- package/Libraries/HeapCapture/HeapCapture.js +1 -1
- package/Libraries/Image/AssetSourceResolver.js +2 -4
- package/Libraries/Image/Image.android.js +20 -11
- package/Libraries/Image/Image.ios.js +3 -3
- package/Libraries/Image/ImageAnalyticsTagContext.js +2 -3
- package/Libraries/Image/ImageBackground.js +1 -2
- package/Libraries/Image/ImagePickerIOS.js +6 -6
- package/Libraries/Image/ImageViewNativeComponent.js +95 -60
- package/Libraries/Image/NativeImageLoaderAndroid.js +1 -3
- package/Libraries/Image/RCTImageCache.m +1 -1
- package/Libraries/Image/RCTImageView.mm +36 -24
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +12 -72
- package/Libraries/Inspector/ElementProperties.js +2 -4
- package/Libraries/Inspector/InspectorOverlay.js +1 -2
- package/Libraries/Inspector/InspectorPanel.js +1 -2
- package/Libraries/Inspector/NetworkOverlay.js +5 -11
- package/Libraries/Interaction/BridgeSpyStallHandler.js +1 -1
- package/Libraries/Interaction/FrameRateLogger.js +2 -2
- package/Libraries/Interaction/InteractionManager.js +2 -4
- package/Libraries/Interaction/JSEventLoopWatchdog.js +4 -4
- package/Libraries/Interaction/PanResponder.js +3 -4
- package/Libraries/Interaction/TouchHistoryMath.js +7 -7
- package/Libraries/JSInspector/NetworkAgent.js +1 -6
- package/Libraries/LayoutAnimation/LayoutAnimation.js +3 -3
- package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
- package/Libraries/Lists/FillRateHelper.js +1 -3
- package/Libraries/Lists/FlatList.js +41 -5
- package/Libraries/Lists/ViewabilityHelper.js +4 -10
- package/Libraries/Lists/VirtualizeUtils.js +2 -6
- package/Libraries/Lists/VirtualizedList.js +162 -131
- package/Libraries/Lists/VirtualizedListContext.js +3 -5
- package/Libraries/Lists/VirtualizedSectionList.js +63 -68
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +12 -23
- package/Libraries/LogBox/UI/LogBoxButton.js +2 -4
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -4
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -6
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -4
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -4
- package/Libraries/LogBox/UI/LogBoxNotification.js +2 -4
- package/Libraries/Modal/Modal.js +2 -5
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h +14 -0
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
- package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
- package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -4
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +39 -0
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/Network/XHRInterceptor.js +5 -6
- package/Libraries/Network/XMLHttpRequest.js +0 -1
- package/Libraries/NewAppScreen/components/Header.js +2 -4
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -2
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +2 -4
- package/Libraries/Performance/QuickPerformanceLogger.js +17 -0
- package/Libraries/Performance/SamplingProfiler.js +3 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -3
- package/Libraries/Pressability/Pressability.js +2 -2
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +4 -2
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +8 -7
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/ReactNative/AppContainer.js +4 -6
- package/Libraries/ReactNative/AppRegistry.js +2 -3
- package/Libraries/ReactNative/I18nManager.js +2 -5
- package/Libraries/ReactNative/PaperUIManager.js +2 -3
- package/Libraries/ReactNative/RootTag.js +2 -3
- package/Libraries/ReactNative/UIManager.js +5 -10
- package/Libraries/ReactNative/UIManagerInjection.js +3 -3
- package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -0
- package/Libraries/ReactNative/renderApplication.js +1 -2
- package/Libraries/Renderer/REVISION +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +278 -356
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +87 -78
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +340 -393
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +278 -356
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +87 -78
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +340 -393
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Storage/AsyncStorage.js +21 -21
- package/Libraries/StyleSheet/StyleSheet.js +2 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +26 -1
- package/Libraries/StyleSheet/processColor.js +2 -2
- package/Libraries/StyleSheet/splitLayoutProps.js +1 -3
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
- package/Libraries/Text/RCTTextAttributes.h +11 -3
- package/Libraries/Text/RCTTextAttributes.m +64 -14
- package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
- package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
- package/Libraries/Text/Text/RCTTextView.m +123 -58
- package/Libraries/Text/Text.js +2 -9
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +66 -1
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +105 -7
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +13 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +20 -3
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +12 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +9 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +128 -4
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +15 -3
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.m +4 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +2 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +68 -2
- package/Libraries/Text/TextNativeComponent.js +5 -5
- package/Libraries/Text/TextProps.js +29 -0
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Types/CoreEventTypes.js +0 -1
- package/Libraries/Utilities/Appearance.js +8 -5
- package/Libraries/Utilities/BackHandler.android.js +4 -4
- package/Libraries/Utilities/HMRClient.js +2 -2
- package/Libraries/Utilities/JSDevSupportModule.js +3 -4
- package/Libraries/Utilities/MatrixMath.js +19 -19
- package/Libraries/Utilities/PerformanceLoggerContext.js +2 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +2 -4
- package/Libraries/Utilities/SceneTracker.js +1 -3
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -3
- package/Libraries/Utilities/buildStyleInterpolator.js +9 -9
- package/Libraries/Utilities/codegenNativeComponent.js +4 -2
- package/Libraries/Utilities/differ/deepDiffer.js +1 -1
- package/Libraries/Utilities/differ/insetsDiffer.js +1 -1
- package/Libraries/Utilities/differ/matricesDiffer.js +1 -1
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/Utilities/differ/sizesDiffer.js +1 -1
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/mergeIntoFast.js +1 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -0
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/Libraries/Vibration/Vibration.js +2 -2
- package/Libraries/WebSocket/RCTSRWebSocket.m +4 -0
- package/Libraries/WebSocket/WebSocketInterceptor.js +4 -4
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/_EmitterSubscription.js +2 -1
- package/Libraries/vendor/emitter/_EventEmitter.js +2 -1
- package/Libraries/vendor/emitter/_EventSubscription.js +2 -1
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +1 -1
- package/React/Base/RCTAssert.h +30 -15
- package/React/Base/RCTAssert.m +59 -19
- package/React/Base/RCTBridge.m +5 -3
- package/React/Base/RCTConstants.h +6 -0
- package/React/Base/RCTConstants.m +15 -0
- package/React/Base/RCTConvert.m +26 -5
- package/React/Base/RCTEventDispatcherProtocol.h +5 -0
- package/React/Base/RCTRootView.m +0 -51
- package/React/Base/RCTTouchHandler.m +15 -1
- package/React/Base/RCTUIKit.h +10 -13
- package/React/Base/RCTUtils.m +33 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/Base/macOS/RCTPlatformDisplayLink.m +3 -1
- package/React/Base/macOS/RCTUIKit.m +53 -0
- package/React/CoreModules/RCTAlertController.m +6 -0
- package/React/CoreModules/RCTAppearance.mm +21 -5
- package/React/CoreModules/RCTDevLoadingView.mm +1 -1
- package/React/CoreModules/RCTDevSettings.mm +33 -12
- package/React/CoreModules/RCTEventDispatcher.mm +6 -1
- package/React/CoreModules/RCTExceptionsManager.mm +1 -1
- package/React/CoreModules/RCTLogBox.h +1 -1
- package/React/CoreModules/RCTLogBox.mm +35 -19
- package/React/CoreModules/RCTLogBoxView.h +8 -5
- package/React/CoreModules/RCTLogBoxView.mm +64 -23
- package/React/CoreModules/RCTPerfMonitor.mm +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +1 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +69 -19
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +2 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +35 -9
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +4 -3
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -5
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +1 -1
- package/React/Fabric/Mounting/RCTMountingManager.h +1 -1
- package/React/Fabric/Mounting/RCTMountingManager.mm +19 -11
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +5 -3
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +1 -1
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +1 -1
- package/React/Fabric/RCTConversions.h +9 -1
- package/React/Fabric/RCTImageResponseObserverProxy.h +1 -0
- package/React/Fabric/RCTLocalizationProvider.mm +10 -4
- package/React/Fabric/RCTScheduler.h +7 -0
- package/React/Fabric/RCTScheduler.mm +15 -0
- package/React/Fabric/RCTSurfacePresenter.h +8 -0
- package/React/Fabric/RCTSurfacePresenter.mm +54 -24
- package/React/Fabric/RCTSurfaceTouchHandler.mm +0 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
- package/React/Modules/RCTSurfacePresenterStub.h +4 -0
- package/React/Modules/RCTUIManager.m +35 -14
- package/React/React-RCTFabric.podspec +2 -2
- package/React/Views/RCTActivityIndicatorView.m +2 -1
- package/React/Views/RCTCursor.h +39 -0
- package/React/Views/RCTCursor.m +105 -0
- package/React/Views/RCTFont.mm +11 -9
- package/React/Views/RCTModalHostView.h +5 -0
- package/React/Views/RCTModalHostViewManager.m +3 -0
- package/React/Views/RCTSliderManager.m +1 -0
- package/React/Views/RCTView.h +16 -0
- package/React/Views/RCTView.m +142 -189
- package/React/Views/RCTViewKeyboardEvent.h +6 -28
- package/React/Views/RCTViewKeyboardEvent.m +66 -61
- package/React/Views/RCTViewManager.m +19 -13
- package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
- package/React/Views/ScrollView/RCTScrollContentView.m +18 -0
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
- package/React/Views/ScrollView/RCTScrollView.h +2 -1
- package/React/Views/ScrollView/RCTScrollView.m +72 -80
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
- package/React/Views/UIView+React.h +2 -0
- package/React/Views/UIView+React.m +35 -18
- package/ReactAndroid/build.gradle +16 -6
- package/ReactAndroid/gradle.properties +4 -3
- package/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js +1 -2
- package/ReactAndroid/src/androidTest/js/Asserts.js +2 -2
- package/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js +1 -1
- package/ReactAndroid/src/androidTest/js/JSResponderTestApp.js +1 -2
- package/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js +1 -2
- package/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js +54 -54
- package/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js +1 -1
- package/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +6 -7
- package/ReactAndroid/src/androidTest/js/ShareTestModule.js +1 -1
- package/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +12 -19
- package/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js +2 -3
- package/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js +2 -2
- package/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js +17 -17
- package/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js +10 -10
- package/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js +2 -2
- package/ReactAndroid/src/androidTest/js/TextInputTestModule.js +2 -3
- package/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js +3 -6
- package/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +3 -6
- package/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +12 -4
- package/ReactAndroid/src/main/java/com/facebook/react/animated/AdditionAnimatedNode.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.java +39 -3
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/animated/MultiplicationAnimatedNode.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/SubtractionAnimatedNode.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +0 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/WritableNativeArray.java +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/WritableNativeMap.java +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.java +119 -78
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp +7 -35
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h +5 -18
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +0 -14
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.cpp +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerAdapter.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/PointerEvents.java +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/interfaces/BaseViewManagerDelegate.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/interfaces/BaseViewManagerInterface.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/interfaces/ViewProps.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +22 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +22 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java +23 -14
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +1 -8
- package/ReactAndroid/src/main/jni/Application.mk +1 -1
- package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
- package/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +40 -16
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeArray.cpp +3 -3
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeArray.h +3 -3
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeMap.cpp +2 -2
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeMap.h +3 -3
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +3 -0
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +16 -4
- package/ReactAndroid/src/main/third-party/java/okhttp/BUCK +4 -4
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/React-rncore.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/JSBigString.cpp +0 -65
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/cxxreact/tests/BUCK +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/src/HeaderWriter.js +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/src/index.js +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +346 -1294
- package/ReactCommon/microprofiler/BUCK +1 -1
- package/ReactCommon/react/debug/react_native_assert.h +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +8 -3
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
- package/ReactCommon/react/renderer/animations/conversions.h +11 -11
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
- package/ReactCommon/react/renderer/attributedstring/conversions.h +39 -39
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +4 -2
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/text/conversions.h +4 -4
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
- package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +5 -5
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +26 -17
- package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
- package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
- package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
- package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
- package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
- package/ReactCommon/react/renderer/core/EventListener.h +44 -0
- package/ReactCommon/react/renderer/core/Props.h +0 -4
- package/ReactCommon/react/renderer/core/RawProps.h +1 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
- package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
- package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
- package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +64 -85
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +101 -27
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +86 -165
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +22 -57
- package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +36 -26
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
- package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
- package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
- package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +10 -19
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +37 -13
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +4 -11
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubQueue.h +1 -0
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +8 -8
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +4 -0
- package/ReactCommon/react/utils/ContextContainer.h +2 -2
- package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
- package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
- package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/jest/assetFileTransformer.js +2 -2
- package/jest/mockModal.js +2 -2
- package/jest/preprocessor.js +2 -2
- package/jest/setup.js +3 -3
- package/package.json +33 -73
- package/react.gradle +0 -4
- package/scripts/find-node.sh +7 -0
- package/scripts/generate-artifacts.js +21 -17
- package/scripts/react_native_pods.rb +7 -9
- package/scripts/react_native_pods_utils/script_phases.rb +2 -2
- package/scripts/react_native_pods_utils/script_phases.sh +1 -1
- package/template/App.js +4 -8
- package/template/Gemfile.lock +10 -10
- package/template/_flowconfig +1 -1
- package/template/_gitignore +2 -1
- package/template/android/build.gradle +1 -1
- package/template/android/gradle.properties +1 -1
- package/template/android/gradlew.bat +89 -89
- package/template/android/settings.gradle +1 -5
- package/template/ios/HelloWorldTests/HelloWorldTests.m +1 -0
- package/template/ios/Podfile +1 -0
- package/template/package.json +3 -3
- package/Libraries/Components/TextInput/AndroidTextInputViewConfig.js +0 -113
- package/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js +0 -28
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.android.js +0 -131
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.ios.js +0 -82
- package/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType.js +0 -40
- package/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js +0 -233
- package/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js +0 -24
- package/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js +0 -30
- package/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js +0 -32
- package/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js +0 -693
- package/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js +0 -158
- package/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js +0 -168
- package/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js +0 -99
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js +0 -46
- package/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js +0 -408
- package/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js +0 -68
- package/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js +0 -86
- package/Libraries/Types/RootTagTypes.js~merged +0 -23
- package/ReactCommon/butter/optional.h +0 -38
- package/ReactCommon/react/renderer/mapbuffer/primitives.h +0 -91
- package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
- package/flow-typed/npm/prop-types_v15.x.x.js +0 -42
- package/third-party-podspecs/boost-for-react-native.podspec +0 -20
|
@@ -9,85 +9,50 @@
|
|
|
9
9
|
|
|
10
10
|
#include <react/debug/react_native_assert.h>
|
|
11
11
|
#include <react/renderer/mapbuffer/MapBuffer.h>
|
|
12
|
-
#include <react/renderer/mapbuffer/primitives.h>
|
|
13
|
-
#include <stdlib.h>
|
|
14
12
|
|
|
15
13
|
namespace facebook {
|
|
16
14
|
namespace react {
|
|
17
15
|
|
|
18
|
-
// Default
|
|
19
|
-
|
|
20
|
-
constexpr uint16_t INITIAL_KEY_VALUE_SIZE = 108;
|
|
21
|
-
|
|
22
|
-
// Default initial size for _dynamicDataValues array
|
|
23
|
-
constexpr int32_t INITIAL_DYNAMIC_DATA_SIZE = 200;
|
|
16
|
+
// Default reserved size for buckets_ vector
|
|
17
|
+
constexpr uint32_t INITIAL_BUCKETS_SIZE = 10;
|
|
24
18
|
|
|
25
19
|
/**
|
|
26
20
|
* MapBufferBuilder is a builder class for MapBuffer
|
|
27
21
|
*/
|
|
28
22
|
class MapBufferBuilder {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
void ensureKeyValueSpace();
|
|
33
|
-
|
|
34
|
-
void ensureDynamicDataSpace(int32_t size);
|
|
35
|
-
|
|
36
|
-
void storeKeyValue(Key key, uint8_t *value, int32_t valueSize);
|
|
37
|
-
|
|
38
|
-
// Array of [key,value] map entries:
|
|
39
|
-
// - Key is represented in 2 bytes
|
|
40
|
-
// - Value is stored into 8 bytes. The 8 bytes of the value will contain the
|
|
41
|
-
// actual value for the key or a pointer to the actual value (based on the
|
|
42
|
-
// type)
|
|
43
|
-
uint8_t *keyValues_ = nullptr;
|
|
44
|
-
|
|
45
|
-
// Amount of bytes allocated on _keyValues
|
|
46
|
-
uint16_t keyValuesSize_ = 0;
|
|
47
|
-
|
|
48
|
-
// Relative offset on the _keyValues array.
|
|
49
|
-
// This represents the first byte that can be written in _keyValues array
|
|
50
|
-
int32_t keyValuesOffset_ = 0;
|
|
51
|
-
|
|
52
|
-
// This array contains data for dynamic values in the MapBuffer.
|
|
53
|
-
// A dynamic value is a String or another MapBuffer.
|
|
54
|
-
uint8_t *dynamicDataValues_ = nullptr;
|
|
55
|
-
|
|
56
|
-
// Amount of bytes allocated on _dynamicDataValues
|
|
57
|
-
int32_t dynamicDataSize_ = 0;
|
|
23
|
+
public:
|
|
24
|
+
MapBufferBuilder(uint32_t initialSize = INITIAL_BUCKETS_SIZE);
|
|
58
25
|
|
|
59
|
-
|
|
60
|
-
// This represents the first byte that can be written in _dynamicDataValues
|
|
61
|
-
// array
|
|
62
|
-
int32_t dynamicDataOffset_ = 0;
|
|
26
|
+
static MapBuffer EMPTY();
|
|
63
27
|
|
|
64
|
-
|
|
65
|
-
// consistency)
|
|
66
|
-
uint16_t minKeyToStore_ = 0;
|
|
28
|
+
void putInt(MapBuffer::Key key, int32_t value);
|
|
67
29
|
|
|
68
|
-
|
|
69
|
-
MapBufferBuilder();
|
|
30
|
+
void putBool(MapBuffer::Key key, bool value);
|
|
70
31
|
|
|
71
|
-
|
|
32
|
+
void putDouble(MapBuffer::Key key, double value);
|
|
72
33
|
|
|
73
|
-
|
|
34
|
+
void putString(MapBuffer::Key key, std::string const &value);
|
|
74
35
|
|
|
75
|
-
|
|
36
|
+
void putMapBuffer(MapBuffer::Key key, MapBuffer const &map);
|
|
76
37
|
|
|
77
|
-
|
|
38
|
+
MapBuffer build();
|
|
78
39
|
|
|
79
|
-
|
|
40
|
+
private:
|
|
41
|
+
MapBuffer::Header header_ = {.count = 0, .bufferSize = 0};
|
|
80
42
|
|
|
81
|
-
|
|
43
|
+
std::vector<MapBuffer::Bucket> buckets_{};
|
|
82
44
|
|
|
83
|
-
|
|
45
|
+
std::vector<uint8_t> dynamicData_{};
|
|
84
46
|
|
|
85
|
-
|
|
47
|
+
uint16_t lastKey_{0};
|
|
86
48
|
|
|
87
|
-
|
|
49
|
+
bool needsSort_{false};
|
|
88
50
|
|
|
89
|
-
|
|
90
|
-
|
|
51
|
+
void storeKeyValue(
|
|
52
|
+
MapBuffer::Key key,
|
|
53
|
+
MapBuffer::DataType type,
|
|
54
|
+
uint8_t const *value,
|
|
55
|
+
uint32_t valueSize);
|
|
91
56
|
};
|
|
92
57
|
|
|
93
58
|
} // namespace react
|
|
@@ -21,7 +21,7 @@ TEST(MapBufferTest, testSimpleIntMap) {
|
|
|
21
21
|
|
|
22
22
|
auto map = builder.build();
|
|
23
23
|
|
|
24
|
-
EXPECT_EQ(map.
|
|
24
|
+
EXPECT_EQ(map.count(), 2);
|
|
25
25
|
EXPECT_EQ(map.getInt(0), 1234);
|
|
26
26
|
EXPECT_EQ(map.getInt(1), 4321);
|
|
27
27
|
}
|
|
@@ -38,7 +38,7 @@ TEST(MapBufferTest, testMapBufferExtension) {
|
|
|
38
38
|
|
|
39
39
|
auto map = buffer.build();
|
|
40
40
|
|
|
41
|
-
EXPECT_EQ(map.
|
|
41
|
+
EXPECT_EQ(map.count(), 4);
|
|
42
42
|
|
|
43
43
|
EXPECT_EQ(map.getInt(0), 1234);
|
|
44
44
|
EXPECT_EQ(map.getInt(1), 4321);
|
|
@@ -54,28 +54,11 @@ TEST(MapBufferTest, testBoolEntries) {
|
|
|
54
54
|
|
|
55
55
|
auto map = buffer.build();
|
|
56
56
|
|
|
57
|
-
EXPECT_EQ(map.
|
|
57
|
+
EXPECT_EQ(map.count(), 2);
|
|
58
58
|
EXPECT_EQ(map.getBool(0), true);
|
|
59
59
|
EXPECT_EQ(map.getBool(1), false);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
TEST(MapBufferTest, testNullEntries) {
|
|
63
|
-
auto buffer = MapBufferBuilder();
|
|
64
|
-
|
|
65
|
-
buffer.putNull(0);
|
|
66
|
-
buffer.putInt(1, 1234);
|
|
67
|
-
|
|
68
|
-
auto map = buffer.build();
|
|
69
|
-
|
|
70
|
-
EXPECT_EQ(map.getCount(), 2);
|
|
71
|
-
EXPECT_EQ(map.isNull(0), true);
|
|
72
|
-
EXPECT_EQ(map.isNull(1), false);
|
|
73
|
-
// TODO T83483191: serialize null values to be distinguishable from '0'
|
|
74
|
-
// values
|
|
75
|
-
// EXPECT_EQ(map.isNull(1), false);
|
|
76
|
-
// EXPECT_EQ(map.getBool(1), false);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
62
|
TEST(MapBufferTest, testDoubleEntries) {
|
|
80
63
|
auto buffer = MapBufferBuilder();
|
|
81
64
|
|
|
@@ -84,7 +67,7 @@ TEST(MapBufferTest, testDoubleEntries) {
|
|
|
84
67
|
|
|
85
68
|
auto map = buffer.build();
|
|
86
69
|
|
|
87
|
-
EXPECT_EQ(map.
|
|
70
|
+
EXPECT_EQ(map.count(), 2);
|
|
88
71
|
|
|
89
72
|
EXPECT_EQ(map.getDouble(0), 123.4);
|
|
90
73
|
EXPECT_EQ(map.getDouble(1), 432.1);
|
|
@@ -108,6 +91,18 @@ TEST(MapBufferTest, testUTFStringEntry) {
|
|
|
108
91
|
EXPECT_EQ(map.getString(0), "Let's count: 的, 一, 是");
|
|
109
92
|
}
|
|
110
93
|
|
|
94
|
+
TEST(MapBufferTest, testEmojiStringEntry) {
|
|
95
|
+
auto builder = MapBufferBuilder();
|
|
96
|
+
|
|
97
|
+
builder.putString(
|
|
98
|
+
0, "Let's count: 1️⃣, 2️⃣, 3️⃣, 🤦🏿♀️");
|
|
99
|
+
auto map = builder.build();
|
|
100
|
+
|
|
101
|
+
EXPECT_EQ(
|
|
102
|
+
map.getString(0),
|
|
103
|
+
"Let's count: 1️⃣, 2️⃣, 3️⃣, 🤦🏿♀️");
|
|
104
|
+
}
|
|
105
|
+
|
|
111
106
|
TEST(MapBufferTest, testUTFStringEntries) {
|
|
112
107
|
auto builder = MapBufferBuilder();
|
|
113
108
|
|
|
@@ -122,12 +117,12 @@ TEST(MapBufferTest, testUTFStringEntries) {
|
|
|
122
117
|
TEST(MapBufferTest, testEmptyMap) {
|
|
123
118
|
auto builder = MapBufferBuilder();
|
|
124
119
|
auto map = builder.build();
|
|
125
|
-
EXPECT_EQ(map.
|
|
120
|
+
EXPECT_EQ(map.count(), 0);
|
|
126
121
|
}
|
|
127
122
|
|
|
128
123
|
TEST(MapBufferTest, testEmptyMapConstant) {
|
|
129
124
|
auto map = MapBufferBuilder::EMPTY();
|
|
130
|
-
EXPECT_EQ(map.
|
|
125
|
+
EXPECT_EQ(map.count(), 0);
|
|
131
126
|
}
|
|
132
127
|
|
|
133
128
|
TEST(MapBufferTest, testMapEntries) {
|
|
@@ -136,7 +131,7 @@ TEST(MapBufferTest, testMapEntries) {
|
|
|
136
131
|
builder.putInt(1, 1234);
|
|
137
132
|
auto map = builder.build();
|
|
138
133
|
|
|
139
|
-
EXPECT_EQ(map.
|
|
134
|
+
EXPECT_EQ(map.count(), 2);
|
|
140
135
|
EXPECT_EQ(map.getString(0), "This is a test");
|
|
141
136
|
EXPECT_EQ(map.getInt(1), 1234);
|
|
142
137
|
|
|
@@ -145,12 +140,27 @@ TEST(MapBufferTest, testMapEntries) {
|
|
|
145
140
|
builder2.putMapBuffer(1, map);
|
|
146
141
|
auto map2 = builder2.build();
|
|
147
142
|
|
|
148
|
-
EXPECT_EQ(map2.
|
|
143
|
+
EXPECT_EQ(map2.count(), 2);
|
|
149
144
|
EXPECT_EQ(map2.getInt(0), 4321);
|
|
150
145
|
|
|
151
146
|
MapBuffer readMap2 = map2.getMapBuffer(1);
|
|
152
147
|
|
|
153
|
-
EXPECT_EQ(readMap2.
|
|
148
|
+
EXPECT_EQ(readMap2.count(), 2);
|
|
154
149
|
EXPECT_EQ(readMap2.getString(0), "This is a test");
|
|
155
150
|
EXPECT_EQ(readMap2.getInt(1), 1234);
|
|
156
151
|
}
|
|
152
|
+
|
|
153
|
+
TEST(MapBufferTest, testMapRandomAccess) {
|
|
154
|
+
auto builder = MapBufferBuilder();
|
|
155
|
+
builder.putInt(1234, 4321);
|
|
156
|
+
builder.putString(0, "This is a test");
|
|
157
|
+
builder.putDouble(8, 908.1);
|
|
158
|
+
builder.putString(65535, "Let's count: 的, 一, 是");
|
|
159
|
+
auto map = builder.build();
|
|
160
|
+
|
|
161
|
+
EXPECT_EQ(map.count(), 4);
|
|
162
|
+
EXPECT_EQ(map.getString(0), "This is a test");
|
|
163
|
+
EXPECT_EQ(map.getDouble(8), 908.1);
|
|
164
|
+
EXPECT_EQ(map.getInt(1234), 4321);
|
|
165
|
+
EXPECT_EQ(map.getString(65535), "Let's count: 的, 一, 是");
|
|
166
|
+
}
|
|
@@ -75,11 +75,11 @@ void MountingCoordinator::resetLatestRevision() const {
|
|
|
75
75
|
lastRevision_.reset();
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
std::optional<MountingTransaction> MountingCoordinator::pullTransaction()
|
|
79
79
|
const {
|
|
80
80
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
81
81
|
|
|
82
|
-
auto transaction =
|
|
82
|
+
auto transaction = std::optional<MountingTransaction>{};
|
|
83
83
|
|
|
84
84
|
// Base case
|
|
85
85
|
if (lastRevision_.has_value()) {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <butter/optional.h>
|
|
11
10
|
#include <chrono>
|
|
11
|
+
#include <optional>
|
|
12
12
|
|
|
13
13
|
#include <react/renderer/debug/flags.h>
|
|
14
14
|
#include <react/renderer/mounting/Differentiator.h>
|
|
@@ -56,7 +56,7 @@ class MountingCoordinator final {
|
|
|
56
56
|
* However, a consumer should always call it on the same thread (e.g. on the
|
|
57
57
|
* main thread) or ensure sequentiality of mount transactions separately.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
std::optional<MountingTransaction> pullTransaction() const;
|
|
60
60
|
|
|
61
61
|
/*
|
|
62
62
|
* Blocks the current thread until a new mounting transaction is available or
|
|
@@ -104,7 +104,7 @@ class MountingCoordinator final {
|
|
|
104
104
|
|
|
105
105
|
mutable std::mutex mutex_;
|
|
106
106
|
mutable ShadowTreeRevision baseRevision_;
|
|
107
|
-
mutable
|
|
107
|
+
mutable std::optional<ShadowTreeRevision> lastRevision_{};
|
|
108
108
|
mutable MountingTransaction::Number number_{0};
|
|
109
109
|
mutable std::condition_variable signal_;
|
|
110
110
|
mutable std::weak_ptr<MountingOverrideDelegate const>
|
|
@@ -36,7 +36,7 @@ class MountingOverrideDelegate {
|
|
|
36
36
|
* @param mountingCoordinator
|
|
37
37
|
* @return
|
|
38
38
|
*/
|
|
39
|
-
virtual
|
|
39
|
+
virtual std::optional<MountingTransaction> pullTransaction(
|
|
40
40
|
SurfaceId surfaceId,
|
|
41
41
|
MountingTransaction::Number number,
|
|
42
42
|
TransactionTelemetry const &telemetry,
|
|
@@ -250,7 +250,7 @@ void StubViewTree::mutate(ShadowViewMutationList const &mutations) {
|
|
|
250
250
|
|
|
251
251
|
// For iOS especially: flush logs because some might be lost on iOS if an
|
|
252
252
|
// assert is hit right after this.
|
|
253
|
-
google::FlushLogFiles(google::
|
|
253
|
+
google::FlushLogFiles(google::GLOG_INFO);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
bool operator==(StubViewTree const &lhs, StubViewTree const &rhs) {
|
|
@@ -17,10 +17,9 @@ TelemetryController::TelemetryController(
|
|
|
17
17
|
: mountingCoordinator_(mountingCoordinator) {}
|
|
18
18
|
|
|
19
19
|
bool TelemetryController::pullTransaction(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const {
|
|
20
|
+
MountingTransactionCallback const &willMount,
|
|
21
|
+
MountingTransactionCallback const &doMount,
|
|
22
|
+
MountingTransactionCallback const &didMount) const {
|
|
24
23
|
auto optional = mountingCoordinator_.pullTransaction();
|
|
25
24
|
if (!optional.has_value()) {
|
|
26
25
|
return false;
|
|
@@ -28,8 +27,6 @@ bool TelemetryController::pullTransaction(
|
|
|
28
27
|
|
|
29
28
|
auto transaction = std::move(*optional);
|
|
30
29
|
|
|
31
|
-
auto surfaceId = transaction.getSurfaceId();
|
|
32
|
-
auto number = transaction.getNumber();
|
|
33
30
|
auto telemetry = transaction.getTelemetry();
|
|
34
31
|
auto numberOfMutations = static_cast<int>(transaction.getMutations().size());
|
|
35
32
|
|
|
@@ -37,15 +34,15 @@ bool TelemetryController::pullTransaction(
|
|
|
37
34
|
auto compoundTelemetry = compoundTelemetry_;
|
|
38
35
|
mutex_.unlock();
|
|
39
36
|
|
|
40
|
-
willMount(
|
|
37
|
+
willMount(transaction, compoundTelemetry);
|
|
41
38
|
|
|
42
39
|
telemetry.willMount();
|
|
43
|
-
doMount(transaction
|
|
40
|
+
doMount(transaction, compoundTelemetry);
|
|
44
41
|
telemetry.didMount();
|
|
45
42
|
|
|
46
43
|
compoundTelemetry.incorporate(telemetry, numberOfMutations);
|
|
47
44
|
|
|
48
|
-
didMount(
|
|
45
|
+
didMount(transaction, compoundTelemetry);
|
|
49
46
|
|
|
50
47
|
mutex_.lock();
|
|
51
48
|
compoundTelemetry_ = compoundTelemetry;
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
#include <mutex>
|
|
12
12
|
|
|
13
13
|
#include <react/renderer/mounting/MountingTransaction.h>
|
|
14
|
-
#include <react/renderer/mounting/MountingTransactionMetadata.h>
|
|
15
14
|
#include <react/renderer/telemetry/TransactionTelemetry.h>
|
|
16
15
|
|
|
17
16
|
namespace facebook {
|
|
@@ -19,6 +18,10 @@ namespace react {
|
|
|
19
18
|
|
|
20
19
|
class MountingCoordinator;
|
|
21
20
|
|
|
21
|
+
using MountingTransactionCallback = std::function<void(
|
|
22
|
+
MountingTransaction const &transaction,
|
|
23
|
+
SurfaceTelemetry const &surfaceTelemetry)>;
|
|
24
|
+
|
|
22
25
|
/*
|
|
23
26
|
* Provides convenient tools for aggregating and accessing telemetry data
|
|
24
27
|
* associated with running Surface.
|
|
@@ -43,12 +46,9 @@ class TelemetryController final {
|
|
|
43
46
|
* Calls `MountingCoordinator::pullTransaction()` and aggregates telemetry.
|
|
44
47
|
*/
|
|
45
48
|
bool pullTransaction(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
&doMount,
|
|
50
|
-
std::function<void(MountingTransactionMetadata metadata)> const &didMount)
|
|
51
|
-
const;
|
|
49
|
+
MountingTransactionCallback const &willMount,
|
|
50
|
+
MountingTransactionCallback const &doMount,
|
|
51
|
+
MountingTransactionCallback const &didMount) const;
|
|
52
52
|
|
|
53
53
|
private:
|
|
54
54
|
MountingCoordinator const &mountingCoordinator_;
|
|
@@ -22,19 +22,14 @@ RuntimeScheduler::RuntimeScheduler(
|
|
|
22
22
|
|
|
23
23
|
void RuntimeScheduler::scheduleWork(
|
|
24
24
|
std::function<void(jsi::Runtime &)> callback) const {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
runtimeExecutor_([callback = std::move(callback)](jsi::Runtime &runtime) {
|
|
35
|
-
callback(runtime);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
25
|
+
runtimeAccessRequests_ += 1;
|
|
26
|
+
|
|
27
|
+
runtimeExecutor_(
|
|
28
|
+
[this, callback = std::move(callback)](jsi::Runtime &runtime) {
|
|
29
|
+
runtimeAccessRequests_ -= 1;
|
|
30
|
+
callback(runtime);
|
|
31
|
+
startWorkLoop(runtime);
|
|
32
|
+
});
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
std::shared_ptr<Task> RuntimeScheduler::scheduleTask(
|
|
@@ -58,8 +53,8 @@ bool RuntimeScheduler::getIsSynchronous() const noexcept {
|
|
|
58
53
|
return isSynchronous_;
|
|
59
54
|
}
|
|
60
55
|
|
|
61
|
-
void RuntimeScheduler::cancelTask(
|
|
62
|
-
task
|
|
56
|
+
void RuntimeScheduler::cancelTask(Task &task) noexcept {
|
|
57
|
+
task.callback.reset();
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
SchedulerPriority RuntimeScheduler::getCurrentPriorityLevel() const noexcept {
|
|
@@ -70,10 +65,6 @@ RuntimeSchedulerTimePoint RuntimeScheduler::now() const noexcept {
|
|
|
70
65
|
return now_();
|
|
71
66
|
}
|
|
72
67
|
|
|
73
|
-
void RuntimeScheduler::setEnableYielding(bool enableYielding) {
|
|
74
|
-
enableYielding_ = enableYielding;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
68
|
void RuntimeScheduler::executeNowOnTheSameThread(
|
|
78
69
|
std::function<void(jsi::Runtime &runtime)> callback) {
|
|
79
70
|
shouldYield_ = true;
|
|
@@ -57,18 +57,45 @@ class RuntimeScheduler final {
|
|
|
57
57
|
SchedulerPriority priority,
|
|
58
58
|
jsi::Function callback);
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
/*
|
|
61
|
+
* Cancelled task will never be executed.
|
|
62
|
+
*
|
|
63
|
+
* Operates on JSI object.
|
|
64
|
+
* Thread synchronization must be enforced externally.
|
|
65
|
+
*/
|
|
66
|
+
void cancelTask(Task &task) noexcept;
|
|
61
67
|
|
|
68
|
+
/*
|
|
69
|
+
* Return value indicates if host platform has a pending access to the
|
|
70
|
+
* runtime.
|
|
71
|
+
*
|
|
72
|
+
* Can be called from any thread.
|
|
73
|
+
*/
|
|
62
74
|
bool getShouldYield() const noexcept;
|
|
63
75
|
|
|
76
|
+
/*
|
|
77
|
+
* Return value informs if the current task is executed inside synchronous
|
|
78
|
+
* block.
|
|
79
|
+
*
|
|
80
|
+
* Can be called from any thread.
|
|
81
|
+
*/
|
|
64
82
|
bool getIsSynchronous() const noexcept;
|
|
65
83
|
|
|
84
|
+
/*
|
|
85
|
+
* Returns value of currently executed task. Designed to be called from React.
|
|
86
|
+
*
|
|
87
|
+
* Thread synchronization must be enforced externally.
|
|
88
|
+
*/
|
|
66
89
|
SchedulerPriority getCurrentPriorityLevel() const noexcept;
|
|
67
90
|
|
|
91
|
+
/*
|
|
92
|
+
* Returns current monotonic time. This time is not related to wall clock
|
|
93
|
+
* time.
|
|
94
|
+
*
|
|
95
|
+
* Thread synchronization must be enforced externally.
|
|
96
|
+
*/
|
|
68
97
|
RuntimeSchedulerTimePoint now() const noexcept;
|
|
69
98
|
|
|
70
|
-
void setEnableYielding(bool enableYielding);
|
|
71
|
-
|
|
72
99
|
private:
|
|
73
100
|
mutable std::priority_queue<
|
|
74
101
|
std::shared_ptr<Task>,
|
|
@@ -79,6 +106,12 @@ class RuntimeScheduler final {
|
|
|
79
106
|
RuntimeExecutor const runtimeExecutor_;
|
|
80
107
|
mutable SchedulerPriority currentPriority_{SchedulerPriority::NormalPriority};
|
|
81
108
|
mutable std::atomic_bool shouldYield_{false};
|
|
109
|
+
|
|
110
|
+
/*
|
|
111
|
+
* Counter indicating how many access to the runtime have been requested.
|
|
112
|
+
*/
|
|
113
|
+
mutable std::atomic<uint_fast8_t> runtimeAccessRequests_{0};
|
|
114
|
+
|
|
82
115
|
mutable std::atomic_bool isSynchronous_{false};
|
|
83
116
|
|
|
84
117
|
void startWorkLoop(jsi::Runtime &runtime) const;
|
|
@@ -101,15 +134,6 @@ class RuntimeScheduler final {
|
|
|
101
134
|
*/
|
|
102
135
|
mutable std::atomic_bool isWorkLoopScheduled_{false};
|
|
103
136
|
|
|
104
|
-
/*
|
|
105
|
-
* Flag indicating if yielding is enabled.
|
|
106
|
-
*
|
|
107
|
-
* If set to true and Concurrent Mode is enabled on the surface,
|
|
108
|
-
* React Native will ask React to yield in case any work has been scheduled.
|
|
109
|
-
* Default value is false
|
|
110
|
-
*/
|
|
111
|
-
bool enableYielding_{false};
|
|
112
|
-
|
|
113
137
|
/*
|
|
114
138
|
* This flag is set while performing work, to prevent re-entrancy.
|
|
115
139
|
*/
|
|
@@ -117,4 +141,4 @@ class RuntimeScheduler final {
|
|
|
117
141
|
};
|
|
118
142
|
|
|
119
143
|
} // namespace react
|
|
120
|
-
} // namespace facebook
|
|
144
|
+
} // namespace facebook
|
|
@@ -100,7 +100,7 @@ jsi::Value RuntimeSchedulerBinding::get(
|
|
|
100
100
|
jsi::Value const &,
|
|
101
101
|
jsi::Value const *arguments,
|
|
102
102
|
size_t) noexcept -> jsi::Value {
|
|
103
|
-
runtimeScheduler_->cancelTask(taskFromValue(runtime, arguments[0]));
|
|
103
|
+
runtimeScheduler_->cancelTask(*taskFromValue(runtime, arguments[0]));
|
|
104
104
|
return jsi::Value::undefined();
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <butter/optional.h>
|
|
11
10
|
#include <jsi/jsi.h>
|
|
12
11
|
#include <react/renderer/runtimescheduler/RuntimeSchedulerClock.h>
|
|
13
12
|
#include <react/renderer/runtimescheduler/SchedulerPriority.h>
|
|
14
13
|
|
|
14
|
+
#include <optional>
|
|
15
|
+
|
|
15
16
|
namespace facebook {
|
|
16
17
|
namespace react {
|
|
17
18
|
|
|
@@ -29,7 +30,7 @@ struct Task final {
|
|
|
29
30
|
friend TaskPriorityComparer;
|
|
30
31
|
|
|
31
32
|
SchedulerPriority priority;
|
|
32
|
-
|
|
33
|
+
std::optional<jsi::Function> callback;
|
|
33
34
|
RuntimeSchedulerClock::time_point expirationTime;
|
|
34
35
|
|
|
35
36
|
jsi::Value execute(jsi::Runtime &runtime);
|
|
@@ -159,7 +159,7 @@ TEST_F(RuntimeSchedulerTest, taskExpiration) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) {
|
|
162
|
-
uint firstTaskCallOrder;
|
|
162
|
+
uint firstTaskCallOrder = 0;
|
|
163
163
|
auto callbackOne =
|
|
164
164
|
createHostFunctionFromLambda([this, &firstTaskCallOrder](bool) {
|
|
165
165
|
firstTaskCallOrder = hostFunctionCallCount_;
|
|
@@ -192,7 +192,7 @@ TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
TEST_F(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) {
|
|
195
|
-
uint lowPriorityTaskCallOrder;
|
|
195
|
+
uint lowPriorityTaskCallOrder = 0;
|
|
196
196
|
auto callbackOne =
|
|
197
197
|
createHostFunctionFromLambda([this, &lowPriorityTaskCallOrder](bool) {
|
|
198
198
|
lowPriorityTaskCallOrder = hostFunctionCallCount_;
|
|
@@ -237,7 +237,7 @@ TEST_F(RuntimeSchedulerTest, cancelTask) {
|
|
|
237
237
|
EXPECT_FALSE(didRunTask);
|
|
238
238
|
EXPECT_EQ(stubQueue_->size(), 1);
|
|
239
239
|
|
|
240
|
-
runtimeScheduler_->cancelTask(task);
|
|
240
|
+
runtimeScheduler_->cancelTask(*task);
|
|
241
241
|
|
|
242
242
|
stubQueue_->tick();
|
|
243
243
|
|
|
@@ -323,7 +323,7 @@ TEST_F(RuntimeSchedulerTest, scheduleWork) {
|
|
|
323
323
|
|
|
324
324
|
EXPECT_FALSE(wasCalled);
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
EXPECT_TRUE(runtimeScheduler_->getShouldYield());
|
|
327
327
|
|
|
328
328
|
EXPECT_EQ(stubQueue_->size(), 1);
|
|
329
329
|
|
|
@@ -334,7 +334,6 @@ TEST_F(RuntimeSchedulerTest, scheduleWork) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
TEST_F(RuntimeSchedulerTest, scheduleWorkWithYielding) {
|
|
337
|
-
runtimeScheduler_->setEnableYielding(true);
|
|
338
337
|
bool wasCalled = false;
|
|
339
338
|
runtimeScheduler_->scheduleWork(
|
|
340
339
|
[&](jsi::Runtime const &) { wasCalled = true; });
|
|
@@ -353,8 +352,6 @@ TEST_F(RuntimeSchedulerTest, scheduleWorkWithYielding) {
|
|
|
353
352
|
}
|
|
354
353
|
|
|
355
354
|
TEST_F(RuntimeSchedulerTest, normalTaskYieldsToPlatformEvent) {
|
|
356
|
-
runtimeScheduler_->setEnableYielding(true);
|
|
357
|
-
|
|
358
355
|
bool didRunJavaScriptTask = false;
|
|
359
356
|
bool didRunPlatformWork = false;
|
|
360
357
|
|
|
@@ -382,8 +379,6 @@ TEST_F(RuntimeSchedulerTest, normalTaskYieldsToPlatformEvent) {
|
|
|
382
379
|
}
|
|
383
380
|
|
|
384
381
|
TEST_F(RuntimeSchedulerTest, expiredTaskDoesntYieldToPlatformEvent) {
|
|
385
|
-
runtimeScheduler_->setEnableYielding(true);
|
|
386
|
-
|
|
387
382
|
bool didRunJavaScriptTask = false;
|
|
388
383
|
bool didRunPlatformWork = false;
|
|
389
384
|
|
|
@@ -412,8 +407,6 @@ TEST_F(RuntimeSchedulerTest, expiredTaskDoesntYieldToPlatformEvent) {
|
|
|
412
407
|
}
|
|
413
408
|
|
|
414
409
|
TEST_F(RuntimeSchedulerTest, immediateTaskDoesntYieldToPlatformEvent) {
|
|
415
|
-
runtimeScheduler_->setEnableYielding(true);
|
|
416
|
-
|
|
417
410
|
bool didRunJavaScriptTask = false;
|
|
418
411
|
bool didRunPlatformWork = false;
|
|
419
412
|
|
|
@@ -42,8 +42,7 @@ Scheduler::Scheduler(
|
|
|
42
42
|
"ReactNativeConfig");
|
|
43
43
|
|
|
44
44
|
// Creating a container for future `EventDispatcher` instance.
|
|
45
|
-
eventDispatcher_ =
|
|
46
|
-
std::make_shared<butter::optional<EventDispatcher const>>();
|
|
45
|
+
eventDispatcher_ = std::make_shared<std::optional<EventDispatcher const>>();
|
|
47
46
|
|
|
48
47
|
auto uiManager = std::make_shared<UIManager>(
|
|
49
48
|
runtimeExecutor_, schedulerToolbox.backgroundExecutor, contextContainer_);
|
|
@@ -351,5 +350,23 @@ ContextContainer::Shared Scheduler::getContextContainer() const {
|
|
|
351
350
|
return contextContainer_;
|
|
352
351
|
}
|
|
353
352
|
|
|
353
|
+
std::shared_ptr<UIManager> Scheduler::getUIManager() const {
|
|
354
|
+
return uiManager_;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
void Scheduler::addEventListener(
|
|
358
|
+
const std::shared_ptr<EventListener const> &listener) {
|
|
359
|
+
if (eventDispatcher_->has_value()) {
|
|
360
|
+
eventDispatcher_->value().addListener(listener);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
void Scheduler::removeEventListener(
|
|
365
|
+
const std::shared_ptr<EventListener const> &listener) {
|
|
366
|
+
if (eventDispatcher_->has_value()) {
|
|
367
|
+
eventDispatcher_->value().removeListener(listener);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
354
371
|
} // namespace react
|
|
355
372
|
} // namespace facebook
|