Skip to content

Conversation

@mrousavy
Copy link
Member

Removes the jni::ThreadScope and fbjni dependency from react-native-worklets-core, as it is implementation specific and we cannot always assume that the user wants a ThreadScope (this is also a performance impact).

Instead, the user should implement using a ThreadScope themselves, either via ThreadScope or ThreadScope::WithClassLoader.

cc @chrfalch

Copy link
Collaborator

@chrfalch chrfalch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect.

@mrousavy
Copy link
Member Author

While the idea behind this is good and this increases performance on Android by a tiny bit, this actually might not make sense for the real world.

In most cases, you want to run something in a Worklet context that also accesses platform native (Java/Kotlin) APIs, and not just pure JS code.

So it makes sense to leave the ThreadScope in here. Actually, it might even make sense to use a class loader ThreadScope, which also has access to all JNI methods, not only the System ones, see this PR: #141

@mrousavy mrousavy closed this Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants