Skip to content

Commit

Permalink
(Easy) Rename RCTNotAllowedInFabric to RCTNotAllowedInAppWideFabric
Browse files Browse the repository at this point in the history
Summary:
Changelog: [iOS][Internal] Rename RCTNotAllowedInFabric to RCTNotAllowedInAppWideFabric

Clarify that methods marked with `RCTNotAllowedInAppWideFabric` are only NOT available when Fabric is app-wide (which is necessary for app-wide Bridgeless mode). These methods may still be called in apps with legacy pre-Fabric surfaces.

Reviewed By: RSNara

Differential Revision: D35194789

fbshipit-source-id: e16fa54d22ea67be995e93f6ff60567a117398be
  • Loading branch information
p-sun authored and facebook-github-bot committed Mar 29, 2022
1 parent 5ffa0b0 commit eeb244a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions React/Base/RCTAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ RCT_EXTERN NSString *RCTFormatStackTrace(NSArray<NSDictionary<NSString *, id> *>
// MARK: - New Architecture Validation

typedef enum {
RCTNotAllowedInFabric = 1,
RCTNotAllowedInAppWideFabric = 1,
RCTNotAllowedInBridgeless = 2,
} RCTNotAllowedValidation;

/**
* Ensure runtime assumptions holds for the new architecture by reporting when assumptions are violated.
* Note: this is work in progress.
*
* When type is RCTNotAllowedInFabric, validate Fabric assumptions in Bridge or Bridgeless mode.
* i.e. Report legacy pre-Fabric call sites that should not be used while Fabric is enabled,
* When type is RCTNotAllowedInAppWideFabric, validate Fabric assumptions in Bridge or Bridgeless mode.
* i.e. Report legacy pre-Fabric call sites that should not be used while Fabric is enabled on all surfaces.
*
* When type is RCTNotAllowedInBridgeless, validate Bridgeless assumptions, in Bridgeless mode only.
* i.e. Report Bridge call sites that should not be used while Bridgeless mode is enabled.
Expand Down
6 changes: 3 additions & 3 deletions React/Base/RCTAssert.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ RCTFatalExceptionHandler RCTGetFatalExceptionHandler(void)
static BOOL shouldEnforceValidation(RCTNotAllowedValidation type)
{
switch (type) {
case RCTNotAllowedInFabric:
case RCTNotAllowedInAppWideFabric:
return validationReportingEnabled == RCTNotAllowedInBridgeless ||
validationReportingEnabled == RCTNotAllowedInFabric;
validationReportingEnabled == RCTNotAllowedInAppWideFabric;
case RCTNotAllowedInBridgeless:
return validationReportingEnabled == RCTNotAllowedInBridgeless;
}
Expand All @@ -279,7 +279,7 @@ static BOOL shouldEnforceValidation(RCTNotAllowedValidation type)
{
NSString *notAllowedType;
switch (type) {
case RCTNotAllowedInFabric:
case RCTNotAllowedInAppWideFabric:
notAllowedType = @"Fabric";
break;
case RCTNotAllowedInBridgeless:
Expand Down

0 comments on commit eeb244a

Please sign in to comment.