diff --git a/packages/react-native/Libraries/Network/RCTNetworking.mm b/packages/react-native/Libraries/Network/RCTNetworking.mm index 1b52a960f633..c9d841e7468f 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.mm +++ b/packages/react-native/Libraries/Network/RCTNetworking.mm @@ -15,7 +15,6 @@ #import #import -#import #import "RCTInspectorNetworkReporter.h" #import "RCTNetworkPlugins.h" @@ -452,9 +451,7 @@ - (BOOL)canHandleRequest:(NSURLRequest *)request __weak RCTNetworkTask *weakTask = task; return ^{ [weakTask cancel]; - if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) { - [RCTInspectorNetworkReporter reportRequestFailed:devToolsRequestId cancelled:YES]; - } + [RCTInspectorNetworkReporter reportRequestFailed:devToolsRequestId cancelled:YES]; if (cancellationBlock) { cancellationBlock(); } @@ -574,19 +571,17 @@ - (void)sendData:(NSData *)data } } - if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) { - id responseDataForPreview; - if ([responseType isEqualToString:@"blob"]) { - responseDataForPreview = data; - } else if ([responseData isKindOfClass:[NSString class]]) { - responseDataForPreview = responseData; - } - bool base64Encoded = [responseType isEqualToString:@"base64"] || [responseType isEqualToString:@"blob"]; - - [RCTInspectorNetworkReporter maybeStoreResponseBody:task.devToolsRequestId - data:responseDataForPreview - base64Encoded:base64Encoded]; + id responseDataForPreview; + if ([responseType isEqualToString:@"blob"]) { + responseDataForPreview = data; + } else if ([responseData isKindOfClass:[NSString class]]) { + responseDataForPreview = responseData; } + bool base64Encoded = [responseType isEqualToString:@"base64"] || [responseType isEqualToString:@"blob"]; + + [RCTInspectorNetworkReporter maybeStoreResponseBody:task.devToolsRequestId + data:responseDataForPreview + base64Encoded:base64Encoded]; [self sendEventWithName:@"didReceiveNetworkData" body:@[ task.requestID, responseData ]]; } @@ -620,12 +615,10 @@ - (void)sendRequest:(NSURLRequest *)request id responseURL = response.URL ? response.URL.absoluteString : [NSNull null]; NSArray *responseJSON = @[ task.requestID, @(status), headers, responseURL ]; - if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) { - [RCTInspectorNetworkReporter reportResponseStart:task.devToolsRequestId - response:response - statusCode:status - headers:headers]; - } + [RCTInspectorNetworkReporter reportResponseStart:task.devToolsRequestId + response:response + statusCode:status + headers:headers]; [weakSelf sendEventWithName:@"didReceiveNetworkResponse" body:responseJSON]; }; @@ -660,10 +653,8 @@ - (void)sendRequest:(NSURLRequest *)request @(total) ]; - if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) { - [RCTInspectorNetworkReporter reportDataReceived:task.devToolsRequestId data:data]; - [RCTInspectorNetworkReporter maybeStoreResponseBodyIncremental:task.devToolsRequestId data:responseString]; - } + [RCTInspectorNetworkReporter reportDataReceived:task.devToolsRequestId data:data]; + [RCTInspectorNetworkReporter maybeStoreResponseBodyIncremental:task.devToolsRequestId data:responseString]; [weakSelf sendEventWithName:@"didReceiveNetworkIncrementalData" body:responseJSON]; }; } else { @@ -700,12 +691,10 @@ - (void)sendRequest:(NSURLRequest *)request NSArray *responseJSON = @[ task.requestID, RCTNullIfNil(error.localizedDescription), error.code == kCFURLErrorTimedOut ? @YES : @NO ]; - if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) { - if (error != nullptr) { - [RCTInspectorNetworkReporter reportRequestFailed:task.devToolsRequestId cancelled:NO]; - } else { - [RCTInspectorNetworkReporter reportResponseEnd:task.devToolsRequestId encodedDataLength:data.length]; - } + if (error != nullptr) { + [RCTInspectorNetworkReporter reportRequestFailed:task.devToolsRequestId cancelled:NO]; + } else { + [RCTInspectorNetworkReporter reportResponseEnd:task.devToolsRequestId encodedDataLength:data.length]; } [strongSelf sendEventWithName:@"didCompleteNetworkResponse" body:responseJSON]; [strongSelf->_tasksByRequestID removeObjectForKey:task.requestID]; @@ -723,12 +712,10 @@ - (void)sendRequest:(NSURLRequest *)request } _tasksByRequestID[task.requestID] = task; responseSender(@[ task.requestID ]); - if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) { - [RCTInspectorNetworkReporter reportRequestStart:task.devToolsRequestId - request:request - encodedDataLength:task.response.expectedContentLength]; - [RCTInspectorNetworkReporter reportConnectionTiming:task.devToolsRequestId request:task.request]; - } + [RCTInspectorNetworkReporter reportRequestStart:task.devToolsRequestId + request:request + encodedDataLength:task.response.expectedContentLength]; + [RCTInspectorNetworkReporter reportConnectionTiming:task.devToolsRequestId request:task.request]; } [task start]; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index 596ec7484e85..4b9846b970a7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -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<> + * @generated SignedSource<<9affe13f4391aa0e445770498894a85b>> */ /** @@ -264,12 +264,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun enableNativeCSSParsing(): Boolean = accessor.enableNativeCSSParsing() - /** - * Enable network event reporting hooks in each native platform through `NetworkReporter` (Web Perf APIs + CDP). This flag should be combined with `fuseboxNetworkInspectionEnabled` to enable Network CDP debugging. - */ - @JvmStatic - public fun enableNetworkEventReporting(): Boolean = accessor.enableNetworkEventReporting() - /** * Enables caching text layout artifacts for later reuse */ @@ -378,12 +372,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun fuseboxFrameRecordingEnabled(): Boolean = accessor.fuseboxFrameRecordingEnabled() - /** - * Enable network inspection support in the React Native DevTools CDP backend. Requires `enableBridgelessArchitecture`. This flag is global and should not be changed across React Host lifetimes. - */ - @JvmStatic - public fun fuseboxNetworkInspectionEnabled(): Boolean = accessor.fuseboxNetworkInspectionEnabled() - /** * Enable Page.captureScreenshot CDP method support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index 624e509c5034..496f386e33e7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -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<<5ae6b1a0bfa9d680aa61685dbacd69d2>> + * @generated SignedSource<> */ /** @@ -59,7 +59,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null private var enableMutationObserverByDefaultCache: Boolean? = null private var enableNativeCSSParsingCache: Boolean? = null - private var enableNetworkEventReportingCache: Boolean? = null private var enablePreparedTextLayoutCache: Boolean? = null private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null private var enableRuntimeSchedulerQueueClearingOnErrorCache: Boolean? = null @@ -78,7 +77,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var fuseboxAssertSingleHostStateCache: Boolean? = null private var fuseboxEnabledReleaseCache: Boolean? = null private var fuseboxFrameRecordingEnabledCache: Boolean? = null - private var fuseboxNetworkInspectionEnabledCache: Boolean? = null private var fuseboxScreenshotCaptureEnabledCache: Boolean? = null private var optimizedAnimatedPropUpdatesCache: Boolean? = null private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null @@ -458,15 +456,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun enableNetworkEventReporting(): Boolean { - var cached = enableNetworkEventReportingCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.enableNetworkEventReporting() - enableNetworkEventReportingCache = cached - } - return cached - } - override fun enablePreparedTextLayout(): Boolean { var cached = enablePreparedTextLayoutCache if (cached == null) { @@ -629,15 +618,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun fuseboxNetworkInspectionEnabled(): Boolean { - var cached = fuseboxNetworkInspectionEnabledCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.fuseboxNetworkInspectionEnabled() - fuseboxNetworkInspectionEnabledCache = cached - } - return cached - } - override fun fuseboxScreenshotCaptureEnabled(): Boolean { var cached = fuseboxScreenshotCaptureEnabledCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 2f1a0cfc504d..6768dbcf0fb7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -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<<8b1c3206f7e63790e411f57c2dd64076>> + * @generated SignedSource<<4020237259428ba43c7356eed4cd0daa>> */ /** @@ -106,8 +106,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun enableNativeCSSParsing(): Boolean - @DoNotStrip @JvmStatic public external fun enableNetworkEventReporting(): Boolean - @DoNotStrip @JvmStatic public external fun enablePreparedTextLayout(): Boolean @DoNotStrip @JvmStatic public external fun enablePropsUpdateReconciliationAndroid(): Boolean @@ -144,8 +142,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun fuseboxFrameRecordingEnabled(): Boolean - @DoNotStrip @JvmStatic public external fun fuseboxNetworkInspectionEnabled(): Boolean - @DoNotStrip @JvmStatic public external fun fuseboxScreenshotCaptureEnabled(): Boolean @DoNotStrip @JvmStatic public external fun optimizedAnimatedPropUpdates(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 3a4142d20d16..f3b4d52497d7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -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<<5c36c0a5e9e67b43016ab02eab0ecd8f>> + * @generated SignedSource<<7f92f286423bf5ca463a29f95184dab3>> */ /** @@ -101,8 +101,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableNativeCSSParsing(): Boolean = false - override fun enableNetworkEventReporting(): Boolean = true - override fun enablePreparedTextLayout(): Boolean = false override fun enablePropsUpdateReconciliationAndroid(): Boolean = false @@ -139,8 +137,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun fuseboxFrameRecordingEnabled(): Boolean = false - override fun fuseboxNetworkInspectionEnabled(): Boolean = true - override fun fuseboxScreenshotCaptureEnabled(): Boolean = false override fun optimizedAnimatedPropUpdates(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index b274311cd9d2..eeee9b9e811c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -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<<98a6085638c86aaa012c8bd972627ad4>> + * @generated SignedSource<> */ /** @@ -63,7 +63,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null private var enableMutationObserverByDefaultCache: Boolean? = null private var enableNativeCSSParsingCache: Boolean? = null - private var enableNetworkEventReportingCache: Boolean? = null private var enablePreparedTextLayoutCache: Boolean? = null private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null private var enableRuntimeSchedulerQueueClearingOnErrorCache: Boolean? = null @@ -82,7 +81,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var fuseboxAssertSingleHostStateCache: Boolean? = null private var fuseboxEnabledReleaseCache: Boolean? = null private var fuseboxFrameRecordingEnabledCache: Boolean? = null - private var fuseboxNetworkInspectionEnabledCache: Boolean? = null private var fuseboxScreenshotCaptureEnabledCache: Boolean? = null private var optimizedAnimatedPropUpdatesCache: Boolean? = null private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null @@ -501,16 +499,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun enableNetworkEventReporting(): Boolean { - var cached = enableNetworkEventReportingCache - if (cached == null) { - cached = currentProvider.enableNetworkEventReporting() - accessedFeatureFlags.add("enableNetworkEventReporting") - enableNetworkEventReportingCache = cached - } - return cached - } - override fun enablePreparedTextLayout(): Boolean { var cached = enablePreparedTextLayoutCache if (cached == null) { @@ -691,16 +679,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun fuseboxNetworkInspectionEnabled(): Boolean { - var cached = fuseboxNetworkInspectionEnabledCache - if (cached == null) { - cached = currentProvider.fuseboxNetworkInspectionEnabled() - accessedFeatureFlags.add("fuseboxNetworkInspectionEnabled") - fuseboxNetworkInspectionEnabledCache = cached - } - return cached - } - override fun fuseboxScreenshotCaptureEnabled(): Boolean { var cached = fuseboxScreenshotCaptureEnabledCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index c611198dac44..1d595c4ed9f7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -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<<8b5a9f8966d9f096b7fa4f7020db1f34>> + * @generated SignedSource<> */ /** @@ -101,8 +101,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableNativeCSSParsing(): Boolean - @DoNotStrip public fun enableNetworkEventReporting(): Boolean - @DoNotStrip public fun enablePreparedTextLayout(): Boolean @DoNotStrip public fun enablePropsUpdateReconciliationAndroid(): Boolean @@ -139,8 +137,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun fuseboxFrameRecordingEnabled(): Boolean - @DoNotStrip public fun fuseboxNetworkInspectionEnabled(): Boolean - @DoNotStrip public fun fuseboxScreenshotCaptureEnabled(): Boolean @DoNotStrip public fun optimizedAnimatedPropUpdates(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt index dbb0d746ad21..39518f7342c1 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt @@ -15,7 +15,6 @@ import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.WritableMap import com.facebook.react.bridge.buildReadableArray -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import java.io.IOException import java.net.SocketTimeoutException import okhttp3.Headers @@ -39,17 +38,15 @@ internal object NetworkEventUtil { requestBodyForDevTools: String?, encodedDataLength: Long, ) { - if (ReactNativeFeatureFlags.enableNetworkEventReporting()) { - InspectorNetworkReporter.reportRequestStart( - devToolsRequestId, - requestUrl, - requestMethod, - requestHeaders, - requestBodyForDevTools.orEmpty(), - encodedDataLength, - ) - InspectorNetworkReporter.reportConnectionTiming(devToolsRequestId, requestHeaders) - } + InspectorNetworkReporter.reportRequestStart( + devToolsRequestId, + requestUrl, + requestMethod, + requestHeaders, + requestBodyForDevTools.orEmpty(), + encodedDataLength, + ) + InspectorNetworkReporter.reportConnectionTiming(devToolsRequestId, requestHeaders) } @JvmStatic @@ -78,7 +75,7 @@ internal object NetworkEventUtil { progress: Long, total: Long, ) { - if (ReactNativeFeatureFlags.enableNetworkEventReporting() && data != null) { + if (data != null) { InspectorNetworkReporter.reportDataReceived(devToolsRequestId, data) InspectorNetworkReporter.maybeStoreResponseBodyIncremental(devToolsRequestId, data) } @@ -118,13 +115,11 @@ internal object NetworkEventUtil { data: String?, responseType: String, ) { - if (ReactNativeFeatureFlags.enableNetworkEventReporting()) { - InspectorNetworkReporter.maybeStoreResponseBody( - devToolsRequestId, - data.orEmpty(), - responseType == "base64", - ) - } + InspectorNetworkReporter.maybeStoreResponseBody( + devToolsRequestId, + data.orEmpty(), + responseType == "base64", + ) reactContext?.emitDeviceEvent( "didReceiveNetworkData", buildReadableArray { @@ -142,13 +137,11 @@ internal object NetworkEventUtil { data: WritableMap, rawData: ByteArray, ) { - if (ReactNativeFeatureFlags.enableNetworkEventReporting()) { - InspectorNetworkReporter.maybeStoreResponseBody( - devToolsRequestId, - Base64.encodeToString(rawData, Base64.NO_WRAP), - true, - ) - } + InspectorNetworkReporter.maybeStoreResponseBody( + devToolsRequestId, + Base64.encodeToString(rawData, Base64.NO_WRAP), + true, + ) reactContext?.emitDeviceEvent( "didReceiveNetworkData", Arguments.createArray().apply { @@ -166,9 +159,7 @@ internal object NetworkEventUtil { error: String?, e: Throwable?, ) { - if (ReactNativeFeatureFlags.enableNetworkEventReporting()) { - InspectorNetworkReporter.reportRequestFailed(devToolsRequestId, false) - } + InspectorNetworkReporter.reportRequestFailed(devToolsRequestId, false) reactContext?.emitDeviceEvent( "didCompleteNetworkResponse", buildReadableArray { @@ -188,9 +179,7 @@ internal object NetworkEventUtil { devToolsRequestId: String, encodedDataLength: Long, ) { - if (ReactNativeFeatureFlags.enableNetworkEventReporting()) { - InspectorNetworkReporter.reportResponseEnd(devToolsRequestId, encodedDataLength) - } + InspectorNetworkReporter.reportResponseEnd(devToolsRequestId, encodedDataLength) reactContext?.emitDeviceEvent( "didCompleteNetworkResponse", buildReadableArray { @@ -215,15 +204,13 @@ internal object NetworkEventUtil { headersBundle.putString(headerName, headerValue) } - if (ReactNativeFeatureFlags.enableNetworkEventReporting()) { - InspectorNetworkReporter.reportResponseStart( - devToolsRequestId, - requestUrl.orEmpty(), - statusCode, - headers, - contentLength, - ) - } + InspectorNetworkReporter.reportResponseStart( + devToolsRequestId, + requestUrl.orEmpty(), + statusCode, + headers, + contentLength, + ) reactContext?.emitDeviceEvent( "didReceiveNetworkResponse", Arguments.createArray().apply { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 09be85cdc306..6386655a8077 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -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<> + * @generated SignedSource<<8765b2b0fb5b1f2a29bb17dc64b6c4e8>> */ /** @@ -273,12 +273,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool enableNetworkEventReporting() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableNetworkEventReporting"); - return method(javaProvider_); - } - bool enablePreparedTextLayout() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enablePreparedTextLayout"); @@ -387,12 +381,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool fuseboxNetworkInspectionEnabled() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fuseboxNetworkInspectionEnabled"); - return method(javaProvider_); - } - bool fuseboxScreenshotCaptureEnabled() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fuseboxScreenshotCaptureEnabled"); @@ -754,11 +742,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing( return ReactNativeFeatureFlags::enableNativeCSSParsing(); } -bool JReactNativeFeatureFlagsCxxInterop::enableNetworkEventReporting( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::enableNetworkEventReporting(); -} - bool JReactNativeFeatureFlagsCxxInterop::enablePreparedTextLayout( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::enablePreparedTextLayout(); @@ -849,11 +832,6 @@ bool JReactNativeFeatureFlagsCxxInterop::fuseboxFrameRecordingEnabled( return ReactNativeFeatureFlags::fuseboxFrameRecordingEnabled(); } -bool JReactNativeFeatureFlagsCxxInterop::fuseboxNetworkInspectionEnabled( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled(); -} - bool JReactNativeFeatureFlagsCxxInterop::fuseboxScreenshotCaptureEnabled( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled(); @@ -1137,9 +1115,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableNativeCSSParsing", JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing), - makeNativeMethod( - "enableNetworkEventReporting", - JReactNativeFeatureFlagsCxxInterop::enableNetworkEventReporting), makeNativeMethod( "enablePreparedTextLayout", JReactNativeFeatureFlagsCxxInterop::enablePreparedTextLayout), @@ -1194,9 +1169,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "fuseboxFrameRecordingEnabled", JReactNativeFeatureFlagsCxxInterop::fuseboxFrameRecordingEnabled), - makeNativeMethod( - "fuseboxNetworkInspectionEnabled", - JReactNativeFeatureFlagsCxxInterop::fuseboxNetworkInspectionEnabled), makeNativeMethod( "fuseboxScreenshotCaptureEnabled", JReactNativeFeatureFlagsCxxInterop::fuseboxScreenshotCaptureEnabled), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index 2de55550ee3a..b7f418a4f70c 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -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<> + * @generated SignedSource<<7d88313f51b23fd880ff1c169ccab1cc>> */ /** @@ -147,9 +147,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableNativeCSSParsing( facebook::jni::alias_ref); - static bool enableNetworkEventReporting( - facebook::jni::alias_ref); - static bool enablePreparedTextLayout( facebook::jni::alias_ref); @@ -204,9 +201,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool fuseboxFrameRecordingEnabled( facebook::jni::alias_ref); - static bool fuseboxNetworkInspectionEnabled( - facebook::jni::alias_ref); - static bool fuseboxScreenshotCaptureEnabled( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkEventUtilTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkEventUtilTest.kt index 1f3cc38b19c8..b1937945a76a 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkEventUtilTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkEventUtilTest.kt @@ -13,17 +13,15 @@ import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.WritableArray import com.facebook.react.bridge.WritableMap -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsDefaults -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests import com.facebook.testutils.shadows.ShadowArguments +import com.facebook.testutils.shadows.ShadowInspectorNetworkReporter +import com.facebook.testutils.shadows.ShadowSoLoader import java.io.ByteArrayInputStream import java.net.SocketTimeoutException import okhttp3.MediaType import okhttp3.MultipartBody import okhttp3.RequestBody import org.assertj.core.api.Assertions.assertThat -import org.junit.After import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -35,7 +33,9 @@ import org.mockito.kotlin.verify import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config -@Config(shadows = [ShadowArguments::class]) +@Config( + shadows = [ShadowArguments::class, ShadowSoLoader::class, ShadowInspectorNetworkReporter::class] +) @RunWith(RobolectricTestRunner::class) class NetworkEventUtilTest { private lateinit var reactContext: ReactApplicationContext @@ -43,18 +43,6 @@ class NetworkEventUtilTest { @Before fun setUp() { reactContext = mock() - - ReactNativeFeatureFlagsForTests.setUp() - ReactNativeFeatureFlags.override( - object : ReactNativeFeatureFlagsDefaults() { - override fun enableNetworkEventReporting(): Boolean = false - } - ) - } - - @After - fun tearDown() { - ReactNativeFeatureFlags.dangerouslyReset() } @Test diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.kt index 29a1acedb893..b8b6555bd8f3 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.kt @@ -17,10 +17,9 @@ import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.WritableArray import com.facebook.react.bridge.WritableMap import com.facebook.react.common.network.OkHttpCallUtil -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsDefaults -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests import com.facebook.testutils.shadows.ShadowArguments +import com.facebook.testutils.shadows.ShadowInspectorNetworkReporter +import com.facebook.testutils.shadows.ShadowSoLoader import java.io.IOException import java.io.InputStream import java.nio.charset.StandardCharsets @@ -54,7 +53,9 @@ import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config /** Tests [NetworkingModule] */ -@Config(shadows = [ShadowArguments::class]) +@Config( + shadows = [ShadowArguments::class, ShadowSoLoader::class, ShadowInspectorNetworkReporter::class] +) @RunWith(RobolectricTestRunner::class) class NetworkingModuleTest { @@ -78,13 +79,6 @@ class NetworkingModuleTest { context = mock() whenever(context.hasActiveReactInstance()).thenReturn(true) - ReactNativeFeatureFlagsForTests.setUp() - ReactNativeFeatureFlags.override( - object : ReactNativeFeatureFlagsDefaults() { - override fun enableNetworkEventReporting(): Boolean = false - } - ) - networkingModule = NetworkingModule(context, "", httpClient, null) okHttpCallUtil = mockStatic(OkHttpCallUtil::class.java) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowInspectorNetworkReporter.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowInspectorNetworkReporter.kt new file mode 100644 index 000000000000..1267f847b451 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/testutils/shadows/ShadowInspectorNetworkReporter.kt @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package com.facebook.testutils.shadows + +import org.robolectric.annotation.Implementation +import org.robolectric.annotation.Implements + +/** + * Robolectric shadow that stubs out `InspectorNetworkReporter`'s JNI methods, so that tests + * exercising `NetworkEventUtil` do not attempt to call into the `react_devsupportjni` native + * library. `isDebuggingEnabled` returns `false`, which also short-circuits the reporting wrappers + * that guard on it (e.g. `reportDataReceived`, `maybeStoreResponseBody`). + */ +@Suppress("UNUSED_PARAMETER") +@Implements(className = "com.facebook.react.modules.network.InspectorNetworkReporter") +class ShadowInspectorNetworkReporter { + companion object { + @JvmStatic @Implementation fun isDebuggingEnabled(): Boolean = false + + @JvmStatic + @Implementation + fun reportRequestStart( + requestId: String, + requestUrl: String, + requestMethod: String, + requestHeaders: Map, + requestBody: String, + encodedDataLength: Long, + ) {} + + @JvmStatic + @Implementation + fun reportConnectionTiming(requestId: String, headers: Map) {} + + @JvmStatic + @Implementation + fun reportResponseStart( + requestId: String, + requestUrl: String, + responseStatus: Int, + responseHeaders: Map, + expectedDataLength: Long, + ) {} + + @JvmStatic @Implementation fun reportResponseEnd(requestId: String, encodedDataLength: Long) {} + + @JvmStatic @Implementation fun reportRequestFailed(requestId: String, cancelled: Boolean) {} + } +} diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp index 6c64e2f1393c..0b2aa23fde83 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp @@ -82,8 +82,7 @@ const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged() false, #endif .networkInspectionEnabled = - ReactNativeFeatureFlags::enableBridgelessArchitecture() && - ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled(), + ReactNativeFeatureFlags::enableBridgelessArchitecture(), .perfIssuesEnabled = ReactNativeFeatureFlags::perfIssuesEnabled(), }; diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp index 678a8c164533..186d0c29eb37 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp @@ -19,9 +19,7 @@ namespace facebook::react::jsinspector_modern { namespace { -struct NetworkReporterTestParams { - bool enableNetworkEventReporting; -}; +struct NetworkReporterTestParams {}; } // namespace @@ -38,9 +36,6 @@ class NetworkReporterTestBase : public TracingTestBase< protected: NetworkReporterTestBase() : TracingTestBase({ - .enableNetworkEventReporting = - WithParamInterface::GetParam() - .enableNetworkEventReporting, .networkInspectionEnabled = true, }) {} @@ -623,13 +618,10 @@ TEST_P(NetworkReporterTest, testTwoSessionsReceiveNetworkEvents) { } struct NetworkReporterTracingTestParams { - bool enableNetworkEventReporting; bool enableNetworkDomain; operator NetworkReporterTestParams() const { - return NetworkReporterTestParams{ - .enableNetworkEventReporting = enableNetworkEventReporting, - }; + return NetworkReporterTestParams{}; } }; @@ -802,19 +794,12 @@ TEST_P( AtJsonPtr("/args/data/didFail", false)))); } -static const auto networkReporterTestParamValues = testing::Values( - NetworkReporterTestParams{.enableNetworkEventReporting = true}, - NetworkReporterTestParams{ - .enableNetworkEventReporting = false, - }); +static const auto networkReporterTestParamValues = + testing::Values(NetworkReporterTestParams{}); static const auto networkReporterTracingTestParamValues = testing::Values( - NetworkReporterTracingTestParams{ - .enableNetworkEventReporting = true, - .enableNetworkDomain = true}, - NetworkReporterTracingTestParams{ - .enableNetworkEventReporting = true, - .enableNetworkDomain = false}); + NetworkReporterTracingTestParams{.enableNetworkDomain = true}, + NetworkReporterTracingTestParams{.enableNetworkDomain = false}); INSTANTIATE_TEST_SUITE_P( NetworkReporterTest, diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp index 17a83c994139..2fcdffd4d339 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp @@ -41,23 +41,12 @@ class ReactNativeFeatureFlagsOverrides ReactNativeFeatureFlagsDefaults::fuseboxFrameRecordingEnabled()); } - bool fuseboxNetworkInspectionEnabled() override { - return overrides_.networkInspectionEnabled.value_or( - ReactNativeFeatureFlagsDefaults::fuseboxNetworkInspectionEnabled()); - } - bool enableBridgelessArchitecture() override { - // NOTE: Network support is gated by (enableBridgelessArchitecture && - // fuseboxNetworkInspectionEnabled). + // NOTE: Network support is gated by enableBridgelessArchitecture. return overrides_.networkInspectionEnabled.value_or( ReactNativeFeatureFlagsDefaults::enableBridgelessArchitecture()); } - bool enableNetworkEventReporting() override { - return overrides_.enableNetworkEventReporting.value_or( - ReactNativeFeatureFlagsDefaults::enableNetworkEventReporting()); - } - private: InspectorFlagOverrides overrides_; }; diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h b/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h index 12122b3f2d72..cb8f69f07792 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h @@ -20,7 +20,6 @@ struct InspectorFlagOverrides { // NOTE: Keep these entries in sync with ReactNativeFeatureFlagsOverrides in // the implementation file. std::optional screenshotCaptureEnabled; - std::optional enableNetworkEventReporting; std::optional frameRecordingEnabled; std::optional fuseboxEnabledRelease; std::optional networkInspectionEnabled; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 8e65a9654b44..9ea6b0fb5c1b 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -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<> + * @generated SignedSource<<003386e2169181d842470e62b37a23ea>> */ /** @@ -182,10 +182,6 @@ bool ReactNativeFeatureFlags::enableNativeCSSParsing() { return getAccessor().enableNativeCSSParsing(); } -bool ReactNativeFeatureFlags::enableNetworkEventReporting() { - return getAccessor().enableNetworkEventReporting(); -} - bool ReactNativeFeatureFlags::enablePreparedTextLayout() { return getAccessor().enablePreparedTextLayout(); } @@ -258,10 +254,6 @@ bool ReactNativeFeatureFlags::fuseboxFrameRecordingEnabled() { return getAccessor().fuseboxFrameRecordingEnabled(); } -bool ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled() { - return getAccessor().fuseboxNetworkInspectionEnabled(); -} - bool ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled() { return getAccessor().fuseboxScreenshotCaptureEnabled(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index ec0b8ce66b86..63c2147ec083 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -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<<5c7e2061344bf998e5fc6b621af2ff45>> + * @generated SignedSource<<4bde8437183a605eb44f86e63bd907c2>> */ /** @@ -234,11 +234,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool enableNativeCSSParsing(); - /** - * Enable network event reporting hooks in each native platform through `NetworkReporter` (Web Perf APIs + CDP). This flag should be combined with `fuseboxNetworkInspectionEnabled` to enable Network CDP debugging. - */ - RN_EXPORT static bool enableNetworkEventReporting(); - /** * Enables caching text layout artifacts for later reuse */ @@ -329,11 +324,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool fuseboxFrameRecordingEnabled(); - /** - * Enable network inspection support in the React Native DevTools CDP backend. Requires `enableBridgelessArchitecture`. This flag is global and should not be changed across React Host lifetimes. - */ - RN_EXPORT static bool fuseboxNetworkInspectionEnabled(); - /** * Enable Page.captureScreenshot CDP method support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 041bc351eac9..ac4e02c9519f 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -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<<2aee1d5b6266189201bb6f5f6c0ceb4c>> + * @generated SignedSource<> */ /** @@ -731,24 +731,6 @@ bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::enableNetworkEventReporting() { - auto flagValue = enableNetworkEventReporting_.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(39, "enableNetworkEventReporting"); - - flagValue = currentProvider_->enableNetworkEventReporting(); - enableNetworkEventReporting_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() { auto flagValue = enablePreparedTextLayout_.load(); @@ -758,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(40, "enablePreparedTextLayout"); + markFlagAsAccessed(39, "enablePreparedTextLayout"); flagValue = currentProvider_->enablePreparedTextLayout(); enablePreparedTextLayout_ = flagValue; @@ -776,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(41, "enablePropsUpdateReconciliationAndroid"); + markFlagAsAccessed(40, "enablePropsUpdateReconciliationAndroid"); flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid(); enablePropsUpdateReconciliationAndroid_ = flagValue; @@ -794,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::enableRuntimeSchedulerQueueClearingOnError // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(42, "enableRuntimeSchedulerQueueClearingOnError"); + markFlagAsAccessed(41, "enableRuntimeSchedulerQueueClearingOnError"); flagValue = currentProvider_->enableRuntimeSchedulerQueueClearingOnError(); enableRuntimeSchedulerQueueClearingOnError_ = flagValue; @@ -812,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSchedulerDelegateInvalidation() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(43, "enableSchedulerDelegateInvalidation"); + markFlagAsAccessed(42, "enableSchedulerDelegateInvalidation"); flagValue = currentProvider_->enableSchedulerDelegateInvalidation(); enableSchedulerDelegateInvalidation_ = flagValue; @@ -830,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(44, "enableSwiftUIBasedFilters"); + markFlagAsAccessed(43, "enableSwiftUIBasedFilters"); flagValue = currentProvider_->enableSwiftUIBasedFilters(); enableSwiftUIBasedFilters_ = flagValue; @@ -848,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewCulling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(45, "enableViewCulling"); + markFlagAsAccessed(44, "enableViewCulling"); flagValue = currentProvider_->enableViewCulling(); enableViewCulling_ = flagValue; @@ -866,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(46, "enableViewRecycling"); + markFlagAsAccessed(45, "enableViewRecycling"); flagValue = currentProvider_->enableViewRecycling(); enableViewRecycling_ = flagValue; @@ -884,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(47, "enableViewRecyclingForImage"); + markFlagAsAccessed(46, "enableViewRecyclingForImage"); flagValue = currentProvider_->enableViewRecyclingForImage(); enableViewRecyclingForImage_ = flagValue; @@ -902,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(48, "enableViewRecyclingForScrollView"); + markFlagAsAccessed(47, "enableViewRecyclingForScrollView"); flagValue = currentProvider_->enableViewRecyclingForScrollView(); enableViewRecyclingForScrollView_ = flagValue; @@ -920,7 +902,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForText() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(49, "enableViewRecyclingForText"); + markFlagAsAccessed(48, "enableViewRecyclingForText"); flagValue = currentProvider_->enableViewRecyclingForText(); enableViewRecyclingForText_ = flagValue; @@ -938,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(50, "enableViewRecyclingForView"); + markFlagAsAccessed(49, "enableViewRecyclingForView"); flagValue = currentProvider_->enableViewRecyclingForView(); enableViewRecyclingForView_ = flagValue; @@ -956,7 +938,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(51, "enableVirtualViewContainerStateExperimental"); + markFlagAsAccessed(50, "enableVirtualViewContainerStateExperimental"); flagValue = currentProvider_->enableVirtualViewContainerStateExperimental(); enableVirtualViewContainerStateExperimental_ = flagValue; @@ -974,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorParentTagForUnflattenCase // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(52, "fixDifferentiatorParentTagForUnflattenCase"); + markFlagAsAccessed(51, "fixDifferentiatorParentTagForUnflattenCase"); flagValue = currentProvider_->fixDifferentiatorParentTagForUnflattenCase(); fixDifferentiatorParentTagForUnflattenCase_ = flagValue; @@ -992,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(53, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(52, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -1010,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(54, "fixYogaFlexBasisFitContentInMainAxis"); + markFlagAsAccessed(53, "fixYogaFlexBasisFitContentInMainAxis"); flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis(); fixYogaFlexBasisFitContentInMainAxis_ = flagValue; @@ -1028,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(55, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(54, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1046,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(56, "fuseboxEnabledRelease"); + markFlagAsAccessed(55, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1064,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(57, "fuseboxFrameRecordingEnabled"); + markFlagAsAccessed(56, "fuseboxFrameRecordingEnabled"); flagValue = currentProvider_->fuseboxFrameRecordingEnabled(); fuseboxFrameRecordingEnabled_ = flagValue; @@ -1073,24 +1055,6 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::fuseboxNetworkInspectionEnabled() { - auto flagValue = fuseboxNetworkInspectionEnabled_.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(58, "fuseboxNetworkInspectionEnabled"); - - flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); - fuseboxNetworkInspectionEnabled_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() { auto flagValue = fuseboxScreenshotCaptureEnabled_.load(); @@ -1100,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(59, "fuseboxScreenshotCaptureEnabled"); + markFlagAsAccessed(57, "fuseboxScreenshotCaptureEnabled"); flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled(); fuseboxScreenshotCaptureEnabled_ = flagValue; @@ -1118,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "optimizedAnimatedPropUpdates"); + markFlagAsAccessed(58, "optimizedAnimatedPropUpdates"); flagValue = currentProvider_->optimizedAnimatedPropUpdates(); optimizedAnimatedPropUpdates_ = flagValue; @@ -1136,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(61, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(59, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1154,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(62, "perfIssuesEnabled"); + markFlagAsAccessed(60, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1172,7 +1136,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(63, "perfMonitorV2Enabled"); + markFlagAsAccessed(61, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1190,7 +1154,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(64, "preparedTextCacheSize"); + markFlagAsAccessed(62, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1208,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(65, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(63, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1226,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "redBoxV2Android"); + markFlagAsAccessed(64, "redBoxV2Android"); flagValue = currentProvider_->redBoxV2Android(); redBoxV2Android_ = flagValue; @@ -1244,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "redBoxV2IOS"); + markFlagAsAccessed(65, "redBoxV2IOS"); flagValue = currentProvider_->redBoxV2IOS(); redBoxV2IOS_ = flagValue; @@ -1262,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(66, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1280,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(67, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1298,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(70, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(68, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1316,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "syncAndroidClipBoundsWithOverflow"); + markFlagAsAccessed(69, "syncAndroidClipBoundsWithOverflow"); flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow(); syncAndroidClipBoundsWithOverflow_ = flagValue; @@ -1334,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(70, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1352,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(71, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1370,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommitT // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "updateRuntimeShadowNodeReferencesOnCommitThread"); + markFlagAsAccessed(72, "updateRuntimeShadowNodeReferencesOnCommitThread"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread(); updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue; @@ -1388,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(73, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1406,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useFabricInterop"); + markFlagAsAccessed(74, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1424,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(75, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1442,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useNestedScrollViewAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useNestedScrollViewAndroid"); + markFlagAsAccessed(76, "useNestedScrollViewAndroid"); flagValue = currentProvider_->useNestedScrollViewAndroid(); useNestedScrollViewAndroid_ = flagValue; @@ -1460,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useSharedAnimatedBackend"); + markFlagAsAccessed(77, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1478,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(78, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1496,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "useTurboModuleInterop"); + markFlagAsAccessed(79, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1514,7 +1478,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(82, "viewCullingOutsetRatio"); + markFlagAsAccessed(80, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1532,7 +1496,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(83, "viewTransitionEnabled"); + markFlagAsAccessed(81, "viewTransitionEnabled"); flagValue = currentProvider_->viewTransitionEnabled(); viewTransitionEnabled_ = flagValue; @@ -1550,7 +1514,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(84, "viewTransitionUseHardwareBitmapAndroid"); + markFlagAsAccessed(82, "viewTransitionUseHardwareBitmapAndroid"); flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid(); viewTransitionUseHardwareBitmapAndroid_ = flagValue; @@ -1568,7 +1532,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(85, "virtualViewPrerenderRatio"); + markFlagAsAccessed(83, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index cf3369c9aa0f..31b5e2d35186 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -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<> + * @generated SignedSource<<658c25b18788bb0a66544dffd0602c1e>> */ /** @@ -71,7 +71,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableModuleArgumentNSNullConversionIOS(); bool enableMutationObserverByDefault(); bool enableNativeCSSParsing(); - bool enableNetworkEventReporting(); bool enablePreparedTextLayout(); bool enablePropsUpdateReconciliationAndroid(); bool enableRuntimeSchedulerQueueClearingOnError(); @@ -90,7 +89,6 @@ class ReactNativeFeatureFlagsAccessor { bool fuseboxAssertSingleHostState(); bool fuseboxEnabledRelease(); bool fuseboxFrameRecordingEnabled(); - bool fuseboxNetworkInspectionEnabled(); bool fuseboxScreenshotCaptureEnabled(); bool optimizedAnimatedPropUpdates(); bool overrideBySynchronousMountPropsAtMountingAndroid(); @@ -129,7 +127,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 86> accessedFeatureFlags_; + std::array, 84> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -170,7 +168,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableModuleArgumentNSNullConversionIOS_; std::atomic> enableMutationObserverByDefault_; std::atomic> enableNativeCSSParsing_; - std::atomic> enableNetworkEventReporting_; std::atomic> enablePreparedTextLayout_; std::atomic> enablePropsUpdateReconciliationAndroid_; std::atomic> enableRuntimeSchedulerQueueClearingOnError_; @@ -189,7 +186,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> fuseboxAssertSingleHostState_; std::atomic> fuseboxEnabledRelease_; std::atomic> fuseboxFrameRecordingEnabled_; - std::atomic> fuseboxNetworkInspectionEnabled_; std::atomic> fuseboxScreenshotCaptureEnabled_; std::atomic> optimizedAnimatedPropUpdates_; std::atomic> overrideBySynchronousMountPropsAtMountingAndroid_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index e9403a7c6ebd..b880a8f26147 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -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<> + * @generated SignedSource<> */ /** @@ -183,10 +183,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool enableNetworkEventReporting() override { - return true; - } - bool enablePreparedTextLayout() override { return false; } @@ -259,10 +255,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool fuseboxNetworkInspectionEnabled() override { - return true; - } - bool fuseboxScreenshotCaptureEnabled() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 3fb33d362dac..769b71252ca3 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -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<> + * @generated SignedSource<<5503609276a95792ab72907f3c5a4266>> */ /** @@ -396,15 +396,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::enableNativeCSSParsing(); } - bool enableNetworkEventReporting() override { - auto value = values_["enableNetworkEventReporting"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::enableNetworkEventReporting(); - } - bool enablePreparedTextLayout() override { auto value = values_["enablePreparedTextLayout"]; if (!value.isNull()) { @@ -567,15 +558,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::fuseboxFrameRecordingEnabled(); } - bool fuseboxNetworkInspectionEnabled() override { - auto value = values_["fuseboxNetworkInspectionEnabled"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::fuseboxNetworkInspectionEnabled(); - } - bool fuseboxScreenshotCaptureEnabled() override { auto value = values_["fuseboxScreenshotCaptureEnabled"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 93d5f232ac49..d48fa0615522 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -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<<14cafde581fa0fb72ffebb5e192040e8>> + * @generated SignedSource<<885c73711c6623fabaeb678aabb9d3b3>> */ /** @@ -64,7 +64,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableModuleArgumentNSNullConversionIOS() = 0; virtual bool enableMutationObserverByDefault() = 0; virtual bool enableNativeCSSParsing() = 0; - virtual bool enableNetworkEventReporting() = 0; virtual bool enablePreparedTextLayout() = 0; virtual bool enablePropsUpdateReconciliationAndroid() = 0; virtual bool enableRuntimeSchedulerQueueClearingOnError() = 0; @@ -83,7 +82,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool fuseboxAssertSingleHostState() = 0; virtual bool fuseboxEnabledRelease() = 0; virtual bool fuseboxFrameRecordingEnabled() = 0; - virtual bool fuseboxNetworkInspectionEnabled() = 0; virtual bool fuseboxScreenshotCaptureEnabled() = 0; virtual bool optimizedAnimatedPropUpdates() = 0; virtual bool overrideBySynchronousMountPropsAtMountingAndroid() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 8e627b8ace38..fdd5ac7c13a1 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -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<<1e26f8dc1f474475c0a4d6be79aedb24>> + * @generated SignedSource<> */ /** @@ -239,11 +239,6 @@ bool NativeReactNativeFeatureFlags::enableNativeCSSParsing( return ReactNativeFeatureFlags::enableNativeCSSParsing(); } -bool NativeReactNativeFeatureFlags::enableNetworkEventReporting( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::enableNetworkEventReporting(); -} - bool NativeReactNativeFeatureFlags::enablePreparedTextLayout( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::enablePreparedTextLayout(); @@ -334,11 +329,6 @@ bool NativeReactNativeFeatureFlags::fuseboxFrameRecordingEnabled( return ReactNativeFeatureFlags::fuseboxFrameRecordingEnabled(); } -bool NativeReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled(); -} - bool NativeReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index d0acb696863d..a9125a5c191d 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -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<<86a4b76371a4005f7083c3806d53cc87>> + * @generated SignedSource<<34c4a58e9d9141b3570bed12d9009153>> */ /** @@ -114,8 +114,6 @@ class NativeReactNativeFeatureFlags bool enableNativeCSSParsing(jsi::Runtime& runtime); - bool enableNetworkEventReporting(jsi::Runtime& runtime); - bool enablePreparedTextLayout(jsi::Runtime& runtime); bool enablePropsUpdateReconciliationAndroid(jsi::Runtime& runtime); @@ -152,8 +150,6 @@ class NativeReactNativeFeatureFlags bool fuseboxFrameRecordingEnabled(jsi::Runtime& runtime); - bool fuseboxNetworkInspectionEnabled(jsi::Runtime& runtime); - bool fuseboxScreenshotCaptureEnabled(jsi::Runtime& runtime); bool optimizedAnimatedPropUpdates(jsi::Runtime& runtime); diff --git a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp index 1e839df71332..2fc54cad4c3c 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp +++ b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -29,12 +28,9 @@ std::vector getSupportedEntryTypesInternal() { PerformanceEntryType::MEASURE, PerformanceEntryType::EVENT, PerformanceEntryType::LONGTASK, + PerformanceEntryType::RESOURCE, }; - if (ReactNativeFeatureFlags::enableNetworkEventReporting()) { - supportedEntryTypes.emplace_back(PerformanceEntryType::RESOURCE); - } - return supportedEntryTypes; } diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 792f79594b2b..63ad42a0bf2d 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -463,16 +463,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - enableNetworkEventReporting: { - defaultValue: true, - metadata: { - description: - 'Enable network event reporting hooks in each native platform through `NetworkReporter` (Web Perf APIs + CDP). This flag should be combined with `fuseboxNetworkInspectionEnabled` to enable Network CDP debugging.', - expectedReleaseValue: true, - purpose: 'release', - }, - ossReleaseStage: 'none', - }, enablePreparedTextLayout: { defaultValue: false, metadata: { @@ -668,17 +658,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - fuseboxNetworkInspectionEnabled: { - defaultValue: true, - metadata: { - dateAdded: '2024-01-31', - description: - 'Enable network inspection support in the React Native DevTools CDP backend. Requires `enableBridgelessArchitecture`. This flag is global and should not be changed across React Host lifetimes.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, fuseboxScreenshotCaptureEnabled: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 806a8ad0fcfd..005f3816a3d4 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -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<> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -88,7 +88,6 @@ export type ReactNativeFeatureFlags = Readonly<{ enableModuleArgumentNSNullConversionIOS: Getter, enableMutationObserverByDefault: Getter, enableNativeCSSParsing: Getter, - enableNetworkEventReporting: Getter, enablePreparedTextLayout: Getter, enablePropsUpdateReconciliationAndroid: Getter, enableRuntimeSchedulerQueueClearingOnError: Getter, @@ -107,7 +106,6 @@ export type ReactNativeFeatureFlags = Readonly<{ fuseboxAssertSingleHostState: Getter, fuseboxEnabledRelease: Getter, fuseboxFrameRecordingEnabled: Getter, - fuseboxNetworkInspectionEnabled: Getter, fuseboxScreenshotCaptureEnabled: Getter, optimizedAnimatedPropUpdates: Getter, overrideBySynchronousMountPropsAtMountingAndroid: Getter, @@ -367,10 +365,6 @@ export const enableMutationObserverByDefault: Getter = createNativeFlag * Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing */ export const enableNativeCSSParsing: Getter = createNativeFlagGetter('enableNativeCSSParsing', false); -/** - * Enable network event reporting hooks in each native platform through `NetworkReporter` (Web Perf APIs + CDP). This flag should be combined with `fuseboxNetworkInspectionEnabled` to enable Network CDP debugging. - */ -export const enableNetworkEventReporting: Getter = createNativeFlagGetter('enableNetworkEventReporting', true); /** * Enables caching text layout artifacts for later reuse */ @@ -443,10 +437,6 @@ export const fuseboxEnabledRelease: Getter = createNativeFlagGetter('fu * Enable frame timings and screenshots support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes. */ export const fuseboxFrameRecordingEnabled: Getter = createNativeFlagGetter('fuseboxFrameRecordingEnabled', false); -/** - * Enable network inspection support in the React Native DevTools CDP backend. Requires `enableBridgelessArchitecture`. This flag is global and should not be changed across React Host lifetimes. - */ -export const fuseboxNetworkInspectionEnabled: Getter = createNativeFlagGetter('fuseboxNetworkInspectionEnabled', true); /** * Enable Page.captureScreenshot CDP method support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index a4145d59c8c2..2a49b2976def 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -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<<68ccb8d73a8f29fbf88f15a183bd910b>> + * @generated SignedSource<<545762b8932b2314ee224ae467b02929>> * @flow strict * @noformat */ @@ -64,7 +64,6 @@ export interface Spec extends TurboModule { readonly enableModuleArgumentNSNullConversionIOS?: () => boolean; readonly enableMutationObserverByDefault?: () => boolean; readonly enableNativeCSSParsing?: () => boolean; - readonly enableNetworkEventReporting?: () => boolean; readonly enablePreparedTextLayout?: () => boolean; readonly enablePropsUpdateReconciliationAndroid?: () => boolean; readonly enableRuntimeSchedulerQueueClearingOnError?: () => boolean; @@ -83,7 +82,6 @@ export interface Spec extends TurboModule { readonly fuseboxAssertSingleHostState?: () => boolean; readonly fuseboxEnabledRelease?: () => boolean; readonly fuseboxFrameRecordingEnabled?: () => boolean; - readonly fuseboxNetworkInspectionEnabled?: () => boolean; readonly fuseboxScreenshotCaptureEnabled?: () => boolean; readonly optimizedAnimatedPropUpdates?: () => boolean; readonly overrideBySynchronousMountPropsAtMountingAndroid?: () => boolean;