refactor: clean threaded runtime globals#14
Open
V3RON wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this matters
This removes undocumented secondary-runtime globals and fallback paths so runtime detection has one supported source of truth. It makes the public API clearer, avoids app code depending on internal globals, and keeps docs/examples aligned with the breaking cleanup from issue #12.
What changed
global.__THREADED_RUNTIME_ENV__as the only supported runtime identity global and reduced it toruntimeNameandkind_is_it_a_list_env,__COMPOSE_CHAT_LIST_ENV__,__rnrRuntimeFunctionCacheRuntimeName, and the global event-emitter fallback guardglobal/globalThisself-assignment during secondary runtime setup__rnrRegisterRuntimeFunctionand__rnrCallRuntimeFunctionbehind internal helpers in coregetCurrentRuntime()andisMainRuntime()instead of raw globalsVerification
bunx tsc --noEmitinexample/bun testinexample/currently fails in the existing Bun + React Native test setup on Flow syntax inreact-native/index.js