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
14 changes: 0 additions & 14 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ public final class com/facebook/react/ReactInstanceManagerBuilder {
public final fun addPackages (Ljava/util/List;)Lcom/facebook/react/ReactInstanceManagerBuilder;
public final fun build ()Lcom/facebook/react/ReactInstanceManager;
public final fun setApplication (Landroid/app/Application;)Lcom/facebook/react/ReactInstanceManagerBuilder;
public final fun setBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)Lcom/facebook/react/ReactInstanceManagerBuilder;
public final fun setBundleAssetName (Ljava/lang/String;)Lcom/facebook/react/ReactInstanceManagerBuilder;
public final fun setChoreographerProvider (Lcom/facebook/react/internal/ChoreographerProvider;)Lcom/facebook/react/ReactInstanceManagerBuilder;
public final fun setCurrentActivity (Landroid/app/Activity;)Lcom/facebook/react/ReactInstanceManagerBuilder;
Expand Down Expand Up @@ -583,7 +582,6 @@ public abstract interface class com/facebook/react/bridge/Callback {
}

public abstract interface class com/facebook/react/bridge/CatalystInstance : com/facebook/react/bridge/JSBundleLoaderDelegate, com/facebook/react/bridge/JSInstance, com/facebook/react/bridge/MemoryPressureListener {
public abstract fun addBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V
public abstract fun callFunction (Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V
public abstract fun destroy ()V
public abstract fun extendNativeModules (Lcom/facebook/react/bridge/NativeModuleRegistry;)V
Expand All @@ -605,15 +603,13 @@ public abstract interface class com/facebook/react/bridge/CatalystInstance : com
public abstract fun invokeCallback (ILcom/facebook/react/bridge/NativeArrayInterface;)V
public abstract fun isDestroyed ()Z
public abstract fun registerSegment (ILjava/lang/String;)V
public abstract fun removeBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V
public abstract fun runJSBundle ()V
public abstract fun setFabricUIManager (Lcom/facebook/react/bridge/UIManager;)V
public abstract fun setGlobalVariable (Ljava/lang/String;Ljava/lang/String;)V
public abstract fun setTurboModuleRegistry (Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModuleRegistry;)V
}

public class com/facebook/react/bridge/CatalystInstanceImpl : com/facebook/react/bridge/CatalystInstance {
public fun addBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V
public fun callFunction (Lcom/facebook/react/bridge/CatalystInstanceImpl$PendingJSCall;)V
public fun callFunction (Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V
public fun destroy ()V
Expand Down Expand Up @@ -641,7 +637,6 @@ public class com/facebook/react/bridge/CatalystInstanceImpl : com/facebook/react
public fun loadScriptFromFile (Ljava/lang/String;Ljava/lang/String;Z)V
public fun loadSplitBundleFromFile (Ljava/lang/String;Ljava/lang/String;)V
public fun registerSegment (ILjava/lang/String;)V
public fun removeBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V
public fun runJSBundle ()V
public fun setFabricUIManager (Lcom/facebook/react/bridge/UIManager;)V
public fun setGlobalVariable (Ljava/lang/String;Ljava/lang/String;)V
Expand Down Expand Up @@ -970,12 +965,6 @@ public final class com/facebook/react/bridge/NoSuchKeyException : java/lang/Runt
public fun <init> (Ljava/lang/String;)V
}

public abstract interface class com/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener {
public abstract fun onBridgeDestroyed ()V
public abstract fun onTransitionToBridgeBusy ()V
public abstract fun onTransitionToBridgeIdle ()V
}

public abstract interface class com/facebook/react/bridge/PerformanceCounter {
public abstract fun getPerformanceCounters ()Ljava/util/Map;
public abstract fun profileNextBatch ()V
Expand Down Expand Up @@ -4328,7 +4317,6 @@ public class com/facebook/react/uimanager/UIImplementation {
public fun setJSResponder (IZ)V
public fun setLayoutAnimationEnabledExperimental (Z)V
public fun setLayoutUpdateListener (Lcom/facebook/react/uimanager/UIImplementation$LayoutUpdateListener;)V
public fun setViewHierarchyUpdateDebugListener (Lcom/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener;)V
public fun setViewLocalData (ILjava/lang/Object;)V
public fun synchronouslyUpdateViewOnUIThread (ILcom/facebook/react/uimanager/ReactStylesDiffMap;)V
public fun updateInsetsPadding (IIIII)V
Expand Down Expand Up @@ -4412,7 +4400,6 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b
public fun setChildren (ILcom/facebook/react/bridge/ReadableArray;)V
public fun setJSResponder (IZ)V
public fun setLayoutAnimationEnabledExperimental (Z)V
public fun setViewHierarchyUpdateDebugListener (Lcom/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener;)V
public fun setViewLocalData (ILjava/lang/Object;)V
public fun startSurface (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;II)I
public fun stopSurface (I)V
Expand Down Expand Up @@ -4460,7 +4447,6 @@ public class com/facebook/react/uimanager/UIViewOperationQueue {
public fun isEmpty ()Z
public fun prependUIBlock (Lcom/facebook/react/uimanager/UIBlock;)V
public fun profileNextBatch ()V
public fun setViewHierarchyUpdateDebugListener (Lcom/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener;)V
}

public abstract interface class com/facebook/react/uimanager/UIViewOperationQueue$UIOperation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import com.facebook.react.bridge.JavaScriptExecutor;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.bridge.NativeModuleRegistry;
import com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactCxxErrorHandler;
Expand Down Expand Up @@ -183,7 +182,6 @@ public interface ReactInstanceEventListener
private final boolean mUseDeveloperSupport;
private final boolean mRequireActivity;
private final boolean mKeepActivity;
private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener;
private final Object mReactContextLock = new Object();
private @Nullable volatile ReactContext mCurrentReactContext;
private final Context mApplicationContext;
Expand Down Expand Up @@ -246,7 +244,6 @@ public static ReactInstanceManagerBuilder builder() {
DevSupportManagerFactory devSupportManagerFactory,
boolean requireActivity,
boolean keepActivity,
@Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
LifecycleState initialLifecycleState,
JSExceptionHandler jSExceptionHandler,
@Nullable RedBoxHandler redBoxHandler,
Expand Down Expand Up @@ -292,7 +289,6 @@ public static ReactInstanceManagerBuilder builder() {
devLoadingViewManager,
pausedInDebuggerOverlayManager);
Systrace.endSection(TRACE_TAG_REACT);
mBridgeIdleDebugListener = bridgeIdleDebugListener;
mLifecycleState = initialLifecycleState;
mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
mJSExceptionHandler = jSExceptionHandler;
Expand Down Expand Up @@ -1517,9 +1513,6 @@ private ReactApplicationContext createReactContext(
catalystInstance.setFabricUIManager(uiManager);
}
}
if (mBridgeIdleDebugListener != null) {
catalystInstance.addBridgeIdleDebugListener(mBridgeIdleDebugListener);
}
if (BuildConfig.ENABLE_PERFETTO || Systrace.isTracing(TRACE_TAG_REACT)) {
catalystInstance.setGlobalVariable("__RCTProfileIsProfiling", "true");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.facebook.react.ReactInstanceManager.initializeSoLoaderIfNecessary
import com.facebook.react.bridge.JSBundleLoader
import com.facebook.react.bridge.JSExceptionHandler
import com.facebook.react.bridge.JavaScriptExecutorFactory
import com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener
import com.facebook.react.bridge.UIManagerProvider
import com.facebook.react.common.LifecycleState
import com.facebook.react.common.SurfaceDelegateFactory
Expand Down Expand Up @@ -49,7 +48,6 @@ public class ReactInstanceManagerBuilder {
private var jsBundleAssetUrl: String? = null
private var jsBundleLoader: JSBundleLoader? = null
private var jsMainModulePath: String? = null
private var bridgeIdleDebugListener: NotThreadSafeBridgeIdleDebugListener? = null
private var application: Application? = null
private var useDeveloperSupport = false
private var devSupportManagerFactory: DevSupportManagerFactory? = null
Expand Down Expand Up @@ -145,13 +143,6 @@ public class ReactInstanceManagerBuilder {
return this
}

public fun setBridgeIdleDebugListener(
bridgeIdleDebugListener: NotThreadSafeBridgeIdleDebugListener
): ReactInstanceManagerBuilder {
this.bridgeIdleDebugListener = bridgeIdleDebugListener
return this
}

/** Required. This must be your `Application` instance. */
public fun setApplication(application: Application): ReactInstanceManagerBuilder {
this.application = application
Expand Down Expand Up @@ -359,7 +350,6 @@ public class ReactInstanceManagerBuilder {
devSupportManagerFactory ?: DefaultDevSupportManagerFactory(),
requireActivity,
keepActivity,
bridgeIdleDebugListener,
checkNotNull(initialLifecycleState) { "Initial lifecycle state was not set" },
jsExceptionHandler,
redBoxHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,6 @@ public interface CatalystInstance : MemoryPressureListener, JSInstance, JSBundle
*/
public fun extendNativeModules(modules: NativeModuleRegistry)

/**
* Adds a idle listener for this Catalyst instance. The listener will receive notifications
* whenever the bridge transitions from idle to busy and vice-versa, where the busy state is
* defined as there being some non-zero number of calls to JS that haven't resolved via a
* onBatchCompleted call. The listener should be purely passive and not affect application logic.
*/
public fun addBridgeIdleDebugListener(
@Suppress("DEPRECATION") listener: NotThreadSafeBridgeIdleDebugListener
)

/**
* Removes a NotThreadSafeBridgeIdleDebugListener previously added with
* [addBridgeIdleDebugListener]
*/
public fun removeBridgeIdleDebugListener(
@Suppress("DEPRECATION") listener: NotThreadSafeBridgeIdleDebugListener
)

/** This method registers the file path of an additional JS segment by its ID. */
public fun registerSegment(segmentId: Int, path: String)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;

/**
Expand Down Expand Up @@ -88,7 +87,6 @@ public String toString() {

// Access from any thread
private final ReactQueueConfigurationImpl mReactQueueConfiguration;
private final CopyOnWriteArrayList<NotThreadSafeBridgeIdleDebugListener> mBridgeIdleListeners;
private final AtomicInteger mPendingJSCalls = new AtomicInteger(0);
private final String mJsPendingCallsTitleForTrace =
"pending_js_calls_instance" + sNextInstanceIdForTrace.getAndIncrement();
Expand Down Expand Up @@ -138,7 +136,6 @@ private CatalystInstanceImpl(
mReactQueueConfiguration =
ReactQueueConfigurationImpl.create(
reactQueueConfigurationSpec, new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mNativeModuleRegistry = nativeModuleRegistry;
mJSModuleRegistry = new JavaScriptModuleRegistry();
mJSBundleLoader = jsBundleLoader;
Expand Down Expand Up @@ -372,14 +369,6 @@ public void destroy() {
mFabricUIManager.invalidate();
}
boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
if (!mBridgeIdleListeners.isEmpty()) {
for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
if (!wasIdle) {
listener.onTransitionToBridgeIdle();
}
listener.onBridgeDestroyed();
}
}

getReactQueueConfiguration()
.getJSQueueThread()
Expand Down Expand Up @@ -521,30 +510,6 @@ public void handleMemoryPressure(int level) {
jniHandleMemoryPressure(level);
}

/**
* Adds a idle listener for this Catalyst instance. The listener will receive notifications
* whenever the bridge transitions from idle to busy and vice-versa, where the busy state is
* defined as there being some non-zero number of calls to JS that haven't resolved via a
* onBatchComplete call. The listener should be purely passive and not affect application logic.
*
* @noinspection deprecation
*/
@Override
public void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
mBridgeIdleListeners.add(listener);
}

/**
* Removes a NotThreadSafeBridgeIdleDebugListener previously added with {@link
* #addBridgeIdleDebugListener}
*
* @noinspection deprecation
*/
@Override
public void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
mBridgeIdleListeners.remove(listener);
}

@Override
public native void setGlobalVariable(String propName, String jsonValue);

Expand All @@ -561,16 +526,7 @@ public JavaScriptContextHolder getJavaScriptContextHolder() {

private void incrementPendingJSCalls() {
int oldPendingCalls = mPendingJSCalls.getAndIncrement();
boolean wasIdle = oldPendingCalls == 0;
Systrace.traceCounter(TRACE_TAG_REACT, mJsPendingCallsTitleForTrace, oldPendingCalls + 1);
if (wasIdle && !mBridgeIdleListeners.isEmpty()) {
mNativeModulesQueueThread.runOnQueue(
() -> {
for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
listener.onTransitionToBridgeBusy();
}
});
}
}

@Override
Expand All @@ -592,17 +548,7 @@ private void decrementPendingJSCalls() {
int newPendingCalls = mPendingJSCalls.decrementAndGet();
// TODO(9604406): handle case of web workers injecting messages to main thread
// Assertions.assertCondition(newPendingCalls >= 0);
boolean isNowIdle = newPendingCalls == 0;
Systrace.traceCounter(TRACE_TAG_REACT, mJsPendingCallsTitleForTrace, newPendingCalls);

if (isNowIdle && !mBridgeIdleListeners.isEmpty()) {
mNativeModulesQueueThread.runOnQueue(
() -> {
for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
listener.onTransitionToBridgeIdle();
}
});
}
}

private void onNativeException(Exception e) {
Expand Down

This file was deleted.

Loading
Loading