From bd64ec817d4a8be87722122622d30f72e614b87c Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 11 Apr 2025 08:16:46 -0700 Subject: [PATCH] Backout "Add warning when a component is loaded with the interop layer" Summary: Backing out https://github.com/facebook/react-native/pull/50244 as it is causing unexpected issues internally. ## Changelog: [iOS][Changed] - Revert "Add warning when a component is loaded with the interop layer" Reviewed By: cortinico Differential Revision: D72857290 fbshipit-source-id: cfae6ccf85a472ae03983349fc7a2620e157865d --- .../Libraries/AppDelegate/RCTReactNativeFactory.mm | 1 - packages/react-native/React/Base/RCTAssert.m | 5 +---- .../React/Fabric/Mounting/RCTComponentViewFactory.mm | 6 ++---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm index 673c5c18831..b97ae0614df 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm @@ -50,7 +50,6 @@ using namespace facebook::react; { if (self = [super init]) { self.delegate = delegate; - RCTNewArchitectureSetMinValidationLevel(RCTNotAllowedInFabricWithoutLegacy); [self _setUpFeatureFlags:releaseLevel]; auto newArchEnabled = [self newArchEnabled]; diff --git a/packages/react-native/React/Base/RCTAssert.m b/packages/react-native/React/Base/RCTAssert.m index aae18ec0ca6..ca8542eb6ac 100644 --- a/packages/react-native/React/Base/RCTAssert.m +++ b/packages/react-native/React/Base/RCTAssert.m @@ -310,9 +310,6 @@ newArchitectureValidationInternal(RCTLogLevel level, RCTNotAllowedValidation typ case RCTLogLevelFatal: RCTAssert(0, @"%@", msg); break; - case RCTLogLevelWarning: - RCTLogWarn(@"%@", msg); - break; default: RCTAssert(0, @"New architecture validation is only for info, error, and fatal levels."); } @@ -337,7 +334,7 @@ void RCTErrorNewArchitectureValidation(RCTNotAllowedValidation type, id context, void RCTLogNewArchitectureValidation(RCTNotAllowedValidation type, id context, NSString *extra) { - newArchitectureValidationInternal(RCTLogLevelWarning, type, context, extra); + newArchitectureValidationInternal(RCTLogLevelInfo, type, context, extra); } void RCTNewArchitectureValidationPlaceholder(RCTNotAllowedValidation type, id context, NSString *extra) diff --git a/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm b/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm index 3db0181332b..df24eebb9df 100644 --- a/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm +++ b/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm @@ -141,13 +141,11 @@ static Class RCTComponentViewClassWithName(const char // TODO(T174674274): Implement lazy loading of legacy view managers in the new architecture. if (RCTFabricInteropLayerEnabled() && [RCTLegacyViewManagerInteropComponentView isSupported:componentNameString]) { RCTLogNewArchitectureValidation( - RCTAreLegacyLogsEnabled() ? RCTNotAllowedInFabricWithoutLegacy : RCTNotAllowedInBridgeless, + RCTNotAllowedInBridgeless, self, [NSString stringWithFormat: - @"The `%@` component is loaded in the app using the Fabric Interop layer. This is part of the compatibility layer with the Legacy Architecture. If `%@` is a local component, please migrate it to be a Native Component as described at https://reactnative.dev/docs/next/fabric-native-components-introduction. If `%@` is a third party dependency, please open an issue in the library repository.", - componentNameString, - componentNameString, + @"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@", componentNameString]); auto flavor = std::make_shared(name);