Skip to content

chore(⬆️): upgrade the example to Reanimated 4.6.0 and worklets 0.12.2 - #547

Merged
wcandillon merged 5 commits into
wcandillon:mainfrom
YevheniiKotyrlo:chore/example-reanimated-4.6-worklets-0.12
Oct 16, 2026
Merged

wcandillon merged 5 commits into
wcandillon:mainfrom
YevheniiKotyrlo:chore/example-reanimated-4.6-worklets-0.12

Conversation

@YevheniiKotyrlo

@YevheniiKotyrlo YevheniiKotyrlo commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The example keeps its UI frame loop running after the app goes to the background: worklets 0.8.3's WorkletsModule never registers for host lifecycle events (software-mansion/react-native-reanimated#10196, fixed in worklets 0.12.0). On a Mi MIX 3 (Android 10), the Reanimated screen keeps 20–22% of a core busy in the background. Every worklets release with the fix needs React Native 0.83 or later, and the example is on 0.81.4.

Solution

  • The example moves to React Native 0.83.10 with React 19.2.3, the @react-native/* 0.83.10 tooling, react-native-test-app 5.4.13 and Gradle 9.0.0, and to Reanimated 4.6.0 and worklets 0.12.2; the docs and packages/webgpu's dev dependencies follow. The library's peer ranges are unchanged.
  • apps/expo-webgpu keeps its dependencies in its own node_modules (installConfig.hoistingLimits: "workspaces"). @react-native/metro-config resolves react-native/Libraries/Core/InitializeCore from its own location, so the root has to hold the example's React Native; with the Expo template's 0.86.3 hoisted there instead, the example's bundle failed ("Unable to determine event arguments for onModeChange"). React Native, React, Reanimated and worklets now have one copy each at the root.
  • The docs' twoslash samples resolve their imports from the docs app (vfsRoot), which declares the packages they import, as it already does typegpu; from the repo root, the vision-camera sample failed with TS2307.
  • TransparencyDemo uses StyleSheet.absoluteFill: React Native 0.83's types no longer declare absoluteFillObject.
  • The Podfiles stop copying their fmt and RCT-Folly podspecs over React Native's. React Native 0.83 ships fmt 12.1.0 itself (Bump fmt to 12.1.0 to fix xcode 26.4 react/react-native#56099) and the same Folly podspec, and pod install without the copy resolves both with the checksums main's lock records.

react-native-skia's example gets the same upgrade in wcandillon/react-native-skia#4254.

Verification

On a Mi MIX 3 (Android 10), release builds, the Reanimated screen keeps 20.4–21.9% of a core busy after HOME on main and 0.0–0.1% with this branch (measurement).

yarn lint 0 (rewrites nothing) · yarn tsc 0 · package and web-template builds 0 · yarn test:plugin 0 · yarn check-dawn 0 · yarn build:docs 0

CI's Android e2e step on an API 35 emulator, this branch and main one after the other: 219 of 221 passed on both, the YUV cases of ExternalTextureColorSpace and NativeBufferWrapper failing on both. CI's iOS xcodebuild (Debug, iOS Simulator SDK) after pod install: BUILD SUCCEEDED, built without debug symbols to fit the disk of the Mac I built on.

Known limits

The macOS Podfile.lock is left as on main, which still records React Native 0.81.4, Reanimated 4.2.1 and worklets 0.7.1; CI builds no macOS app.

YevheniiKotyrlo and others added 4 commits October 16, 2026 03:41
Worklets 0.12 stops the UI frame loop while the app is in the background
(software-mansion/react-native-reanimated#10196). It needs React Native
0.83, so the example moves to 0.83.10 with React 19.2.3, the
@react-native/* 0.83.10 tooling, react-native-test-app 5.4.13 and
Gradle 9.0.0.

- The Expo template keeps its dependencies in its own node_modules:
  @react-native/metro-config resolves InitializeCore from its own
  location, so the root has to hold the example's React Native.
- The docs' twoslash samples resolve from the docs app, which declares
  the packages they import.
- TransparencyDemo uses StyleSheet.absoluteFill.
React Native 0.83 ships fmt 12.1.0 itself, and its RCT-Folly podspec is
the override's, so the Podfiles no longer copy them over its own.
pod install with React Native 0.83.10, Reanimated 4.6.0, worklets
0.12.2 and react-native-test-app 5.4.13.
@wcandillon
wcandillon self-requested a review October 16, 2026 12:01
@YevheniiKotyrlo

Copy link
Copy Markdown
Contributor Author

Device measurement — before / after

main — after HOME, the Reanimated screen keeps 20.4–21.9% of a core busy: worklets 0.8.3 never pauses its UI frame loop.

This PR — 0.0–0.1% after HOME; in the foreground the two builds are within each other's spread.

% of a core, Mi MIX 3 (Android 10, API 29) main 46f42a6b this PR 210c4b35
background, six 10 s windows 21.4 (20.4–21.9) 0.0 (0.0–0.1)
foreground, one 10 s window per install 25.9 / 24.8 22.0 / 24.5

Release builds of the example opening Reanimated's UI-thread screen on an opaque canvas, installed in the order main, this PR, this PR, main. Each install reads the app process's user and system time from /proc/<pid>/stat over one 10 s window in the foreground, then three 10 s windows after HOME, as a share of one core; the background column is the median and range of each build's six windows.

@wcandillon
wcandillon merged commit 50ef800 into wcandillon:main Oct 16, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants