refactor(Worklets): load unpackers with JSI#8984
Merged
Conversation
5fd2196 to
29b7857
Compare
b141fdc to
cdfc240
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 31, 2026
## Summary Splitting initialization of `WorkletsModuleProxy` into two steps. Instead of `WorkletsModule.installTurboModule()` starting all the native pipeline, it only creates an instance of `WorkletsModuleProxy` which is later on properly fully initialized with `WorkletsModule.start()`. This is necessary for - #8984 where WorkletsModuleProxy exposes bindings to register value unpackers code - thanks to that we don't have to pass the unpackers code from Kotlin/ObjC but have them exactly in C++ to use in Worklet Runtimes. ## Test plan Fabric Example runs both on iOS and Android
bartlomiejbloniarz
approved these changes
Apr 1, 2026
packages/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp
Outdated
Show resolved
Hide resolved
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.
Summary
I'm changing how value unpackers work outside of Bundle Mode.
Some time ago we moved injecting value unpackers from runtime JSI string to pre-compiled C++ strings. This helped us reduce a lot of boilerplate because we didn't need to pass these strings through the Turbo Module any more but on the other hand we lost source mappings and error messages could be hard to debug.
I decided to connect both of these worlds and return to passing runtime JSI strings, but directly to C++ with JSIWorkletsModuleProxy instead of Turbo Module interfaces.
With this change unpackers can properly use source maps in case of error messages.
Test plan
I measured performance different in release builds before this change and after, to see how big of an impact is passing runtime strings to C++, it seem to be negligible: