From 674609757bf1513ef41cd241b3e59dee62ca0630 Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Fri, 8 Jul 2022 15:07:55 -0700 Subject: [PATCH] Minor: Rename RCTNotAllowedInAppWideFabric to RCTNotAllowedInFabricWithoutLegacy Summary: Changelog: [Internal][iOS] Minor: Rename RCTNotAllowedInAppWideFabric to RCTNotAllowedInFabricWithoutLegacy `RCTNewArchitectureValidationPlaceholder(RCTNotAllowedInBridgeless` is to track Bridge APIs that are okay in Fabric but not in Bridgeless. `RCTNewArchitectureValidationPlaceholder(RCTNotAllowedInFabricWithoutLegacy` is to track legacy APIs that should not exist if the app was using Fabric **without any legacy architecture**. e.g. RCTBridgeModule, legacy interop view components. Reviewed By: fkgozali Differential Revision: D37659105 fbshipit-source-id: aee4e083820e83a8dac19eb3b5efc49b37d90039 --- React/Base/RCTAssert.h | 6 ++++-- React/Base/RCTAssert.m | 2 +- React/Base/Surface/RCTSurface.mm | 2 +- React/CoreModules/RCTLogBoxView.mm | 2 +- React/Modules/RCTUIManager.m | 2 +- React/Views/RCTDatePickerManager.m | 2 +- React/Views/RCTMaskedViewManager.m | 2 +- React/Views/RCTProgressViewManager.m | 2 +- React/Views/RCTSegmentedControlManager.m | 2 +- 9 files changed, 12 insertions(+), 10 deletions(-) diff --git a/React/Base/RCTAssert.h b/React/Base/RCTAssert.h index 903316660ef..e7cb4a003bc 100644 --- a/React/Base/RCTAssert.h +++ b/React/Base/RCTAssert.h @@ -179,15 +179,17 @@ RCT_EXTERN NSString *RCTFormatStackTrace(NSArray *> typedef enum { RCTNotAllowedInBridgeless = 1, - RCTNotAllowedInAppWideFabric = 2, + RCTNotAllowedInFabricWithoutLegacy = 2, RCTNotAllowedValidationDisabled = 3, } RCTNotAllowedValidation; /** + * // TODO: (T125626909) Only validate legacy architecture usages in Bridgeless mode, not Bridged Fabric mode + * * Ensure runtime assumptions holds for the new architecture by reporting when assumptions are violated. * Note: this is work in progress. * - * When level is RCTNotAllowedInAppWideFabric, validate Fabric assumptions. + * When level is RCTNotAllowedInFabricWithoutLegacy, validate Fabric assumptions. * i.e. Report legacy pre-Fabric call sites that should not be used while Fabric is enabled on all surfaces. * * When level is RCTNotAllowedInBridgeless, validate Fabric or Bridgeless assumptions. diff --git a/React/Base/RCTAssert.m b/React/Base/RCTAssert.m index 41bf66d46d2..92b3fc8325a 100644 --- a/React/Base/RCTAssert.m +++ b/React/Base/RCTAssert.m @@ -276,7 +276,7 @@ static NSString *validationMessage(RCTNotAllowedValidation type, id context, NSS case RCTNotAllowedValidationDisabled: RCTAssert(0, @"RCTNotAllowedValidationDisabled not a validation type."); return nil; - case RCTNotAllowedInAppWideFabric: + case RCTNotAllowedInFabricWithoutLegacy: notAllowedType = @"Fabric"; break; case RCTNotAllowedInBridgeless: diff --git a/React/Base/Surface/RCTSurface.mm b/React/Base/Surface/RCTSurface.mm index be2baef1d5b..5b02f663e60 100644 --- a/React/Base/Surface/RCTSurface.mm +++ b/React/Base/Surface/RCTSurface.mm @@ -64,7 +64,7 @@ moduleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties { - RCTErrorNewArchitectureValidation(RCTNotAllowedInAppWideFabric, @"RCTSurface", nil); + RCTErrorNewArchitectureValidation(RCTNotAllowedInFabricWithoutLegacy, @"RCTSurface", nil); RCTAssert(bridge.valid, @"Valid bridge is required to instantiate `RCTSurface`."); if (self = [super init]) { diff --git a/React/CoreModules/RCTLogBoxView.mm b/React/CoreModules/RCTLogBoxView.mm index ddac0730bda..067550d3423 100644 --- a/React/CoreModules/RCTLogBoxView.mm +++ b/React/CoreModules/RCTLogBoxView.mm @@ -35,7 +35,7 @@ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge { - RCTErrorNewArchitectureValidation(RCTNotAllowedInAppWideFabric, @"RCTLogBoxView", nil); + RCTErrorNewArchitectureValidation(RCTNotAllowedInFabricWithoutLegacy, @"RCTLogBoxView", nil); if (@available(iOS 13.0, *)) { self = [super initWithWindowScene:window.windowScene]; diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index 486bc9845b1..3b8a8518c68 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -1657,7 +1657,7 @@ static UIView *_jsResponder; + (UIView *)JSResponder { RCTErrorNewArchitectureValidation( - RCTNotAllowedInAppWideFabric, @"RCTUIManager", @"Please migrate this legacy surface to Fabric."); + RCTNotAllowedInFabricWithoutLegacy, @"RCTUIManager", @"Please migrate this legacy surface to Fabric."); return _jsResponder; } diff --git a/React/Views/RCTDatePickerManager.m b/React/Views/RCTDatePickerManager.m index e2f4283b8c0..7409ada3374 100644 --- a/React/Views/RCTDatePickerManager.m +++ b/React/Views/RCTDatePickerManager.m @@ -49,7 +49,7 @@ RCT_EXPORT_MODULE() - (UIView *)view { RCTNewArchitectureValidationPlaceholder( - RCTNotAllowedInAppWideFabric, + RCTNotAllowedInFabricWithoutLegacy, self, @"This native component is still using the legacy interop layer -- please migrate it to use a Fabric specific implementation."); return [RCTDatePicker new]; diff --git a/React/Views/RCTMaskedViewManager.m b/React/Views/RCTMaskedViewManager.m index 47cf6fce86f..808f2e805fe 100644 --- a/React/Views/RCTMaskedViewManager.m +++ b/React/Views/RCTMaskedViewManager.m @@ -17,7 +17,7 @@ RCT_EXPORT_MODULE() - (UIView *)view { RCTNewArchitectureValidationPlaceholder( - RCTNotAllowedInAppWideFabric, + RCTNotAllowedInFabricWithoutLegacy, self, @"This native component is still using the legacy interop layer -- please migrate it to use a Fabric specific implementation."); return [RCTMaskedView new]; diff --git a/React/Views/RCTProgressViewManager.m b/React/Views/RCTProgressViewManager.m index 02555d572cb..93b66b37bec 100644 --- a/React/Views/RCTProgressViewManager.m +++ b/React/Views/RCTProgressViewManager.m @@ -29,7 +29,7 @@ RCT_EXPORT_MODULE() - (UIView *)view { RCTNewArchitectureValidationPlaceholder( - RCTNotAllowedInAppWideFabric, + RCTNotAllowedInFabricWithoutLegacy, self, @"This native component is still using the legacy interop layer -- please migrate it to use a Fabric specific implementation."); return [UIProgressView new]; diff --git a/React/Views/RCTSegmentedControlManager.m b/React/Views/RCTSegmentedControlManager.m index cfa55ea883b..c756374141a 100644 --- a/React/Views/RCTSegmentedControlManager.m +++ b/React/Views/RCTSegmentedControlManager.m @@ -18,7 +18,7 @@ RCT_EXPORT_MODULE() - (UIView *)view { RCTNewArchitectureValidationPlaceholder( - RCTNotAllowedInAppWideFabric, + RCTNotAllowedInFabricWithoutLegacy, self, @"This native component is still using the legacy interop layer -- please migrate it to use a Fabric specific implementation."); return [RCTSegmentedControl new];