react-native-windows 0.75.4 → 0.76.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +6 -4
- package/Directory.Build.props +4 -0
- package/Directory.Build.targets +5 -0
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
- package/Libraries/Animated/animations/Animation.js +11 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -1
- package/Libraries/Animated/animations/SpringAnimation.js +1 -1
- package/Libraries/Animated/animations/TimingAnimation.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +10 -9
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
- package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
- package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
- package/Libraries/Animated/useAnimatedProps.js +142 -7
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/Button.windows.js +0 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -0
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +131 -169
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +230 -94
- package/Libraries/Components/TextInput/TextInput.windows.js +230 -105
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +23 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +32 -30
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +3 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +4 -4
- package/Libraries/Core/setUpDeveloperTools.js +5 -1
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/AssetSourceResolver.windows.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.windows.js +11 -22
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Inspector/Inspector.js +3 -2
- package/Libraries/Inspector/InspectorPanel.js +16 -10
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +3 -3
- package/Libraries/LogBox/Data/LogBoxData.js +24 -3
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +9 -8
- package/Libraries/Modal/Modal.js +0 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +17 -1
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +17 -1
- package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +1 -2
- package/Libraries/ReactNative/AppRegistry.d.ts +0 -4
- package/Libraries/ReactNative/AppRegistry.js +1 -7
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +26 -4
- package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
- package/Libraries/ReactNative/renderApplication.js +1 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +152 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
- package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
- package/Libraries/StyleSheet/processBoxShadow.js +209 -0
- package/Libraries/StyleSheet/processFilter.js +231 -42
- package/Libraries/Text/Text.js +394 -196
- package/Libraries/Text/Text.windows.js +476 -300
- package/Libraries/Text/TextNativeComponent.js +2 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/Appearance.js +108 -84
- package/Libraries/Utilities/DevLoadingView.js +2 -4
- package/Libraries/Utilities/HMRClient.js +8 -6
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +0 -9
- package/Libraries/Utilities/stringifyViewConfig.js +22 -0
- package/Libraries/Utilities/useColorScheme.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +6 -5
- package/Microsoft.ReactNative/ComponentView.idl +11 -0
- package/Microsoft.ReactNative/Composition.Input.idl +1 -0
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +7 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.h +5 -6
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +42 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +81 -63
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +8 -6
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +72 -54
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +14 -4
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +26 -8
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -7
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +6 -6
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +97 -140
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +18 -11
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +5 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +29 -4
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +28 -12
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +33 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +26 -9
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +10 -4
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +5 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.h +1 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +9 -0
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +3 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +3 -3
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +121 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +90 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +5 -1
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +45 -0
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -1
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +25 -16
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -4
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +2 -2
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +62 -4
- package/Microsoft.ReactNative.Cxx/NativeModules.h +131 -14
- package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +10 -2
- package/PropertySheets/Autolink.props +1 -1
- package/PropertySheets/Bundle.props +1 -1
- package/PropertySheets/Codegen.props +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/NuGet.LockFile.props +18 -0
- package/README.md +29 -29
- package/ReactCommon/ReactCommon.vcxproj +5 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +11 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -7
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +441 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +266 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +56 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +3 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Convert.h +172 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +4 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +363 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +22 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +118 -51
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +8 -1
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -2
- package/Shared/Modules/WebSocketModule.cpp +1 -2
- package/Shared/Networking/WinRTWebSocketResource.cpp +4 -1
- package/Shared/Shared.vcxitems +38 -2
- package/Shared/Shared.vcxitems.filters +6 -1
- package/Shared/TurboModuleManager.cpp +0 -3
- package/codegen/NativeLinkingManagerSpec.g.h +3 -3
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +198 -54
- package/codegen/NativeSampleTurboModuleSpec.g.h +35 -0
- package/codegen/rnwcoreJSI-generated.cpp +245 -101
- package/codegen/rnwcoreJSI.h +847 -548
- package/index.js +3 -1
- package/index.windows.js +3 -1
- package/jest/mockComponent.js +4 -1
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -13
- package/package.json +34 -30
- package/src/private/animated/NativeAnimatedHelper.js +438 -0
- package/src/private/animated/NativeAnimatedValidation.js +64 -0
- package/src/private/components/HScrollViewNativeComponents.js +56 -0
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +29 -0
- package/src/private/components/VScrollViewNativeComponents.js +48 -0
- package/src/private/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
- package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeAppearance.js +3 -3
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWindows.js +7 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.h +1 -1
- package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
- package/template/index.windows.bundle +1 -1
- package/template/metro.config.js +2 -2
- package/template/shared-app/src/AutolinkedNativeModules.g.props +1 -1
- package/template/shared-app/src/AutolinkedNativeModules.g.targets +1 -1
- package/templates/cpp-app/metro.config.js +2 -2
- package/templates/cpp-app/template.config.js +5 -5
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +1 -1
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -0
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
- package/templates/cpp-lib/example/metro.config.js +2 -2
- package/templates/cpp-lib/template.config.js +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.h +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
- package/types/experimental.d.ts +12 -98
- package/Common/packages.lock.json +0 -26
- package/Folly/packages.lock.json +0 -23
- package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
- package/Microsoft.ReactNative/packages.lock.json +0 -132
- package/Microsoft.ReactNative.Managed/packages.lock.json +0 -373
- package/Microsoft.ReactNative.Managed.CodeGen/packages.lock.json +0 -3197
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2396
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -136
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +0 -48
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +0 -122
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +0 -388
- package/ReactCommon/packages.lock.json +0 -30
- package/fmt/packages.lock.json +0 -13
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @flow strict
|
|
8
|
-
* @generated by scripts/releases/set-
|
|
8
|
+
* @generated by scripts/releases/set-version.js
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
const version: $ReadOnly<{
|
|
@@ -15,9 +15,9 @@ const version: $ReadOnly<{
|
|
|
15
15
|
prerelease: string | null,
|
|
16
16
|
}> = {
|
|
17
17
|
major: 0,
|
|
18
|
-
minor:
|
|
19
|
-
patch:
|
|
20
|
-
prerelease:
|
|
18
|
+
minor: 76,
|
|
19
|
+
patch: 0,
|
|
20
|
+
prerelease: 'rc.4',
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
module.exports = {version};
|
|
@@ -42,9 +42,13 @@ if (__DEV__) {
|
|
|
42
42
|
if (!Platform.isTesting) {
|
|
43
43
|
const HMRClient = require('../Utilities/HMRClient');
|
|
44
44
|
|
|
45
|
+
// [0.76 only] When under React Native DevTools, log "JavaScript logs will
|
|
46
|
+
// be removed from Metro..." warning, and continue to forward logs.
|
|
45
47
|
if (global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
|
|
46
48
|
HMRClient.unstable_notifyFuseboxConsoleEnabled();
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (console._isPolyfilled) {
|
|
48
52
|
// We assume full control over the console and send JavaScript logs to Metro.
|
|
49
53
|
[
|
|
50
54
|
'trace',
|
|
@@ -21,7 +21,13 @@ ExceptionsManager.installConsoleErrorReporter();
|
|
|
21
21
|
if (!global.__fbDisableExceptionsManager) {
|
|
22
22
|
const handleError = (e: mixed, isFatal: boolean) => {
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
// TODO(T196834299): We should really use a c++ turbomodule for this
|
|
25
|
+
if (
|
|
26
|
+
!global.RN$handleException ||
|
|
27
|
+
!global.RN$handleException(e, isFatal)
|
|
28
|
+
) {
|
|
29
|
+
ExceptionsManager.handleException(e, isFatal);
|
|
30
|
+
}
|
|
25
31
|
} catch (ee) {
|
|
26
32
|
console.log('Failed to print error: ', ee.message);
|
|
27
33
|
throw e;
|
|
@@ -36,10 +36,6 @@ if (__DEV__) {
|
|
|
36
36
|
register: ReactRefreshRuntime.register,
|
|
37
37
|
|
|
38
38
|
performReactRefresh() {
|
|
39
|
-
if (ReactRefreshRuntime.hasUnrecoverableErrors()) {
|
|
40
|
-
DevSettings.reload('Fast Refresh - Unrecoverable');
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
39
|
ReactRefreshRuntime.performReactRefresh();
|
|
44
40
|
DevSettings.onFastRefresh();
|
|
45
41
|
},
|
|
@@ -18,7 +18,10 @@ export type ResolvedAssetSource = {|
|
|
|
18
18
|
+scale: number,
|
|
19
19
|
|};
|
|
20
20
|
|
|
21
|
-
import type {
|
|
21
|
+
import type {
|
|
22
|
+
AssetDestPathResolver,
|
|
23
|
+
PackagerAsset,
|
|
24
|
+
} from '@react-native/assets-registry/registry';
|
|
22
25
|
|
|
23
26
|
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
24
27
|
const Platform = require('../Utilities/Platform');
|
|
@@ -76,6 +79,10 @@ class AssetSourceResolver {
|
|
|
76
79
|
return this.assetServerURL();
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
if (this.asset.resolver != null) {
|
|
83
|
+
return this.getAssetUsingResolver(this.asset.resolver);
|
|
84
|
+
}
|
|
85
|
+
|
|
79
86
|
if (Platform.OS === 'android') {
|
|
80
87
|
return this.isLoadedFromFileSystem()
|
|
81
88
|
? this.drawableFolderInBundle()
|
|
@@ -85,6 +92,26 @@ class AssetSourceResolver {
|
|
|
85
92
|
}
|
|
86
93
|
}
|
|
87
94
|
|
|
95
|
+
getAssetUsingResolver(resolver: AssetDestPathResolver): ResolvedAssetSource {
|
|
96
|
+
switch (resolver) {
|
|
97
|
+
case 'android':
|
|
98
|
+
return this.isLoadedFromFileSystem()
|
|
99
|
+
? this.drawableFolderInBundle()
|
|
100
|
+
: this.resourceIdentifierWithoutScale();
|
|
101
|
+
case 'generic':
|
|
102
|
+
return this.scaledAssetURLNearBundle();
|
|
103
|
+
default:
|
|
104
|
+
throw new Error(
|
|
105
|
+
"Don't know how to get asset via provided resolver: " +
|
|
106
|
+
resolver +
|
|
107
|
+
'\nAsset: ' +
|
|
108
|
+
JSON.stringify(this.asset, null, '\t') +
|
|
109
|
+
'\nPossible resolvers are:' +
|
|
110
|
+
JSON.stringify(['android', 'generic'], null, '\t'),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
88
115
|
/**
|
|
89
116
|
* Returns an absolute URL which can be used to fetch the asset
|
|
90
117
|
* from the devserver
|
|
@@ -18,7 +18,10 @@ export type ResolvedAssetSource = {|
|
|
|
18
18
|
+scale: number,
|
|
19
19
|
|};
|
|
20
20
|
|
|
21
|
-
import type {
|
|
21
|
+
import type {
|
|
22
|
+
AssetDestPathResolver,
|
|
23
|
+
PackagerAsset,
|
|
24
|
+
} from '@react-native/assets-registry/registry';
|
|
22
25
|
|
|
23
26
|
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
24
27
|
const Platform = require('../Utilities/Platform');
|
|
@@ -98,6 +101,10 @@ class AssetSourceResolver {
|
|
|
98
101
|
return this.assetServerURL();
|
|
99
102
|
}
|
|
100
103
|
|
|
104
|
+
if (this.asset.resolver != null) {
|
|
105
|
+
return this.getAssetUsingResolver(this.asset.resolver);
|
|
106
|
+
}
|
|
107
|
+
|
|
101
108
|
if (Platform.OS === 'android') {
|
|
102
109
|
return this.isLoadedFromFileSystem()
|
|
103
110
|
? this.drawableFolderInBundle()
|
|
@@ -107,6 +114,26 @@ class AssetSourceResolver {
|
|
|
107
114
|
}
|
|
108
115
|
}
|
|
109
116
|
|
|
117
|
+
getAssetUsingResolver(resolver: AssetDestPathResolver): ResolvedAssetSource {
|
|
118
|
+
switch (resolver) {
|
|
119
|
+
case 'android':
|
|
120
|
+
return this.isLoadedFromFileSystem()
|
|
121
|
+
? this.drawableFolderInBundle()
|
|
122
|
+
: this.resourceIdentifierWithoutScale();
|
|
123
|
+
case 'generic':
|
|
124
|
+
return this.scaledAssetURLNearBundle();
|
|
125
|
+
default:
|
|
126
|
+
throw new Error(
|
|
127
|
+
"Don't know how to get asset via provided resolver: " +
|
|
128
|
+
resolver +
|
|
129
|
+
'\nAsset: ' +
|
|
130
|
+
JSON.stringify(this.asset, null, '\t') +
|
|
131
|
+
'\nPossible resolvers are:' +
|
|
132
|
+
JSON.stringify(['android', 'generic'], null, '\t'),
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
110
137
|
/**
|
|
111
138
|
* Returns an absolute URL which can be used to fetch the asset
|
|
112
139
|
* from the devserver
|
|
@@ -150,24 +150,20 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
|
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
let style;
|
|
153
|
+
let style: ImageStyleProp;
|
|
154
154
|
let sources;
|
|
155
155
|
if (Array.isArray(source)) {
|
|
156
|
-
style =
|
|
156
|
+
style = [styles.base, props.style];
|
|
157
157
|
sources = source;
|
|
158
158
|
} else {
|
|
159
159
|
const {uri} = source;
|
|
160
|
-
const width = source.width ?? props.width;
|
|
161
|
-
const height = source.height ?? props.height;
|
|
162
|
-
style = flattenStyle<ImageStyleProp>([
|
|
163
|
-
{width, height},
|
|
164
|
-
styles.base,
|
|
165
|
-
props.style,
|
|
166
|
-
]);
|
|
167
|
-
sources = [source];
|
|
168
160
|
if (uri === '') {
|
|
169
161
|
console.warn('source.uri should not be an empty string');
|
|
170
162
|
}
|
|
163
|
+
const width = source.width ?? props.width;
|
|
164
|
+
const height = source.height ?? props.height;
|
|
165
|
+
style = [{width, height}, styles.base, props.style];
|
|
166
|
+
sources = [source];
|
|
171
167
|
}
|
|
172
168
|
|
|
173
169
|
const {height, width, ...restProps} = props;
|
|
@@ -203,11 +199,10 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
|
|
|
203
199
|
},
|
|
204
200
|
};
|
|
205
201
|
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
: null;
|
|
202
|
+
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
|
203
|
+
const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
|
|
209
204
|
const resizeMode =
|
|
210
|
-
objectFit || props.resizeMode ||
|
|
205
|
+
objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
|
|
211
206
|
|
|
212
207
|
const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
|
|
213
208
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
12
|
import type {RootTag} from '../Types/RootTagTypes';
|
|
13
13
|
import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow';
|
|
14
14
|
import type {ImageSize} from './NativeImageLoaderAndroid';
|
|
@@ -112,38 +112,27 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
112
112
|
height: undefined,
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
let style: ImageStyleProp;
|
|
115
116
|
let sources;
|
|
116
|
-
let style: ImageStyle;
|
|
117
|
-
|
|
118
117
|
if (Array.isArray(source)) {
|
|
119
|
-
style =
|
|
120
|
-
flattenStyle<ImageStyleProp>([styles.base, props.style]) ||
|
|
121
|
-
({}: ImageStyle);
|
|
118
|
+
style = [styles.base, props.style];
|
|
122
119
|
sources = source;
|
|
123
120
|
} else {
|
|
124
121
|
const {uri} = source;
|
|
125
|
-
const width = source.width ?? props.width;
|
|
126
|
-
const height = source.height ?? props.height;
|
|
127
|
-
style =
|
|
128
|
-
flattenStyle<ImageStyleProp>([
|
|
129
|
-
{width, height},
|
|
130
|
-
styles.base,
|
|
131
|
-
props.style,
|
|
132
|
-
]) || ({}: ImageStyle);
|
|
133
|
-
sources = [source];
|
|
134
|
-
|
|
135
122
|
if (uri === '') {
|
|
136
123
|
console.warn('source.uri should not be an empty string');
|
|
137
124
|
}
|
|
125
|
+
const width = source.width ?? props.width;
|
|
126
|
+
const height = source.height ?? props.height;
|
|
127
|
+
style = [{width, height}, styles.base, props.style];
|
|
128
|
+
sources = [source];
|
|
138
129
|
}
|
|
139
130
|
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
? convertObjectFitToResizeMode(style.objectFit)
|
|
143
|
-
: null;
|
|
131
|
+
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
|
132
|
+
const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
|
|
144
133
|
const resizeMode =
|
|
145
|
-
objectFit || props.resizeMode ||
|
|
146
|
-
const tintColor = props.tintColor ??
|
|
134
|
+
objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
|
|
135
|
+
const tintColor = props.tintColor ?? flattenedStyle?.tintColor;
|
|
147
136
|
|
|
148
137
|
if (props.children != null) {
|
|
149
138
|
throw new Error(
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
12
|
import type {RootTag} from '../Types/RootTagTypes';
|
|
13
13
|
import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow';
|
|
14
14
|
import type {ImageSize} from './NativeImageLoaderAndroid';
|
|
@@ -114,38 +114,27 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
114
114
|
height: undefined,
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
let style: ImageStyleProp;
|
|
117
118
|
let sources;
|
|
118
|
-
let style: ImageStyle;
|
|
119
|
-
|
|
120
119
|
if (Array.isArray(source)) {
|
|
121
|
-
style =
|
|
122
|
-
flattenStyle<ImageStyleProp>([styles.base, props.style]) ||
|
|
123
|
-
({}: ImageStyle);
|
|
120
|
+
style = [styles.base, props.style];
|
|
124
121
|
sources = source;
|
|
125
122
|
} else {
|
|
126
123
|
const {uri} = source;
|
|
127
|
-
const width = source.width ?? props.width;
|
|
128
|
-
const height = source.height ?? props.height;
|
|
129
|
-
style =
|
|
130
|
-
flattenStyle<ImageStyleProp>([
|
|
131
|
-
{width, height},
|
|
132
|
-
styles.base,
|
|
133
|
-
props.style,
|
|
134
|
-
]) || ({}: ImageStyle);
|
|
135
|
-
sources = [source];
|
|
136
|
-
|
|
137
124
|
if (uri === '') {
|
|
138
125
|
console.warn('source.uri should not be an empty string');
|
|
139
126
|
}
|
|
127
|
+
const width = source.width ?? props.width;
|
|
128
|
+
const height = source.height ?? props.height;
|
|
129
|
+
style = [{width, height}, styles.base, props.style];
|
|
130
|
+
sources = [source];
|
|
140
131
|
}
|
|
141
132
|
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
? convertObjectFitToResizeMode(style.objectFit)
|
|
145
|
-
: null;
|
|
133
|
+
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
|
134
|
+
const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
|
|
146
135
|
const resizeMode =
|
|
147
|
-
objectFit || props.resizeMode ||
|
|
148
|
-
const tintColor = props.tintColor ??
|
|
136
|
+
objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
|
|
137
|
+
const tintColor = props.tintColor ?? flattenedStyle?.tintColor;
|
|
149
138
|
|
|
150
139
|
if (props.children != null) {
|
|
151
140
|
throw new Error(
|
|
@@ -55,14 +55,7 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
|
|
|
55
55
|
|
|
56
56
|
_viewRef: ?React.ElementRef<typeof View> = null;
|
|
57
57
|
|
|
58
|
-
_captureRef = (
|
|
59
|
-
ref: null | React$ElementRef<
|
|
60
|
-
React$AbstractComponent<
|
|
61
|
-
ViewProps,
|
|
62
|
-
React.ElementRef<HostComponent<ViewProps>>,
|
|
63
|
-
>,
|
|
64
|
-
>,
|
|
65
|
-
) => {
|
|
58
|
+
_captureRef = (ref: null | React.ElementRef<HostComponent<ViewProps>>) => {
|
|
66
59
|
this._viewRef = ref;
|
|
67
60
|
};
|
|
68
61
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return objectFitMap[objectFit];
|
|
13
|
+
const objectFitMap: {[string]: ResizeMode} = {
|
|
14
|
+
contain: 'contain',
|
|
15
|
+
cover: 'cover',
|
|
16
|
+
fill: 'stretch',
|
|
17
|
+
'scale-down': 'contain',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
|
|
21
|
+
return objectFit != null ? objectFitMap[objectFit] : undefined;
|
|
22
22
|
}
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
18
18
|
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
19
19
|
import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
|
|
20
|
+
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
20
21
|
|
|
21
22
|
const View = require('../Components/View/View');
|
|
22
23
|
const PressabilityDebug = require('../Pressability/PressabilityDebug');
|
|
@@ -164,7 +165,7 @@ function Inspector({
|
|
|
164
165
|
/>
|
|
165
166
|
)}
|
|
166
167
|
|
|
167
|
-
<
|
|
168
|
+
<SafeAreaView style={[styles.panelContainer, panelContainerStyle]}>
|
|
168
169
|
<InspectorPanel
|
|
169
170
|
devtoolsIsOpen={!!reactDevToolsAgent}
|
|
170
171
|
inspecting={selectedTab === 'elements-inspector'}
|
|
@@ -180,7 +181,7 @@ function Inspector({
|
|
|
180
181
|
networking={selectedTab === 'network-profiling'}
|
|
181
182
|
setNetworking={setNetworking}
|
|
182
183
|
/>
|
|
183
|
-
</
|
|
184
|
+
</SafeAreaView>
|
|
184
185
|
</View>
|
|
185
186
|
);
|
|
186
187
|
}
|
|
@@ -80,16 +80,22 @@ class InspectorPanel extends React.Component<Props> {
|
|
|
80
80
|
pressed={this.props.inspecting}
|
|
81
81
|
onClick={this.props.setInspecting}
|
|
82
82
|
/>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
{global.RN$Bridgeless === true ? null : (
|
|
84
|
+
// These Inspector Panel sub-features are removed under the New Arch.
|
|
85
|
+
// See https://github.com/react-native-community/discussions-and-proposals/pull/777
|
|
86
|
+
<>
|
|
87
|
+
<InspectorPanelButton
|
|
88
|
+
title={'Perf'}
|
|
89
|
+
pressed={this.props.perfing}
|
|
90
|
+
onClick={this.props.setPerfing}
|
|
91
|
+
/>
|
|
92
|
+
<InspectorPanelButton
|
|
93
|
+
title={'Network'}
|
|
94
|
+
pressed={this.props.networking}
|
|
95
|
+
onClick={this.props.setNetworking}
|
|
96
|
+
/>
|
|
97
|
+
</>
|
|
98
|
+
)}
|
|
93
99
|
<InspectorPanelButton
|
|
94
100
|
title={'Touchables'}
|
|
95
101
|
pressed={this.props.touchTargeting}
|
|
@@ -335,7 +335,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
335
335
|
_renderItem = ({
|
|
336
336
|
item,
|
|
337
337
|
index,
|
|
338
|
-
}: RenderItemProps<NetworkRequestInfo>): React.
|
|
338
|
+
}: RenderItemProps<NetworkRequestInfo>): React.MixedElement => {
|
|
339
339
|
const tableRowViewStyle = [
|
|
340
340
|
styles.tableRow,
|
|
341
341
|
index % 2 === 1 ? styles.tableRowOdd : styles.tableRowEven,
|
|
@@ -617,7 +617,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
_renderer = (
|
|
620
|
-
ListItemComponent: ?(React.ComponentType<any> | React.
|
|
620
|
+
ListItemComponent: ?(React.ComponentType<any> | React.MixedElement),
|
|
621
621
|
renderItem: ?RenderItemType<ItemT>,
|
|
622
622
|
columnWrapperStyle: ?ViewStyleProp,
|
|
623
623
|
numColumns: ?number,
|
|
@@ -33,7 +33,7 @@ type RequiredProps<SectionT: SectionBase<any>> = {|
|
|
|
33
33
|
*
|
|
34
34
|
* sections: $ReadOnlyArray<{
|
|
35
35
|
* data: $ReadOnlyArray<SectionItem>,
|
|
36
|
-
* renderItem?: ({item: SectionItem, ...}) => ?React.
|
|
36
|
+
* renderItem?: ({item: SectionItem, ...}) => ?React.MixedElement,
|
|
37
37
|
* ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,
|
|
38
38
|
* }>
|
|
39
39
|
*/
|
|
@@ -55,7 +55,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
|
|
55
55
|
...
|
|
56
56
|
},
|
|
57
57
|
...
|
|
58
|
-
}) => null | React.
|
|
58
|
+
}) => null | React.Node,
|
|
59
59
|
/**
|
|
60
60
|
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
|
|
61
61
|
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
|
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
SectionBase as _SectionBase,
|
|
17
17
|
VirtualizedSectionListProps,
|
|
18
18
|
} from '@react-native/virtualized-lists';
|
|
19
|
-
import type {AbstractComponent,
|
|
19
|
+
import type {AbstractComponent, ElementRef} from 'react';
|
|
20
20
|
|
|
21
21
|
import Platform from '../Utilities/Platform';
|
|
22
22
|
import {VirtualizedSectionList} from '@react-native/virtualized-lists';
|
|
@@ -34,7 +34,7 @@ type RequiredProps<SectionT: SectionBase<any>> = {|
|
|
|
34
34
|
*
|
|
35
35
|
* sections: $ReadOnlyArray<{
|
|
36
36
|
* data: $ReadOnlyArray<SectionItem>,
|
|
37
|
-
* renderItem?: ({item: SectionItem, ...}) => ?React.
|
|
37
|
+
* renderItem?: ({item: SectionItem, ...}) => ?React.MixedElement,
|
|
38
38
|
* ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,
|
|
39
39
|
* }>
|
|
40
40
|
*/
|
|
@@ -56,7 +56,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
|
|
56
56
|
...
|
|
57
57
|
},
|
|
58
58
|
...
|
|
59
|
-
}) => null |
|
|
59
|
+
}) => null | React.MixedElement,
|
|
60
60
|
/**
|
|
61
61
|
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
|
|
62
62
|
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
|
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
Message,
|
|
19
19
|
} from './parseLogBoxLog';
|
|
20
20
|
|
|
21
|
+
import DebuggerSessionObserver from '../../../src/private/fusebox/FuseboxSessionObserver';
|
|
21
22
|
import parseErrorStack from '../../Core/Devtools/parseErrorStack';
|
|
22
23
|
import NativeDevSettings from '../../NativeModules/specs/NativeDevSettings';
|
|
23
24
|
import NativeLogBox from '../../NativeModules/specs/NativeLogBox';
|
|
@@ -75,6 +76,7 @@ let updateTimeout: $FlowFixMe | null = null;
|
|
|
75
76
|
let _isDisabled = false;
|
|
76
77
|
let _selectedIndex = -1;
|
|
77
78
|
let hasShownFuseboxWarningsMigrationMessage = false;
|
|
79
|
+
let hostTargetSessionObserverSubscription = null;
|
|
78
80
|
|
|
79
81
|
let warningFilter: WarningFilter = function (format) {
|
|
80
82
|
return {
|
|
@@ -196,11 +198,30 @@ function appendNewLog(newLog: LogBoxLog) {
|
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
export function addLog(log: LogData): void {
|
|
201
|
+
if (hostTargetSessionObserverSubscription == null) {
|
|
202
|
+
hostTargetSessionObserverSubscription = DebuggerSessionObserver.subscribe(
|
|
203
|
+
hasActiveSession => {
|
|
204
|
+
if (hasActiveSession) {
|
|
205
|
+
clearWarnings();
|
|
206
|
+
} else {
|
|
207
|
+
// Reset the flag so that we can show the message again if new warning was emitted
|
|
208
|
+
hasShownFuseboxWarningsMigrationMessage = false;
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// If Host has Fusebox support
|
|
199
215
|
if (log.level === 'warn' && global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
|
|
200
|
-
//
|
|
201
|
-
|
|
216
|
+
// And there is no active debugging session
|
|
217
|
+
if (!DebuggerSessionObserver.hasActiveSession()) {
|
|
218
|
+
showFuseboxWarningsMigrationMessageOnce();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Don't show LogBox warnings when Host has active debugging session
|
|
202
222
|
return;
|
|
203
223
|
}
|
|
224
|
+
|
|
204
225
|
const errorForStackTrace = new Error();
|
|
205
226
|
|
|
206
227
|
// Parsing logs are expensive so we schedule this
|
|
@@ -419,6 +440,7 @@ export function withSubscription(
|
|
|
419
440
|
componentDidCatch(err: Error, errorInfo: {componentStack: string, ...}) {
|
|
420
441
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
421
442
|
* this parameters */
|
|
443
|
+
// $FlowFixMe[incompatible-call]
|
|
422
444
|
reportLogBoxError(err, errorInfo.componentStack);
|
|
423
445
|
}
|
|
424
446
|
|
|
@@ -483,7 +505,6 @@ function showFuseboxWarningsMigrationMessageOnce() {
|
|
|
483
505
|
if (NativeDevSettings.openDebugger) {
|
|
484
506
|
NativeDevSettings.openDebugger();
|
|
485
507
|
}
|
|
486
|
-
clearWarnings();
|
|
487
508
|
},
|
|
488
509
|
}),
|
|
489
510
|
);
|
|
@@ -14,6 +14,7 @@ import * as LogBoxData from './Data/LogBoxData';
|
|
|
14
14
|
import LogBoxLog from './Data/LogBoxLog';
|
|
15
15
|
import LogBoxLogNotification from './UI/LogBoxNotification';
|
|
16
16
|
import * as React from 'react';
|
|
17
|
+
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
17
18
|
|
|
18
19
|
type Props = $ReadOnly<{|
|
|
19
20
|
logs: $ReadOnlyArray<LogBoxLog>,
|
|
@@ -58,7 +59,7 @@ export function _LogBoxNotificationContainer(props: Props): React.Node {
|
|
|
58
59
|
log => log.level === 'error' || log.level === 'fatal',
|
|
59
60
|
);
|
|
60
61
|
return (
|
|
61
|
-
<
|
|
62
|
+
<SafeAreaView style={styles.list}>
|
|
62
63
|
{warnings.length > 0 && (
|
|
63
64
|
<View style={styles.toast}>
|
|
64
65
|
<LogBoxLogNotification
|
|
@@ -81,7 +82,7 @@ export function _LogBoxNotificationContainer(props: Props): React.Node {
|
|
|
81
82
|
/>
|
|
82
83
|
</View>
|
|
83
84
|
)}
|
|
84
|
-
</
|
|
85
|
+
</SafeAreaView>
|
|
85
86
|
);
|
|
86
87
|
}
|
|
87
88
|
|