Skip to content

refactor(Worklets): load unpackers with JSI#8984

Merged
tjzel merged 5 commits intomainfrom
@tjzel/worklets/unpackers-from-jsi
Apr 1, 2026
Merged

refactor(Worklets): load unpackers with JSI#8984
tjzel merged 5 commits intomainfrom
@tjzel/worklets/unpackers-from-jsi

Conversation

@tjzel
Copy link
Copy Markdown
Collaborator

@tjzel tjzel commented Feb 18, 2026

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.

Before (wrong stack, doesn't show throwing code)After (all good 👍)
Screenshot_1771443815 Screenshot_1771443360

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:

Before After
Screenshot 2026-03-31 at 16 44 34 Screenshot 2026-03-31 at 16 48 08

@tjzel tjzel force-pushed the @tjzel/worklets/unpackers-from-jsi branch from b141fdc to cdfc240 Compare March 31, 2026 15:47
@tjzel tjzel changed the base branch from main to @tjzel/worklets/start March 31, 2026 15:48
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
Base automatically changed from @tjzel/worklets/start to main March 31, 2026 17:14
@tjzel tjzel marked this pull request as ready for review March 31, 2026 17:17
@tjzel tjzel added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit ad5f5e7 Apr 1, 2026
24 checks passed
@tjzel tjzel deleted the @tjzel/worklets/unpackers-from-jsi branch April 1, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants