mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Revert D58288489: Multisect successfully blamed "D58288489: [RN][Fusebox][iOS] Implement new HostTargetMetadata fields (iOS)" for one test failure (#44911)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44911 This diff reverts D58288489 D58288489: [RN][Fusebox][iOS] Implement new HostTargetMetadata fields (iOS) by huntie causes the following test failure: Tests affected: - [fbsource//xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern:testsAndroid - main](https://www.internalfb.com/intern/test/844425054538351/) Here's the Multisect link: https://www.internalfb.com/multisect/5466028 Here are the tasks that are relevant to this breakage: T191385299: 50+ tests unhealthy for react_native The backout may land if someone accepts it. If this diff has been generated in error, you can Commandeer and Abandon it. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D58475289 fbshipit-source-id: 3a4476d1350c4986cdb673bdb4ac52af353a00ea
This commit is contained in:
1 parent
297ded90aa
commit
11e5394796
6 files changed
+1
-89
No files matched your search
@@ -20,7 +20,6 @@
|
||||
#import <jsinspector-modern/ReactCdp.h>
|
||||
#import <optional>
|
||||
#import "RCTDevLoadingViewProtocol.h"
|
||||
#import "RCTInspectorUtils.h"
|
||||
#import "RCTJSThread.h"
|
||||
#import "RCTLog.h"
|
||||
#import "RCTModuleData.h"
|
||||
@@ -200,14 +199,8 @@ class RCTBridgeHostTargetDelegate : public facebook::react::jsinspector_modern::
|
||||
|
||||
facebook::react::jsinspector_modern::HostTargetMetadata getMetadata() override
|
||||
{
|
||||
auto metadata = [RCTInspectorUtils getHostMetadata];
|
||||
|
||||
return {
|
||||
.appIdentifier = metadata.appIdentifier,
|
||||
.deviceName = metadata.deviceName,
|
||||
.integrationName = "iOS Bridge (RCTBridge)",
|
||||
.platform = metadata.platform,
|
||||
.reactNativeVersion = metadata.reactNativeVersion,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <string>
|
||||
|
||||
struct CommonHostMetadata {
|
||||
std::string appIdentifier;
|
||||
std::string deviceName;
|
||||
std::string platform;
|
||||
std::string reactNativeVersion;
|
||||
};
|
||||
|
||||
@interface RCTInspectorUtils : NSObject
|
||||
|
||||
+ (CommonHostMetadata)getHostMetadata;
|
||||
|
||||
@end
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "RCTInspectorUtils.h"
|
||||
|
||||
#import <React/RCTConstants.h>
|
||||
#import <React/RCTVersion.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@implementation RCTInspectorUtils
|
||||
|
||||
+ (CommonHostMetadata)getHostMetadata
|
||||
{
|
||||
UIDevice *device = [UIDevice currentDevice];
|
||||
|
||||
NSString *appIdentifier = [[NSBundle mainBundle] bundleIdentifier];
|
||||
NSString *platform = RCTPlatformName;
|
||||
NSString *deviceName = [device name];
|
||||
|
||||
auto version = RCTGetReactNativeVersion();
|
||||
NSString *reactNativeVersion =
|
||||
[NSString stringWithFormat:@"%i.%i.%i%@",
|
||||
[version[@"minor"] intValue],
|
||||
[version[@"major"] intValue],
|
||||
[version[@"patch"] intValue],
|
||||
[version[@"prerelease"] isKindOfClass:[NSNull class]]
|
||||
? @""
|
||||
: [@"-" stringByAppendingString:[version[@"prerelease"] stringValue]]];
|
||||
|
||||
return {
|
||||
.appIdentifier = [appIdentifier UTF8String],
|
||||
.platform = [platform UTF8String],
|
||||
.deviceName = [deviceName UTF8String],
|
||||
.reactNativeVersion = [reactNativeVersion UTF8String],
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -223,11 +223,7 @@ bool HostTargetController::decrementPauseOverlayCounter() {
|
||||
folly::dynamic hostMetadataToDynamic(const HostTargetMetadata& metadata) {
|
||||
folly::dynamic result = folly::dynamic::object;
|
||||
|
||||
result["appIdentifier"] = metadata.appIdentifier.value_or(nullptr);
|
||||
result["deviceName"] = metadata.deviceName.value_or(nullptr);
|
||||
result["integrationName"] = metadata.integrationName.value_or(nullptr);
|
||||
result["platform"] = metadata.platform.value_or(nullptr);
|
||||
result["reactNativeVersion"] = metadata.reactNativeVersion.value_or(nullptr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -37,11 +37,7 @@ class HostCommandSender;
|
||||
class HostTarget;
|
||||
|
||||
struct HostTargetMetadata {
|
||||
std::optional<std::string> appIdentifier;
|
||||
std::optional<std::string> deviceName;
|
||||
std::optional<std::string> integrationName;
|
||||
std::optional<std::string> platform;
|
||||
std::optional<std::string> reactNativeVersion;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -94,8 +90,7 @@ class HostTargetDelegate {
|
||||
virtual ~HostTargetDelegate();
|
||||
|
||||
/**
|
||||
* Returns a metadata object describing the host. This is called on an
|
||||
* initial response to @cdp ReactNativeApplication.enable.
|
||||
* Returns a metadata object describing the host.
|
||||
*/
|
||||
virtual HostTargetMetadata getMetadata() = 0;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#import <React/RCTConvert.h>
|
||||
#import <React/RCTFabricSurface.h>
|
||||
#import <React/RCTInspectorDevServerHelper.h>
|
||||
#import <React/RCTInspectorUtils.h>
|
||||
#import <React/RCTJSThread.h>
|
||||
#import <React/RCTLog.h>
|
||||
#import <React/RCTMockDef.h>
|
||||
@@ -43,14 +42,8 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho
|
||||
|
||||
jsinspector_modern::HostTargetMetadata getMetadata() override
|
||||
{
|
||||
auto metadata = [RCTInspectorUtils getHostMetadata];
|
||||
|
||||
return {
|
||||
.appIdentifier = metadata.appIdentifier,
|
||||
.deviceName = metadata.deviceName,
|
||||
.integrationName = "iOS Bridgeless (RCTHost)",
|
||||
.platform = metadata.platform,
|
||||
.reactNativeVersion = metadata.reactNativeVersion,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user