mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Integrate CDPAgent into HermesRuntimeTargetDelegate behind flag (#43353)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43353 ## Context We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`). ## This diff Integrates `HermesRuntimeAgentDelegateNew` (using the new Hermes `CDPAgent` setup) into `HermesRuntimeTargetDelegate` behind a new feature flag, `inspectorEnableHermesCDPAgent`. This completes the initial integration for all platforms. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D54586162 fbshipit-source-id: 5f26c28af4414d961b1c8c9cb4cd7135bd00b410
This commit is contained in:
committed by
Facebook GitHub Bot
parent
166fdc5125
commit
cfa39c0a69
+7
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<a3cb24f7faddd86beb617c8314c1bfed>>
|
||||
* @generated SignedSource<<62ec63a2aebd866803cde1c1ca7d44c6>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun inspectorEnableCxxInspectorPackagerConnection(): Boolean = accessor.inspectorEnableCxxInspectorPackagerConnection()
|
||||
|
||||
/**
|
||||
* Flag determining if the new Hermes CDPAgent API should be enabled in the modern CDP backend. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun inspectorEnableHermesCDPAgent(): Boolean = accessor.inspectorEnableHermesCDPAgent()
|
||||
|
||||
/**
|
||||
* Flag determining if the modern CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
|
||||
+11
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<8539cf7ba13ab52ca878efd2c4858d7a>>
|
||||
* @generated SignedSource<<c646fd173ad74a352afdd8138f55729e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -29,6 +29,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var enableMountHooksAndroidCache: Boolean? = null
|
||||
private var enableSpannableBuildingUnificationCache: Boolean? = null
|
||||
private var inspectorEnableCxxInspectorPackagerConnectionCache: Boolean? = null
|
||||
private var inspectorEnableHermesCDPAgentCache: Boolean? = null
|
||||
private var inspectorEnableModernCDPRegistryCache: Boolean? = null
|
||||
private var skipMountHookNotificationsCache: Boolean? = null
|
||||
private var useModernRuntimeSchedulerCache: Boolean? = null
|
||||
@@ -114,6 +115,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun inspectorEnableHermesCDPAgent(): Boolean {
|
||||
var cached = inspectorEnableHermesCDPAgentCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.inspectorEnableHermesCDPAgent()
|
||||
inspectorEnableHermesCDPAgentCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun inspectorEnableModernCDPRegistry(): Boolean {
|
||||
var cached = inspectorEnableModernCDPRegistryCache
|
||||
if (cached == null) {
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<cd7257d4b1414f7aacd02a79b9295a46>>
|
||||
* @generated SignedSource<<9b38540981705aea015b0a5d0ac07c6e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,6 +46,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun inspectorEnableCxxInspectorPackagerConnection(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun inspectorEnableHermesCDPAgent(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun inspectorEnableModernCDPRegistry(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun skipMountHookNotifications(): Boolean
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<99263973c4a06fdc91e7c9edf4aa4e19>>
|
||||
* @generated SignedSource<<e59e70d753403b168558b0d2b9513b5c>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -41,6 +41,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun inspectorEnableCxxInspectorPackagerConnection(): Boolean = false
|
||||
|
||||
override fun inspectorEnableHermesCDPAgent(): Boolean = false
|
||||
|
||||
override fun inspectorEnableModernCDPRegistry(): Boolean = false
|
||||
|
||||
override fun skipMountHookNotifications(): Boolean = false
|
||||
|
||||
+12
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<e8550b0c2494b223b82e6fab0a827d53>>
|
||||
* @generated SignedSource<<7e3e2b716f8f6caf60b888350041745e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -33,6 +33,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableMountHooksAndroidCache: Boolean? = null
|
||||
private var enableSpannableBuildingUnificationCache: Boolean? = null
|
||||
private var inspectorEnableCxxInspectorPackagerConnectionCache: Boolean? = null
|
||||
private var inspectorEnableHermesCDPAgentCache: Boolean? = null
|
||||
private var inspectorEnableModernCDPRegistryCache: Boolean? = null
|
||||
private var skipMountHookNotificationsCache: Boolean? = null
|
||||
private var useModernRuntimeSchedulerCache: Boolean? = null
|
||||
@@ -127,6 +128,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun inspectorEnableHermesCDPAgent(): Boolean {
|
||||
var cached = inspectorEnableHermesCDPAgentCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.inspectorEnableHermesCDPAgent()
|
||||
accessedFeatureFlags.add("inspectorEnableHermesCDPAgent")
|
||||
inspectorEnableHermesCDPAgentCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun inspectorEnableModernCDPRegistry(): Boolean {
|
||||
var cached = inspectorEnableModernCDPRegistryCache
|
||||
if (cached == null) {
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<268a87860fea5f281567d2142f90b0d4>>
|
||||
* @generated SignedSource<<d20f46b741dfd156a339fe105fca3cc4>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -41,6 +41,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun inspectorEnableCxxInspectorPackagerConnection(): Boolean
|
||||
|
||||
@DoNotStrip public fun inspectorEnableHermesCDPAgent(): Boolean
|
||||
|
||||
@DoNotStrip public fun inspectorEnableModernCDPRegistry(): Boolean
|
||||
|
||||
@DoNotStrip public fun skipMountHookNotifications(): Boolean
|
||||
|
||||
+15
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<d697a8ac9c347c63a5fd592bccbfb8b5>>
|
||||
* @generated SignedSource<<c867f3ceebcfbe24329a195ebf7a52cd>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -93,6 +93,12 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool inspectorEnableHermesCDPAgent() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("inspectorEnableHermesCDPAgent");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool inspectorEnableModernCDPRegistry() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("inspectorEnableModernCDPRegistry");
|
||||
@@ -160,6 +166,11 @@ bool JReactNativeFeatureFlagsCxxInterop::inspectorEnableCxxInspectorPackagerConn
|
||||
return ReactNativeFeatureFlags::inspectorEnableCxxInspectorPackagerConnection();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::inspectorEnableHermesCDPAgent(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::inspectorEnableHermesCDPAgent();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::inspectorEnableModernCDPRegistry(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry();
|
||||
@@ -219,6 +230,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"inspectorEnableCxxInspectorPackagerConnection",
|
||||
JReactNativeFeatureFlagsCxxInterop::inspectorEnableCxxInspectorPackagerConnection),
|
||||
makeNativeMethod(
|
||||
"inspectorEnableHermesCDPAgent",
|
||||
JReactNativeFeatureFlagsCxxInterop::inspectorEnableHermesCDPAgent),
|
||||
makeNativeMethod(
|
||||
"inspectorEnableModernCDPRegistry",
|
||||
JReactNativeFeatureFlagsCxxInterop::inspectorEnableModernCDPRegistry),
|
||||
|
||||
+4
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<c3bb3615d6a32333f4f20e9d204b5dbb>>
|
||||
* @generated SignedSource<<24dfb31a32c16f44b9a0ed64d8fff25b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -57,6 +57,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool inspectorEnableCxxInspectorPackagerConnection(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool inspectorEnableHermesCDPAgent(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool inspectorEnableModernCDPRegistry(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
+35
-13
@@ -5,8 +5,12 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "HermesRuntimeTargetDelegate.h"
|
||||
#include <jsinspector-modern/InspectorFlags.h>
|
||||
#include <jsinspector-modern/RuntimeTarget.h>
|
||||
|
||||
#include "HermesRuntimeAgentDelegate.h"
|
||||
#include "HermesRuntimeAgentDelegateNew.h"
|
||||
#include "HermesRuntimeTargetDelegate.h"
|
||||
|
||||
#ifdef HERMES_ENABLE_DEBUGGER
|
||||
#include <hermes/cdp/CDPDebugAPI.h>
|
||||
@@ -23,16 +27,21 @@ namespace facebook::react::jsinspector_modern {
|
||||
class HermesRuntimeTargetDelegate::Impl : public RuntimeTargetDelegate {
|
||||
public:
|
||||
#ifdef HERMES_ENABLE_DEBUGGER
|
||||
explicit Impl(std::shared_ptr<HermesRuntime> hermesRuntime)
|
||||
: runtime_(std::move(hermesRuntime)),
|
||||
explicit Impl(
|
||||
HermesRuntimeTargetDelegate& delegate,
|
||||
std::shared_ptr<HermesRuntime> hermesRuntime)
|
||||
: delegate_(delegate),
|
||||
runtime_(std::move(hermesRuntime)),
|
||||
cdpDebugAPI_(CDPDebugAPI::create(*runtime_)) {}
|
||||
|
||||
CDPDebugAPI& getCDPDebugAPI() {
|
||||
return *cdpDebugAPI_;
|
||||
}
|
||||
#else
|
||||
explicit Impl(std::shared_ptr<HermesRuntime> hermesRuntime)
|
||||
: runtime_(std::move(hermesRuntime)) {}
|
||||
explicit Impl(
|
||||
HermesRuntimeTargetDelegate& delegate,
|
||||
std::shared_ptr<HermesRuntime> hermesRuntime)
|
||||
: delegate_(delegate), runtime_(std::move(hermesRuntime)) {}
|
||||
#endif
|
||||
|
||||
// RuntimeTargetDelegate methods
|
||||
@@ -44,16 +53,29 @@ class HermesRuntimeTargetDelegate::Impl : public RuntimeTargetDelegate {
|
||||
previouslyExportedState,
|
||||
const ExecutionContextDescription& executionContextDescription,
|
||||
RuntimeExecutor runtimeExecutor) override {
|
||||
return std::unique_ptr<RuntimeAgentDelegate>(new HermesRuntimeAgentDelegate(
|
||||
frontendChannel,
|
||||
sessionState,
|
||||
std::move(previouslyExportedState),
|
||||
executionContextDescription,
|
||||
runtime_,
|
||||
std::move(runtimeExecutor)));
|
||||
auto& inspectorFlags = InspectorFlags::getInstance();
|
||||
|
||||
return inspectorFlags.getEnableHermesCDPAgent()
|
||||
? std::unique_ptr<RuntimeAgentDelegate>(
|
||||
new HermesRuntimeAgentDelegateNew(
|
||||
frontendChannel,
|
||||
sessionState,
|
||||
std::move(previouslyExportedState),
|
||||
executionContextDescription,
|
||||
*runtime_,
|
||||
delegate_,
|
||||
std::move(runtimeExecutor)))
|
||||
: std::unique_ptr<RuntimeAgentDelegate>(new HermesRuntimeAgentDelegate(
|
||||
frontendChannel,
|
||||
sessionState,
|
||||
std::move(previouslyExportedState),
|
||||
executionContextDescription,
|
||||
runtime_,
|
||||
std::move(runtimeExecutor)));
|
||||
}
|
||||
|
||||
private:
|
||||
HermesRuntimeTargetDelegate& delegate_;
|
||||
std::shared_ptr<HermesRuntime> runtime_;
|
||||
|
||||
#ifdef HERMES_ENABLE_DEBUGGER
|
||||
@@ -63,7 +85,7 @@ class HermesRuntimeTargetDelegate::Impl : public RuntimeTargetDelegate {
|
||||
|
||||
HermesRuntimeTargetDelegate::HermesRuntimeTargetDelegate(
|
||||
std::shared_ptr<HermesRuntime> hermesRuntime)
|
||||
: impl_(std::make_unique<Impl>(std::move(hermesRuntime))) {}
|
||||
: impl_(std::make_unique<Impl>(*this, std::move(hermesRuntime))) {}
|
||||
|
||||
HermesRuntimeTargetDelegate::~HermesRuntimeTargetDelegate() = default;
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@ InspectorFlags::InspectorFlags()
|
||||
ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry()),
|
||||
enableCxxInspectorPackagerConnection_(
|
||||
ReactNativeFeatureFlags::
|
||||
inspectorEnableCxxInspectorPackagerConnection()) {}
|
||||
inspectorEnableCxxInspectorPackagerConnection()),
|
||||
enableHermesCDPAgent_(
|
||||
ReactNativeFeatureFlags::inspectorEnableHermesCDPAgent()) {}
|
||||
|
||||
bool InspectorFlags::getEnableModernCDPRegistry() const {
|
||||
assertFlagsMatchUpstream();
|
||||
@@ -37,6 +39,11 @@ bool InspectorFlags::getEnableCxxInspectorPackagerConnection() const {
|
||||
enableModernCDPRegistry_;
|
||||
}
|
||||
|
||||
bool InspectorFlags::getEnableHermesCDPAgent() const {
|
||||
assertFlagsMatchUpstream();
|
||||
return enableHermesCDPAgent_;
|
||||
}
|
||||
|
||||
void InspectorFlags::dangerouslyResetFlags() {
|
||||
*this = InspectorFlags{};
|
||||
}
|
||||
@@ -50,7 +57,9 @@ void InspectorFlags::assertFlagsMatchUpstream() const {
|
||||
ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry() ||
|
||||
enableCxxInspectorPackagerConnection_ !=
|
||||
ReactNativeFeatureFlags::
|
||||
inspectorEnableCxxInspectorPackagerConnection()) {
|
||||
inspectorEnableCxxInspectorPackagerConnection() ||
|
||||
ReactNativeFeatureFlags::inspectorEnableHermesCDPAgent() !=
|
||||
enableHermesCDPAgent_) {
|
||||
LOG(ERROR)
|
||||
<< "[InspectorFlags] Error: One or more ReactNativeFeatureFlags values "
|
||||
<< "have changed during the global app lifetime. This may lead to "
|
||||
|
||||
@@ -30,6 +30,11 @@ class InspectorFlags {
|
||||
*/
|
||||
bool getEnableCxxInspectorPackagerConnection() const;
|
||||
|
||||
/**
|
||||
* Flag determining if the new Hermes CDPAgent API should be enabled.
|
||||
*/
|
||||
bool getEnableHermesCDPAgent() const;
|
||||
|
||||
/**
|
||||
* Reset flags to their upstream values. The caller must ensure any resources
|
||||
* that have read previous flag values have been cleaned up.
|
||||
@@ -44,6 +49,7 @@ class InspectorFlags {
|
||||
|
||||
bool enableModernCDPRegistry_;
|
||||
bool enableCxxInspectorPackagerConnection_;
|
||||
bool enableHermesCDPAgent_;
|
||||
|
||||
mutable bool inconsistentFlagsStateLogged_{false};
|
||||
void assertFlagsMatchUpstream() const;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<fd7ff07ffc0f5f7b2d553a6b5064a1c0>>
|
||||
* @generated SignedSource<<d85ce9d83e0ea9aa93923e81e2ffaec0>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -57,6 +57,10 @@ bool ReactNativeFeatureFlags::inspectorEnableCxxInspectorPackagerConnection() {
|
||||
return getAccessor().inspectorEnableCxxInspectorPackagerConnection();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::inspectorEnableHermesCDPAgent() {
|
||||
return getAccessor().inspectorEnableHermesCDPAgent();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry() {
|
||||
return getAccessor().inspectorEnableModernCDPRegistry();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<cbf10b0a7ed3d4892d53e5ae2319f4a8>>
|
||||
* @generated SignedSource<<e4631762e5a422465444236542d9c3aa>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool inspectorEnableCxxInspectorPackagerConnection();
|
||||
|
||||
/**
|
||||
* Flag determining if the new Hermes CDPAgent API should be enabled in the modern CDP backend. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
RN_EXPORT static bool inspectorEnableHermesCDPAgent();
|
||||
|
||||
/**
|
||||
* Flag determining if the modern CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
|
||||
+22
-4
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<6c1e6b6a51cd6fdddae40d3b61ae2b36>>
|
||||
* @generated SignedSource<<940e03ab78a13e5486802c13861be739>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -191,6 +191,24 @@ bool ReactNativeFeatureFlagsAccessor::inspectorEnableCxxInspectorPackagerConnect
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::inspectorEnableHermesCDPAgent() {
|
||||
auto flagValue = inspectorEnableHermesCDPAgent_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(9, "inspectorEnableHermesCDPAgent");
|
||||
|
||||
flagValue = currentProvider_->inspectorEnableHermesCDPAgent();
|
||||
inspectorEnableHermesCDPAgent_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::inspectorEnableModernCDPRegistry() {
|
||||
auto flagValue = inspectorEnableModernCDPRegistry_.load();
|
||||
|
||||
@@ -200,7 +218,7 @@ bool ReactNativeFeatureFlagsAccessor::inspectorEnableModernCDPRegistry() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(9, "inspectorEnableModernCDPRegistry");
|
||||
markFlagAsAccessed(10, "inspectorEnableModernCDPRegistry");
|
||||
|
||||
flagValue = currentProvider_->inspectorEnableModernCDPRegistry();
|
||||
inspectorEnableModernCDPRegistry_ = flagValue;
|
||||
@@ -218,7 +236,7 @@ bool ReactNativeFeatureFlagsAccessor::skipMountHookNotifications() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(10, "skipMountHookNotifications");
|
||||
markFlagAsAccessed(11, "skipMountHookNotifications");
|
||||
|
||||
flagValue = currentProvider_->skipMountHookNotifications();
|
||||
skipMountHookNotifications_ = flagValue;
|
||||
@@ -236,7 +254,7 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(11, "useModernRuntimeScheduler");
|
||||
markFlagAsAccessed(12, "useModernRuntimeScheduler");
|
||||
|
||||
flagValue = currentProvider_->useModernRuntimeScheduler();
|
||||
useModernRuntimeScheduler_ = flagValue;
|
||||
|
||||
+4
-2
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<4c5446d5b72429d090e17523f2d544a7>>
|
||||
* @generated SignedSource<<aae94eb2b905f05e69a8a46abe53f60d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableMountHooksAndroid();
|
||||
bool enableSpannableBuildingUnification();
|
||||
bool inspectorEnableCxxInspectorPackagerConnection();
|
||||
bool inspectorEnableHermesCDPAgent();
|
||||
bool inspectorEnableModernCDPRegistry();
|
||||
bool skipMountHookNotifications();
|
||||
bool useModernRuntimeScheduler();
|
||||
@@ -53,7 +54,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 12> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 13> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> batchRenderingUpdatesInEventLoop_;
|
||||
@@ -64,6 +65,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableMountHooksAndroid_;
|
||||
std::atomic<std::optional<bool>> enableSpannableBuildingUnification_;
|
||||
std::atomic<std::optional<bool>> inspectorEnableCxxInspectorPackagerConnection_;
|
||||
std::atomic<std::optional<bool>> inspectorEnableHermesCDPAgent_;
|
||||
std::atomic<std::optional<bool>> inspectorEnableModernCDPRegistry_;
|
||||
std::atomic<std::optional<bool>> skipMountHookNotifications_;
|
||||
std::atomic<std::optional<bool>> useModernRuntimeScheduler_;
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<95e3fd7cf662623e3c09b093649d4ff2>>
|
||||
* @generated SignedSource<<c63cd0b38dfa9c4d6843a4b879f8f4df>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -63,6 +63,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool inspectorEnableHermesCDPAgent() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool inspectorEnableModernCDPRegistry() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<26990a0a11bb2d7cf8510773b6ece099>>
|
||||
* @generated SignedSource<<e9d6fc551ceeb457c501e71cb52b9e6d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -34,6 +34,7 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableMountHooksAndroid() = 0;
|
||||
virtual bool enableSpannableBuildingUnification() = 0;
|
||||
virtual bool inspectorEnableCxxInspectorPackagerConnection() = 0;
|
||||
virtual bool inspectorEnableHermesCDPAgent() = 0;
|
||||
virtual bool inspectorEnableModernCDPRegistry() = 0;
|
||||
virtual bool skipMountHookNotifications() = 0;
|
||||
virtual bool useModernRuntimeScheduler() = 0;
|
||||
|
||||
+6
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<4f7daa629ad90a9ab2fdc99e7c51e355>>
|
||||
* @generated SignedSource<<a8b6653bdde573c793667b6d7ce3f0dd>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,11 @@ bool NativeReactNativeFeatureFlags::inspectorEnableCxxInspectorPackagerConnectio
|
||||
return ReactNativeFeatureFlags::inspectorEnableCxxInspectorPackagerConnection();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::inspectorEnableHermesCDPAgent(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::inspectorEnableHermesCDPAgent();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::inspectorEnableModernCDPRegistry(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry();
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<b10df028d57c3aebd1972bc4624d1b84>>
|
||||
* @generated SignedSource<<e7305f923500dbd9b5e1b8d0217156ef>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -54,6 +54,8 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool inspectorEnableCxxInspectorPackagerConnection(jsi::Runtime& runtime);
|
||||
|
||||
bool inspectorEnableHermesCDPAgent(jsi::Runtime& runtime);
|
||||
|
||||
bool inspectorEnableModernCDPRegistry(jsi::Runtime& runtime);
|
||||
|
||||
bool skipMountHookNotifications(jsi::Runtime& runtime);
|
||||
|
||||
@@ -72,6 +72,11 @@ const definitions: FeatureFlagDefinitions = {
|
||||
description:
|
||||
'Flag determining if the C++ implementation of InspectorPackagerConnection should be used instead of the per-platform one. This flag is global and should not be changed across React Host lifetimes.',
|
||||
},
|
||||
inspectorEnableHermesCDPAgent: {
|
||||
defaultValue: false,
|
||||
description:
|
||||
'Flag determining if the new Hermes CDPAgent API should be enabled in the modern CDP backend. This flag is global and should not be changed across React Host lifetimes.',
|
||||
},
|
||||
inspectorEnableModernCDPRegistry: {
|
||||
defaultValue: false,
|
||||
description:
|
||||
|
||||
+2
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<ef52ae50a916af01ceaaaa6683f6ec5e>>
|
||||
* @generated SignedSource<<6a401351e670388135bec038018d3fe8>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface Spec extends TurboModule {
|
||||
+enableMountHooksAndroid?: () => boolean;
|
||||
+enableSpannableBuildingUnification?: () => boolean;
|
||||
+inspectorEnableCxxInspectorPackagerConnection?: () => boolean;
|
||||
+inspectorEnableHermesCDPAgent?: () => boolean;
|
||||
+inspectorEnableModernCDPRegistry?: () => boolean;
|
||||
+skipMountHookNotifications?: () => boolean;
|
||||
+useModernRuntimeScheduler?: () => boolean;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<5d1eca67ace8cccc336a6c6f65b40c99>>
|
||||
* @generated SignedSource<<66678139be02293ff532e8e125ccc608>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -49,6 +49,7 @@ export type ReactNativeFeatureFlags = {
|
||||
enableMountHooksAndroid: Getter<boolean>,
|
||||
enableSpannableBuildingUnification: Getter<boolean>,
|
||||
inspectorEnableCxxInspectorPackagerConnection: Getter<boolean>,
|
||||
inspectorEnableHermesCDPAgent: Getter<boolean>,
|
||||
inspectorEnableModernCDPRegistry: Getter<boolean>,
|
||||
skipMountHookNotifications: Getter<boolean>,
|
||||
useModernRuntimeScheduler: Getter<boolean>,
|
||||
@@ -130,6 +131,10 @@ export const enableSpannableBuildingUnification: Getter<boolean> = createNativeF
|
||||
* Flag determining if the C++ implementation of InspectorPackagerConnection should be used instead of the per-platform one. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
export const inspectorEnableCxxInspectorPackagerConnection: Getter<boolean> = createNativeFlagGetter('inspectorEnableCxxInspectorPackagerConnection', false);
|
||||
/**
|
||||
* Flag determining if the new Hermes CDPAgent API should be enabled in the modern CDP backend. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
export const inspectorEnableHermesCDPAgent: Getter<boolean> = createNativeFlagGetter('inspectorEnableHermesCDPAgent', false);
|
||||
/**
|
||||
* Flag determining if the modern CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user