Skip to content

Replace removed WorkletRuntime::runGuarded with runSync - #780

Draft
tjzel wants to merge 1 commit into
Expensify:mainfrom
tjzel:fix/worklets-0.13-run-sync
Draft

tjzel wants to merge 1 commit into
Expensify:mainfrom
tjzel:fix/worklets-0.13-run-sync

Conversation

@tjzel

@tjzel tjzel commented Sep 22, 2026 •

Copy link
Copy Markdown

Note

This PR description is AI-generated.

Analogous to expo/expo#48691

Details

react-native-worklets 0.12.0 removed WorkletRuntime::runGuarded, so the library no longer compiles against worklets 0.12.0 and 0.13.0 (apple/MarkdownParser.mm:226:31: error: no member named 'runGuarded' in 'worklets::WorkletRuntime').

I replaced the two runGuarded calls in apple/MarkdownParser.mm and android/src/main/cpp/MarkdownParser.cpp with runSync, and updated the comments that mentioned runGuarded.

I did not add a version check and I kept the peer range at react-native-worklets >=0.7.0. From 0.7.0 through 0.11.x, runGuarded was already a deprecated one-line forwarder to runSync(worklet, args...), and 0.13.0 still exposes runSync with the same shape (RuntimeCallable accepts std::shared_ptr<SerializableWorklet>), so a single spelling compiles across the whole supported range.

Behaviour is unchanged. In every supported version runSync reports a JS error to LogBox and returns undefined in debug builds, and throws in release builds. The existing try/catch on iOS and the catch (Exception e) around nativeParse in MarkdownParser.java already cover the throwing case.

Related Issues

N/A

Manual Tests

  • I ran a syntax-only clang++ -fsyntax-only compile of apple/MarkdownParser.mm (iOS simulator SDK) and android/src/main/cpp/MarkdownParser.cpp against the react-native-worklets 0.13.0 headers. Both pass.
  • The same replacement, applied as a patch-package patch on 0.1.336, compiles inside the Expensify/App iOS build with worklets 0.13.0.
  • I did not build the example app.

Linked PRs

N/A

react-native-worklets 0.12.0 removed WorkletRuntime::runGuarded, so the
library no longer compiles with worklets 0.12.0 and 0.13.0. Since 0.7.0
runGuarded was a deprecated forwarder to runSync(worklet, args...), which
still exists in 0.13.0, so runSync works across the whole peer range.
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Tomasz Żelawski seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@tomekzaw

Copy link
Copy Markdown
Contributor

Please also update the compatibility table with react-native-worklets in README.md

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.

2 participants