BridgelessCatalystInstance

Deprecated

This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.

Constructors

Link copied to clipboard
constructor(reactHost: ReactHostImpl)

Properties

Link copied to clipboard
open override val isDestroyed: Boolean
Link copied to clipboard

Do not use this anymore. Use getRuntimeExecutor instead. Get the C pointer (as a long) to the JavaScriptCore context associated with this instance.

Link copied to clipboard
@get:JvmName(name = "getJSCallInvokerHolder")
open override val jsCallInvokerHolder: CallInvokerHolder

Returns a hybrid object that contains a pointer to a JS CallInvoker, which is used to schedule work on the JS Thread. Required for TurboModuleManager initialization.

Link copied to clipboard

Returns a hybrid object that contains a pointer to a NativeMethodCallInvoker, which is used to schedule work on the NativeModules thread. Required for TurboModuleManager initialization.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val runtimeExecutor: RuntimeExecutor?
Link copied to clipboard
Link copied to clipboard
open override val sourceURL: String?

Return the source URL of the JS Bundle that was run, or null if no JS bundle has been run yet.

Functions

Link copied to clipboard

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.

Link copied to clipboard
open override fun callFunction(module: String, method: String, arguments: NativeArray?)
Link copied to clipboard
open override fun destroy()

Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration (besides the UI thread) to finish running. Must be called from the UI thread so that we can fully shut down other threads.

Link copied to clipboard
open override fun extendNativeModules(modules: NativeModuleRegistry)

This method permits a CatalystInstance to extend the known Native modules. This provided registry contains only the new modules to load.

Link copied to clipboard
open override fun getFabricUIManager(): UIManager
Link copied to clipboard
open override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T?
Link copied to clipboard
open override fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T?
open override fun getNativeModule(moduleName: String): NativeModule?
Link copied to clipboard
open override fun handleMemoryPressure(level: Int)

Called when the system generates a memory warning.

Link copied to clipboard
open override fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean
Link copied to clipboard
open override fun hasRunJSBundle(): Boolean
Link copied to clipboard
open override fun initialize()

Initialize all the native modules

Link copied to clipboard
open override fun invokeCallback(callbackID: Int, arguments: NativeArrayInterface)
Link copied to clipboard
open override fun loadScriptFromAssets(assetManager: AssetManager, assetURL: String, loadSynchronously: Boolean)

Load a JS bundle from Android assets. See JSBundleLoader.createAssetLoader

Link copied to clipboard
open override fun loadScriptFromFile(fileName: String, sourceURL: String, loadSynchronously: Boolean)

Load a JS bundle from the filesystem. See JSBundleLoader.createFileLoader and JSBundleLoader.createCachedBundleFromNetworkLoader

Link copied to clipboard
open override fun loadSplitBundleFromFile(fileName: String, sourceURL: String)

Load a split JS bundle from the filesystem. See JSBundleLoader.createCachedSplitBundleFromNetworkLoader.

Link copied to clipboard
open override fun registerSegment(segmentId: Int, path: String)

This method registers the file path of an additional JS segment by its ID.

Link copied to clipboard

Removes a NotThreadSafeBridgeIdleDebugListener previously added with .addBridgeIdleDebugListener

Link copied to clipboard
open override fun runJSBundle()
Link copied to clipboard
open override fun setFabricUIManager(fabricUIManager: UIManager)
Link copied to clipboard
open override fun setGlobalVariable(propName: String, jsonValue: String)
Link copied to clipboard
open override fun setSourceURLs(deviceURL: String, remoteURL: String)

This API is used in situations where the JS bundle is being executed not on the device, but on a host machine. In that case, we must provide two source URLs for the JS bundle: One to be used on the device, and one to be used on the remote debugging machine.

Link copied to clipboard
open override fun setTurboModuleRegistry(turboModuleRegistry: TurboModuleRegistry)