From a6c860f9522a8b35b048ae44057033badcef3554 Mon Sep 17 00:00:00 2001 From: riteshshukla04 Date: Tue, 26 May 2026 13:57:30 +0530 Subject: [PATCH] chore: add runtimes --- .../nativecompose/threadedruntime/ThreadedRuntime.kt | 6 ------ packages/core/ios/ThreadedRuntime.mm | 7 ------- packages/core/src/ThreadedRuntime.tsx | 11 ++--------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/core/android/src/main/java/com/nativecompose/threadedruntime/ThreadedRuntime.kt b/packages/core/android/src/main/java/com/nativecompose/threadedruntime/ThreadedRuntime.kt index 95bc117..5d80692 100644 --- a/packages/core/android/src/main/java/com/nativecompose/threadedruntime/ThreadedRuntime.kt +++ b/packages/core/android/src/main/java/com/nativecompose/threadedruntime/ThreadedRuntime.kt @@ -500,7 +500,6 @@ private class ThreadedRuntimeBundleLoader( typeof globalThis !== 'undefined' ? globalThis : Function('return this')(); __threadedRuntimeGlobal.global = __threadedRuntimeGlobal; __threadedRuntimeGlobal.globalThis = __threadedRuntimeGlobal; - __threadedRuntimeGlobal._is_it_a_list_env = true; __threadedRuntimeGlobal.__THREADED_RUNTIME_ENV__ = { kind: ${jsString(options.kind)}, runtimeName: ${jsString(runtimeName)}, @@ -508,11 +507,6 @@ private class ThreadedRuntimeBundleLoader( useMainNativeModules: ${options.useMainNativeModules}, version: 1 }; - __threadedRuntimeGlobal.__COMPOSE_CHAT_LIST_ENV__ = { - kind: 'background-list', - runtimeName: ${jsString(runtimeName)}, - version: 1 - }; """.trimIndent(), ) diff --git a/packages/core/ios/ThreadedRuntime.mm b/packages/core/ios/ThreadedRuntime.mm index 6e01cc0..1e24bed 100644 --- a/packages/core/ios/ThreadedRuntime.mm +++ b/packages/core/ios/ThreadedRuntime.mm @@ -80,7 +80,6 @@ - (void)host:(RCTHost *)host didInitializeRuntime:(facebook::jsi::Runtime &)runt auto global = runtime.global(); global.setProperty(runtime, "global", global); global.setProperty(runtime, "globalThis", global); - global.setProperty(runtime, "_is_it_a_list_env", true); auto threadedEnv = facebook::jsi::Object(runtime); threadedEnv.setProperty(runtime, "kind", facebook::jsi::String::createFromUtf8(runtime, [_kind UTF8String])); @@ -90,12 +89,6 @@ - (void)host:(RCTHost *)host didInitializeRuntime:(facebook::jsi::Runtime &)runt threadedEnv.setProperty(runtime, "version", 1); global.setProperty(runtime, "__THREADED_RUNTIME_ENV__", threadedEnv); - auto listEnv = facebook::jsi::Object(runtime); - listEnv.setProperty(runtime, "kind", facebook::jsi::String::createFromUtf8(runtime, "background-list")); - listEnv.setProperty(runtime, "runtimeName", facebook::jsi::String::createFromUtf8(runtime, [_runtimeName UTF8String])); - listEnv.setProperty(runtime, "version", 1); - global.setProperty(runtime, "__COMPOSE_CHAT_LIST_ENV__", listEnv); - nativecompose::threadedruntime::installRuntimeFunctionJsi(runtime, [_runtimeName UTF8String]); if ([_delegate respondsToSelector:@selector(host:didInitializeRuntime:)]) { diff --git a/packages/core/src/ThreadedRuntime.tsx b/packages/core/src/ThreadedRuntime.tsx index d4641b9..ca92c10 100644 --- a/packages/core/src/ThreadedRuntime.tsx +++ b/packages/core/src/ThreadedRuntime.tsx @@ -105,13 +105,8 @@ let didWarnRuntimeFunctionsNitroUnavailable = false; function currentRuntimeName() { const globals = globalThis as { __THREADED_RUNTIME_ENV__?: { runtimeName?: string }; - __COMPOSE_CHAT_LIST_ENV__?: { runtimeName?: string }; }; - return ( - globals.__THREADED_RUNTIME_ENV__?.runtimeName ?? - globals.__COMPOSE_CHAT_LIST_ENV__?.runtimeName ?? - DEFAULT_RUNTIME_NAME - ); + return globals.__THREADED_RUNTIME_ENV__?.runtimeName ?? DEFAULT_RUNTIME_NAME; } export const MAIN_RUNTIME_NAME = 'main'; @@ -125,10 +120,8 @@ export type CurrentRuntimeInfo = { export function getCurrentRuntime(): CurrentRuntimeInfo { const globals = globalThis as { __THREADED_RUNTIME_ENV__?: { runtimeName?: string; kind?: string }; - __COMPOSE_CHAT_LIST_ENV__?: { runtimeName?: string; kind?: string }; }; - const env = - globals.__THREADED_RUNTIME_ENV__ ?? globals.__COMPOSE_CHAT_LIST_ENV__; + const env = globals.__THREADED_RUNTIME_ENV__; if (env?.runtimeName) { return { isMain: false,