Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ NS_ASSUME_NONNULL_BEGIN
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
- (BOOL)bridgelessEnabled;

/// Controls whether the new debugger stack (codename Fusebox) is enabled.
- (BOOL)unstable_fuseboxEnabled;

/// Return the bundle URL for the main bundle.
- (NSURL *__nullable)bundleURL;

Expand Down
31 changes: 2 additions & 29 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ - (BOOL)bridgelessEnabled
return [self newArchEnabled];
}

- (BOOL)unstable_fuseboxEnabled
{
return NO;
}

- (NSURL *)bundleURL
{
[NSException raise:@"RCTAppDelegate::bundleURL not implemented"
Expand Down Expand Up @@ -305,26 +300,8 @@ - (RCTRootViewFactory *)createRCTRootViewFactory

#pragma mark - Feature Flags

class RCTAppDelegateFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
public:
RCTAppDelegateFeatureFlags(bool fuseboxEnabled)
{
fuseboxEnabled_ = fuseboxEnabled;
}

bool fuseboxEnabledDebug() override
{
return fuseboxEnabled_;
}

private:
bool fuseboxEnabled_;
};

class RCTAppDelegateBridgelessFeatureFlags : public RCTAppDelegateFeatureFlags {
class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
public:
RCTAppDelegateBridgelessFeatureFlags(bool fuseboxEnabled) : RCTAppDelegateFeatureFlags(fuseboxEnabled) {}

bool useModernRuntimeScheduler() override
{
return true;
Expand All @@ -342,11 +319,7 @@ bool batchRenderingUpdatesInEventLoop() override
- (void)_setUpFeatureFlags
{
if ([self bridgelessEnabled]) {
facebook::react::ReactNativeFeatureFlags::override(
std::make_unique<RCTAppDelegateBridgelessFeatureFlags>([self unstable_fuseboxEnabled]));
} else {
facebook::react::ReactNativeFeatureFlags::override(
std::make_unique<RCTAppDelegateFeatureFlags>([self unstable_fuseboxEnabled]));
facebook::react::ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,6 @@ public final class com/facebook/react/defaults/DefaultNewArchitectureEntryPoint
public static final fun load (ZZ)V
public static final fun load (ZZZ)V
public static synthetic fun load$default (ZZZILjava/lang/Object;)V
public static final fun unstable_loadFusebox (Z)V
}

public class com/facebook/react/defaults/DefaultReactActivityDelegate : com/facebook/react/ReactActivityDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package com.facebook.react.defaults

import com.facebook.infer.annotation.Assertions
import com.facebook.react.common.annotations.VisibleForTesting
import com.facebook.react.config.ReactFeatureFlags
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
Expand Down Expand Up @@ -43,7 +42,6 @@ public object DefaultNewArchitectureEntryPoint {
ReactFeatureFlags.useTurboModules = turboModulesEnabled
ReactFeatureFlags.enableFabricRenderer = fabricEnabled
ReactFeatureFlags.enableBridgelessArchitecture = bridgelessEnabled
val fuseboxEnabledDebug = fuseboxEnabled

if (bridgelessEnabled) {
ReactNativeFeatureFlags.override(
Expand All @@ -56,10 +54,6 @@ public object DefaultNewArchitectureEntryPoint {

override fun useNativeViewConfigsInBridgelessMode(): Boolean = true

// We need to assign this now as we can't call ReactNativeFeatureFlags.override()
// more than once.
override fun fuseboxEnabledDebug(): Boolean = fuseboxEnabledDebug

override fun useFabricInterop(): Boolean = fabricEnabled

override fun useTurboModuleInterop(): Boolean = bridgelessEnabled
Expand All @@ -72,7 +66,6 @@ public object DefaultNewArchitectureEntryPoint {
privateBridgelessEnabled = bridgelessEnabled

DefaultSoLoader.maybeLoadSoLibrary()
loaded = true
}

private var privateFabricEnabled: Boolean = false
Expand Down Expand Up @@ -114,41 +107,4 @@ public object DefaultNewArchitectureEntryPoint {
"bridgelessEnabled=true requires (turboModulesEnabled=true AND fabricEnabled=true) - Please update your DefaultNewArchitectureEntryPoint.load() parameters."
else -> true to ""
}

// region unstable_loadFusebox (short-lived API for testing Fusebox - EXPERIMENTAL)

/**
* Set to {@code true} when {@link #load()} is called. Used for assertion in
* {@link #unstable_loadFusebox()}.
*/
private var loaded: Boolean = false

/** Set to {@code true} if {@link #unstable_loadFusebox()} was called. */
private var fuseboxEnabled: Boolean = false

/**
* If called, enables the new debugger stack (codename Fusebox). Must be called before
* {@link #load()}.
*
* @param isNewArchEnabled Please pass {@code BuildConfig.IS_NEW_ARCH_ENABLED} here.
*/
@JvmStatic
public fun unstable_loadFusebox(
isNewArchEnabled: Boolean,
) {
fuseboxEnabled = true

if (!isNewArchEnabled) {
ReactNativeFeatureFlags.override(
object : ReactNativeFeatureFlagsDefaults() {
override fun fuseboxEnabledDebug(): Boolean = true
})
} else {
Assertions.assertCondition(
loaded == false, "unstable_loadFusebox() must be called before load()")
}
}

// endregion

}
8 changes: 0 additions & 8 deletions packages/rn-tester/RNTester/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,6 @@ - (BOOL)bridgelessEnabled
return [super bridgelessEnabled];
}

#pragma mark - Experimental settings

// [Experiment] Enable the new debugger stack (codename Fusebox)
- (BOOL)unstable_fuseboxEnabled
{
return true;
}

#pragma mark - RCTComponentViewFactoryComponentProvider

#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.common.assets.ReactFontManager
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.unstable_loadFusebox
import com.facebook.react.defaults.DefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.module.model.ReactModuleInfo
Expand Down Expand Up @@ -131,9 +130,6 @@ class RNTesterApplication : Application(), ReactApplication {
super.onCreate()
SoLoader.init(this, /* native exopackage */ false)

// [Experiment] Enable the new debugger stack (codename Fusebox)
unstable_loadFusebox(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED)

if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
load()
}
Expand Down