Skip to content

refactor(react): remove worklet-runtime shell sources#2417

Merged
Yradex merged 1 commit intolynx-family:mainfrom
Yradex:wt/move-mts-runtime-3-20260401
Apr 3, 2026
Merged

refactor(react): remove worklet-runtime shell sources#2417
Yradex merged 1 commit intolynx-family:mainfrom
Yradex:wt/move-mts-runtime-3-20260401

Conversation

@Yradex
Copy link
Copy Markdown
Collaborator

@Yradex Yradex commented Apr 3, 2026

Summary by CodeRabbit

  • New Features

    • Restructured package distribution to use compiled artifacts instead of source files.
  • Chores

    • Updated package entrypoints and build configuration to reference optimized build outputs.
    • Streamlined internal module structure and removed re-export facades.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: 8e59d54

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5479e57f-3769-4140-a086-2a746b7cda88

📥 Commits

Reviewing files that changed from the base of the PR and between 57d8ac3 and 8e59d54.

📒 Files selected for processing (48)
  • eslint.config.js
  • packages/react/worklet-runtime/__test__/api/element.test.js
  • packages/react/worklet-runtime/__test__/delayWorkletEvent.test.js
  • packages/react/worklet-runtime/__test__/eventPropagation.test.js
  • packages/react/worklet-runtime/__test__/jsFunctionLifecycle.test.js
  • packages/react/worklet-runtime/__test__/mainThreadFlushLoopGuard.test.js
  • packages/react/worklet-runtime/__test__/observers.test.js
  • packages/react/worklet-runtime/__test__/profile.test.js
  • packages/react/worklet-runtime/__test__/runOnBackground.test.js
  • packages/react/worklet-runtime/__test__/runOnMainThread.test.js
  • packages/react/worklet-runtime/__test__/runtimeSourceLayout.test.js
  • packages/react/worklet-runtime/__test__/workletRef.test.js
  • packages/react/worklet-runtime/__test__/workletRuntime.test.js
  • packages/react/worklet-runtime/package.json
  • packages/react/worklet-runtime/rslib.config.ts
  • packages/react/worklet-runtime/src/api/animation/animation.ts
  • packages/react/worklet-runtime/src/api/animation/effect.ts
  • packages/react/worklet-runtime/src/api/element.ts
  • packages/react/worklet-runtime/src/api/lepusQuerySelector.ts
  • packages/react/worklet-runtime/src/api/lynxApi.ts
  • packages/react/worklet-runtime/src/bindings/bindings.ts
  • packages/react/worklet-runtime/src/bindings/events.ts
  • packages/react/worklet-runtime/src/bindings/index.ts
  • packages/react/worklet-runtime/src/bindings/loadRuntime.ts
  • packages/react/worklet-runtime/src/bindings/observers.ts
  • packages/react/worklet-runtime/src/bindings/types.ts
  • packages/react/worklet-runtime/src/delayRunOnBackground.ts
  • packages/react/worklet-runtime/src/delayWorkletEvent.ts
  • packages/react/worklet-runtime/src/eomImpl.ts
  • packages/react/worklet-runtime/src/eventPropagation.ts
  • packages/react/worklet-runtime/src/global.ts
  • packages/react/worklet-runtime/src/hydrate.ts
  • packages/react/worklet-runtime/src/index.ts
  • packages/react/worklet-runtime/src/jsFunctionLifecycle.ts
  • packages/react/worklet-runtime/src/listeners.ts
  • packages/react/worklet-runtime/src/runOnMainThread.ts
  • packages/react/worklet-runtime/src/types/dev.d.ts
  • packages/react/worklet-runtime/src/types/elementApi.d.ts
  • packages/react/worklet-runtime/src/types/runtimeProxy.d.ts
  • packages/react/worklet-runtime/src/types/systeminfo.d.ts
  • packages/react/worklet-runtime/src/utils/mainThreadFlushLoopGuard.ts
  • packages/react/worklet-runtime/src/utils/profile.ts
  • packages/react/worklet-runtime/src/utils/version.ts
  • packages/react/worklet-runtime/src/workletRef.ts
  • packages/react/worklet-runtime/src/workletRuntime.ts
  • packages/react/worklet-runtime/tsconfig.eslint.json
  • packages/react/worklet-runtime/turbo.json
  • packages/react/worklet-runtime/vitest.config.ts
💤 Files with no reviewable changes (34)
  • packages/react/worklet-runtime/turbo.json
  • packages/react/worklet-runtime/src/workletRef.ts
  • packages/react/worklet-runtime/vitest.config.ts
  • packages/react/worklet-runtime/src/global.ts
  • packages/react/worklet-runtime/src/bindings/index.ts
  • packages/react/worklet-runtime/src/utils/profile.ts
  • packages/react/worklet-runtime/src/api/lynxApi.ts
  • packages/react/worklet-runtime/src/runOnMainThread.ts
  • packages/react/worklet-runtime/src/bindings/types.ts
  • packages/react/worklet-runtime/src/jsFunctionLifecycle.ts
  • packages/react/worklet-runtime/src/types/dev.d.ts
  • packages/react/worklet-runtime/tsconfig.eslint.json
  • eslint.config.js
  • packages/react/worklet-runtime/src/api/animation/effect.ts
  • packages/react/worklet-runtime/src/eomImpl.ts
  • packages/react/worklet-runtime/src/delayRunOnBackground.ts
  • packages/react/worklet-runtime/src/delayWorkletEvent.ts
  • packages/react/worklet-runtime/src/utils/mainThreadFlushLoopGuard.ts
  • packages/react/worklet-runtime/src/api/element.ts
  • packages/react/worklet-runtime/src/bindings/events.ts
  • packages/react/worklet-runtime/src/listeners.ts
  • packages/react/worklet-runtime/src/types/systeminfo.d.ts
  • packages/react/worklet-runtime/src/index.ts
  • packages/react/worklet-runtime/src/api/lepusQuerySelector.ts
  • packages/react/worklet-runtime/src/bindings/bindings.ts
  • packages/react/worklet-runtime/src/utils/version.ts
  • packages/react/worklet-runtime/src/hydrate.ts
  • packages/react/worklet-runtime/src/bindings/loadRuntime.ts
  • packages/react/worklet-runtime/src/workletRuntime.ts
  • packages/react/worklet-runtime/src/api/animation/animation.ts
  • packages/react/worklet-runtime/src/bindings/observers.ts
  • packages/react/worklet-runtime/src/types/runtimeProxy.d.ts
  • packages/react/worklet-runtime/src/eventPropagation.ts
  • packages/react/worklet-runtime/src/types/elementApi.d.ts
✅ Files skipped from review due to trivial changes (11)
  • packages/react/worklet-runtime/test/runOnBackground.test.js
  • packages/react/worklet-runtime/test/runOnMainThread.test.js
  • packages/react/worklet-runtime/test/eventPropagation.test.js
  • packages/react/worklet-runtime/test/observers.test.js
  • packages/react/worklet-runtime/test/jsFunctionLifecycle.test.js
  • packages/react/worklet-runtime/test/mainThreadFlushLoopGuard.test.js
  • packages/react/worklet-runtime/test/delayWorkletEvent.test.js
  • packages/react/worklet-runtime/test/workletRuntime.test.js
  • packages/react/worklet-runtime/rslib.config.ts
  • packages/react/worklet-runtime/package.json
  • packages/react/worklet-runtime/test/profile.test.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/react/worklet-runtime/test/workletRef.test.js
  • packages/react/worklet-runtime/test/runtimeSourceLayout.test.js

📝 Walkthrough

Walkthrough

This PR transitions packages/react/worklet-runtime from re-exporting TypeScript source to consuming a pre-built runtime package. It removes 30+ re-export files from src/, redirects test imports to ../../runtime/src/worklet-runtime/, updates build configuration to reference the runtime source, and changes package exports to point to compiled lib/ artifacts instead of TypeScript source.

Changes

Cohort / File(s) Summary
Build Configuration Updates
eslint.config.js, package.json, rslib.config.ts, turbo.json, tsconfig.eslint.json, vitest.config.ts
Modified build inputs/outputs and package entrypoints to consume runtime package instead of local TypeScript source; removed ESLint override for local src/ paths; updated export fields to resolved compiled lib/ artifacts.
Test Import Redirections
__test__/api/element.test.js, __test__/delayWorkletEvent.test.js, __test__/eventPropagation.test.js, __test__/jsFunctionLifecycle.test.js, __test__/mainThreadFlushLoopGuard.test.js, __test__/observers.test.js, __test__/profile.test.js, __test__/runOnBackground.test.js, __test__/runOnMainThread.test.js, __test__/workletRef.test.js, __test__/workletRuntime.test.js, __test__/runtimeSourceLayout.test.js
Updated test imports to resolve from ../../runtime/src/worklet-runtime/ instead of local ../src/ paths; reworked runtime layout test to verify package.json exports and absence of shell sources instead of source re-export structure.
API Re-export Removals
src/api/animation/animation.ts, src/api/animation/effect.ts, src/api/element.ts, src/api/lepusQuerySelector.ts, src/api/lynxApi.ts
Deleted wildcard re-exports forwarding runtime API surface to local package consumers.
Bindings Re-export Removals
src/bindings/bindings.ts, src/bindings/events.ts, src/bindings/index.ts, src/bindings/loadRuntime.ts, src/bindings/observers.ts, src/bindings/types.ts
Removed barrel re-exports exposing worklet runtime bindings through React package entrypoint.
Core Module Re-export Removals
src/delayRunOnBackground.ts, src/delayWorkletEvent.ts, src/eomImpl.ts, src/eventPropagation.ts, src/global.ts, src/hydrate.ts, src/index.ts, src/jsFunctionLifecycle.ts, src/listeners.ts, src/runOnMainThread.ts, src/workletRef.ts, src/workletRuntime.ts
Deleted re-export statements that previously forwarded runtime module implementations to consumers.
Utility Re-export Removals
src/utils/mainThreadFlushLoopGuard.ts, src/utils/profile.ts, src/utils/version.ts
Removed utility re-exports exposing runtime helper functions.
Type Declarations Removed
src/types/dev.d.ts, src/types/elementApi.d.ts, src/types/runtimeProxy.d.ts, src/types/systeminfo.d.ts
Deleted ambient TypeScript declarations for element APIs, animation, runtime proxy, and system info that were previously available through local package types.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • hzy
  • HuJean
  • upupming

Poem

🐰 A rabbit's ode to architecture...

Once tangled re-exports in files did stay,
Now the runtime alone shows the way!
Test paths redirected, clean and bright,
Package exports compiled—pure delight!
One source of truth, no more to debate. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(react): remove worklet-runtime shell sources' directly and clearly describes the primary change—removing shell re-export files in the worklet-runtime package to eliminate intermediate forwarding layers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Yradex Yradex marked this pull request as ready for review April 3, 2026 06:25
@Yradex Yradex requested review from HuJean, hzy and upupming as code owners April 3, 2026 06:25
@Yradex Yradex force-pushed the wt/move-mts-runtime-3-20260401 branch from 57d8ac3 to 8e59d54 Compare April 3, 2026 06:29
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 3, 2026

React Example

#7056 Bundle Size — 237.81KiB (0%).

8e59d54(current) vs 44b966c main#7046(baseline)

Bundle metrics  Change 1 change
                 Current
#7056
     Baseline
#7046
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 38.7%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 180 180
No change  Duplicate Modules 71 71
Change  Duplicate Code 46.39%(-0.02%) 46.4%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7056
     Baseline
#7046
No change  IMG 145.76KiB 145.76KiB
No change  Other 92.05KiB 92.05KiB

Bundle analysis reportBranch Yradex:wt/move-mts-runtime-3-202...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 3, 2026

Web Explorer

#8631 Bundle Size — 728.84KiB (0%).

8e59d54(current) vs 44b966c main#8621(baseline)

Bundle metrics  Change 2 changes
                 Current
#8631
     Baseline
#8621
No change  Initial JS 43.31KiB 43.31KiB
No change  Initial CSS 2.16KiB 2.16KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 10 10
Change  Modules 149(-0.67%) 150
No change  Duplicate Modules 11 11
Change  Duplicate Code 34.69%(+0.03%) 34.68%
No change  Packages 3 3
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8631
     Baseline
#8621
No change  Other 384.62KiB 384.62KiB
No change  JS 342.07KiB 342.07KiB
No change  CSS 2.16KiB 2.16KiB

Bundle analysis reportBranch Yradex:wt/move-mts-runtime-3-202...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 3, 2026

React External

#174 Bundle Size — 591.44KiB (+0.08%).

8e59d54(current) vs 44b966c main#164(baseline)

Bundle metrics  no changes
                 Current
#174
     Baseline
#164
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 30.97% 30.97%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#174
     Baseline
#164
Regression  Other 591.44KiB (+0.08%) 590.96KiB

Bundle analysis reportBranch Yradex:wt/move-mts-runtime-3-202...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 3, 2026

React MTF Example

#188 Bundle Size — 207.38KiB (0%).

8e59d54(current) vs 44b966c main#178(baseline)

Bundle metrics  Change 1 change
                 Current
#188
     Baseline
#178
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 46.36%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 174 174
No change  Duplicate Modules 68 68
Change  Duplicate Code 46.08%(-0.02%) 46.09%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#188
     Baseline
#178
No change  IMG 111.23KiB 111.23KiB
No change  Other 96.15KiB 96.15KiB

Bundle analysis reportBranch Yradex:wt/move-mts-runtime-3-202...Project dashboard


Generated by RelativeCIDocumentationReport issue

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 3, 2026

Merging this PR will improve performance by 36.99%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 71 untouched benchmarks
⏩ 21 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
002-hello-reactLynx-destroyBackground 930.3 µs 679.1 µs +36.99%

Comparing Yradex:wt/move-mts-runtime-3-20260401 (8e59d54) with main (44b966c)2

Open in CodSpeed

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (7cb10db) during the generation of this report, so 44b966c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Yradex Yradex merged commit e3c1156 into lynx-family:main Apr 3, 2026
77 of 79 checks passed
@Yradex Yradex deleted the wt/move-mts-runtime-3-20260401 branch April 3, 2026 07:13
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