(Easy) Log errors to Logview when Bridge is used in Bridgeless
Summary: Changelog: [Internal] # Diff Changes - Set `RCTEnableNewArchitectureViolationReporting` to YES in app-wide Bridgeless mode. - Rename `RCTWarnNotAllowedForNewArchitecture` to `RCTErrorNotAllowedForNewArchitecture`, and use `RCTLogError` instead of `RCTLogWarn` so the error goes to Logview. Reviewed By: RSNara Differential Revision: D34202682 fbshipit-source-id: 471486c65f7a42f8f11140e61ff60592dc826f61
This commit is contained in:
Родитель
74f5697fdc
Коммит
3c4850d76b
|
@ -183,7 +183,6 @@ __attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureViolationReporting
|
|||
|
||||
// When reporting is enabled, trigger an assertion.
|
||||
__attribute__((used)) RCT_EXTERN void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra);
|
||||
|
||||
// When reporting is enabled, warn about the violation. Use this to prepare a specific callsite
|
||||
// When reporting is enabled, trigger an error but do not crash. Use this to prepare a specific callsite
|
||||
// for stricter enforcement. When ready, switch it to use the variant above.
|
||||
__attribute__((used)) RCT_EXTERN void RCTWarnNotAllowedForNewArchitecture(id context, NSString *extra);
|
||||
__attribute__((used)) RCT_EXTERN void RCTErrorNotAllowedForNewArchitecture(id context, NSString *extra);
|
||||
|
|
|
@ -274,11 +274,11 @@ void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra)
|
|||
RCTAssert(0, @"%@", getNewArchitectureViolationMessage(context, extra));
|
||||
}
|
||||
|
||||
void RCTWarnNotAllowedForNewArchitecture(id context, NSString *extra)
|
||||
void RCTErrorNotAllowedForNewArchitecture(id context, NSString *extra)
|
||||
{
|
||||
if (!newArchitectureViolationReporting) {
|
||||
return;
|
||||
}
|
||||
|
||||
RCTLogWarn(@"%@", getNewArchitectureViolationMessage(context, extra));
|
||||
RCTLogError(@"%@", getNewArchitectureViolationMessage(context, extra));
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ NSArray<Class> *RCTGetModuleClasses(void)
|
|||
void RCTRegisterModule(Class);
|
||||
void RCTRegisterModule(Class moduleClass)
|
||||
{
|
||||
RCTWarnNotAllowedForNewArchitecture(
|
||||
RCTErrorNotAllowedForNewArchitecture(
|
||||
@"RCTRegisterModule()", [NSString stringWithFormat:@"'%@' was registered unexpectedly", moduleClass]);
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
|
|
|
@ -29,7 +29,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
RCTWarnNotAllowedForNewArchitecture(
|
||||
RCTErrorNotAllowedForNewArchitecture(
|
||||
self, @"ViewManager with interop layer is not allowed in the new architecture.");
|
||||
static const auto defaultProps = std::make_shared<const LegacyViewManagerInteropViewProps>();
|
||||
_props = defaultProps;
|
||||
|
|
|
@ -82,7 +82,7 @@ RCT_EXPORT_MODULE()
|
|||
|
||||
- (void)setBridge:(RCTBridge *)bridge
|
||||
{
|
||||
RCTWarnNotAllowedForNewArchitecture(self, @"RCTViewManager must not be initialized for the new architecture");
|
||||
RCTErrorNotAllowedForNewArchitecture(self, @"RCTViewManager must not be initialized for the new architecture");
|
||||
_bridge = bridge;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче