Skip to content

feat: inline worklet-runtime into main-thread.js (ReactLynx)#2358

Open
Huxpro wants to merge 3 commits intomainfrom
Huxpro/inline-worklet-runtime
Open

feat: inline worklet-runtime into main-thread.js (ReactLynx)#2358
Huxpro wants to merge 3 commits intomainfrom
Huxpro/inline-worklet-runtime

Conversation

@Huxpro
Copy link
Copy Markdown
Collaborator

@Huxpro Huxpro commented Mar 19, 2026

Summary

Simplifies worklet-runtime loading by bundling it directly into main-thread.js as a webpack entry instead of injecting it as a separate Lepus chunk. This aligns with Vue Lynx's implementation (completed in PR #67) and removes conditional chunk logic.

Changes

  • Move worklet-runtime path resolution to rspeedy entry setup and add it as a webpack entry import
  • Remove beforeEncode hook that conditionally injected worklet-runtime as a separate chunk
  • Simplify loadWorkletRuntime() from loading via __LoadLepusChunk to a simple guard that checks globalThis.lynxWorkletImpl
  • Update worklet-runtime tests to verify inline bundling instead of separate chunk injection

Impact

  • With worklets: No change (previously bundled in chunk, now in main-thread entry)
  • Without worklets: main-thread.js increases by ~10 kB (worklet-runtime IIFE), acceptable relative to snapshot code size
  • Reduces complexity of ReactWebpackPlugin by removing conditional chunk injection logic

Test Status

Test environment has pre-existing build issues preventing full verification. Changes are structurally sound and align with Vue Lynx pattern.

Summary by CodeRabbit

  • Performance

    • Inlined the worklet runtime into the main-thread bundle to reduce startup overhead and improve initialization.
    • Simplified runtime presence detection for faster, more reliable checks.
  • Chores

    • Updated build configuration and tests to reflect the inlined runtime behavior and removed separate runtime emission.

Simplifies worklet-runtime loading by bundling it directly into main-thread.js
as a webpack entry instead of injecting it as a separate Lepus chunk. This aligns
with Vue Lynx's implementation and removes conditional chunk logic.

- Move worklet-runtime to rspeedy entry setup
- Remove beforeEncode hook chunk injection in ReactWebpackPlugin
- Simplify loadWorkletRuntime() to a guard function
- Update worklet-runtime tests to reflect inline bundling
Copilot AI review requested due to automatic review settings March 19, 2026 11:42
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 19, 2026

🦋 Changeset detected

Latest commit: 740efde

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@lynx-js/react-rsbuild-plugin Minor
@lynx-js/react-webpack-plugin Minor
@lynx-js/react-alias-rsbuild-plugin Minor
@lynx-js/react-refresh-webpack-plugin Major

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 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: f28116c1-84c2-4b93-b8bc-6039e49369be

📥 Commits

Reviewing files that changed from the base of the PR and between f4972fd and 740efde.

📒 Files selected for processing (1)
  • .changeset/inline-worklet-runtime.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/inline-worklet-runtime.md

📝 Walkthrough

Walkthrough

The worklet runtime is no longer emitted as a separate Lepus chunk; it is resolved and inlined into the main-thread entry. The runtime loader was simplified to a boolean guard that checks for globalThis.lynxWorkletImpl.

Changes

Cohort / File(s) Summary
Worklet Runtime Loader
packages/react/worklet-runtime/src/bindings/loadRuntime.ts
Rewrote loadWorkletRuntime(__schema?: string) to a pure guard returning !!globalThis.lynxWorkletImpl; removed __LoadLepusChunk usage and __schema-dependent control flow.
Plugin Entry Resolution
packages/rspeedy/plugin-react/src/entry.ts
Resolve workletRuntimePath once via api.useExposed(...) and reuse the resolved path for main-thread entry imports and plugin configuration instead of resolving multiple times.
Webpack Plugin Chunk Injection
packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts
Removed node:fs import and the hooks.beforeEncode tap that conditionally read and injected a separate worklet-runtime chunk; retained only async main-thread chunk wrapping logic.
Tests & Config
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/index.js, packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/rspack.config.js
Updated test to expect no separate worklet-runtime lepusChunk and to verify runtime presence in main-thread root; test config appends @lynx-js/react/worklet-dev-runtime to main-thread imports via require.resolve.
Release Note
.changeset/inline-worklet-runtime.md
Added changeset documenting that the worklet runtime is now inlined into the main-thread entry and bumped related packages.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • hzy
  • colinaaa
  • Yradex

Poem

🐰 I hopped into the bundle’s seam,
Tucked runtime cozy in the main-thread dream.
No wandering chunk to lose its way,
Now all the code can dance and play.
A tiny hop, a tidy stream — hooray! 🎩✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely summarizes the main change: inlining worklet-runtime into main-thread.js for ReactLynx, which is clearly reflected in all modified files and test updates.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Huxpro/inline-worklet-runtime
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

❌ 99 Tests Failed:

Tests completed Failed Passed Skipped
5070 99 4971 105
View the top 3 failed test(s) by shortest run time
packages/lynx/gesture-runtime/__test__/useMainThreadMemoizedFn.test.tsx > useMainThreadMemoizedFn > should pass arguments properly and return value
Stack Traces | 0.00184s run time
TypeError: globalThis.runWorklet is not a function
 ❯ __test__/useMainThreadMemoizedFn.test.tsx:107:23
packages/motion/__tests__/hooks.test.tsx > Hooks > Real callback invocations > should fire callback when MotionValue changes via jump()
Stack Traces | 0.00211s run time
Error: runOnMainThread can only be used on the background thread.
 ❯ Module.runOnMainThread ...../worklet/call/runOnMainThread.ts:34:11
 ❯ Object.__ __tests__/hooks.test.tsx:273:11
 ❯ some ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:530:22
 ❯ x ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:454:26
 ❯ forEach ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:26
 ❯ finish ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:13
 ❯ Module.act ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:106:2
 ❯ Module.pure_render ...../testing-library/dist/pure.js:14462:9
packages/motion/__tests__/hooks.test.tsx > Hooks > Real callback invocations > should not fire callback after unmount
Stack Traces | 0.00215s run time
Error: runOnMainThread can only be used on the background thread.
 ❯ Module.runOnMainThread ...../worklet/call/runOnMainThread.ts:34:11
 ❯ Object.__ __tests__/hooks.test.tsx:315:11
 ❯ some ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:530:22
 ❯ x ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:454:26
 ❯ forEach ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:26
 ❯ finish ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:13
 ❯ Module.act ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:106:2
 ❯ Module.pure_render ...../testing-library/dist/pure.js:14462:9
packages/motion/__tests__/hooks.test.tsx > Hooks > Real callback invocations > should support multiple listeners on same MotionValue
Stack Traces | 0.00226s run time
Error: runOnMainThread can only be used on the background thread.
 ❯ Module.runOnMainThread ...../worklet/call/runOnMainThread.ts:34:11
 ❯ Object.__ src/hooks/useMotionEvent.ts:30:10
 ❯ some ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:530:22
 ❯ x ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:454:26
 ❯ forEach ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:26
 ❯ finish ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:13
 ❯ Module.act ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:106:2
 ❯ Module.pure_render ...../testing-library/dist/pure.js:14462:9
packages/lynx/gesture-runtime/__test__/gesture-callback.test.tsx > gestures mt > stateManager.end should call __SetGestureDetector correctly
Stack Traces | 0.00229s run time
TypeError: globalThis.runWorklet is not a function
 ❯ Module.triggerGestureCallback __test__/utils/callback.ts:45:16
 ❯ cb __test__/gesture-callback.test.tsx:217:7
 ❯ Module.act ../../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:91:12
 ❯ __test__/gesture-callback.test.tsx:212:11
packages/lynx/gesture-runtime/__test__/gesture-callback.test.tsx > gestures mt > stateManager.interceptGesture should call __ConsumeGesture correctly
Stack Traces | 0.0023s run time
TypeError: globalThis.runWorklet is not a function
 ❯ Module.triggerGestureCallback __test__/utils/callback.ts:45:16
 ❯ cb __test__/gesture-callback.test.tsx:309:7
 ❯ Module.act ../../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:91:12
 ❯ __test__/gesture-callback.test.tsx:304:11
packages/lynx/gesture-runtime/__test__/gesture-callback.test.tsx > gestures mt > stateManager.fail should call __SetGestureDetector correctly
Stack Traces | 0.00232s run time
TypeError: globalThis.runWorklet is not a function
 ❯ Module.triggerGestureCallback __test__/utils/callback.ts:45:16
 ❯ cb __test__/gesture-callback.test.tsx:171:7
 ❯ Module.act ../../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:91:12
 ❯ __test__/gesture-callback.test.tsx:166:11
packages/lynx/gesture-runtime/__test__/gesture-callback.test.tsx > gestures mt > stateManager.consumeGesture should call __ConsumeGesture correctly
Stack Traces | 0.00235s run time
TypeError: globalThis.runWorklet is not a function
 ❯ Module.triggerGestureCallback __test__/utils/callback.ts:45:16
 ❯ cb __test__/gesture-callback.test.tsx:263:7
 ❯ Module.act ../../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:91:12
 ❯ __test__/gesture-callback.test.tsx:258:11
packages/lynx/gesture-runtime/__test__/useMainThreadMemoizedFn.test.tsx > useMainThreadMemoizedFn > should return a stable reference but execute the latest logic on main thread
Stack Traces | 0.0025s run time
TypeError: globalThis.runWorklet is not a function
 ❯ __test__/useMainThreadMemoizedFn.test.tsx:77:26
packages/motion/__tests__/hooks.test.tsx > Hooks > Real callback invocations > should fire callback when MotionValue changes via set()
Stack Traces | 0.00299s run time
Error: runOnMainThread can only be used on the background thread.
 ❯ Module.runOnMainThread ...../worklet/call/runOnMainThread.ts:34:11
 ❯ Object.__ __tests__/hooks.test.tsx:231:11
 ❯ some ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:530:22
 ❯ x ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:454:26
 ❯ forEach ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:26
 ❯ finish ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:13
 ❯ Module.act ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:106:2
 ❯ Module.pure_render ...../testing-library/dist/pure.js:14462:9
packages/lynx/gesture-runtime/__test__/gesture-callback.test.tsx > gestures mt > stateManager.active should call __SetGestureDetector correctly
Stack Traces | 0.00322s run time
TypeError: globalThis.runWorklet is not a function
 ❯ Module.triggerGestureCallback __test__/utils/callback.ts:45:16
 ❯ cb __test__/gesture-callback.test.tsx:125:7
 ❯ Module.act ../../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:91:12
 ❯ __test__/gesture-callback.test.tsx:120:11
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-image-src.web.bundle
Stack Traces | 0.00406s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48286
 ❯ ../../../root:8:48502
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:61:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-svg-with-css.web.bundle
Stack Traces | 0.00412s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:19:8190
 ❯ ../../../root:19:8406
 ❯ ../../../root:20:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:81:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-overlay-ng-demo.web.bundle
Stack Traces | 0.00428s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:53168
 ❯ ../../../root:8:53384
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:73:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-input-value.web.bundle
Stack Traces | 0.00439s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:50378
 ❯ ../../../root:8:50594
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:65:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-refresh-view-demo.web.bundle
Stack Traces | 0.00445s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:50297
 ❯ ../../../root:8:50513
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:77:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-swiper-autoplay.web.bundle
Stack Traces | 0.00489s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:50514
 ❯ ../../../root:8:50730
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:85:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-audio-tt-play.web.bundle
Stack Traces | 0.00499s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:49848
 ❯ ../../../root:8:50064
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:57:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-scroll-view.web.bundle
Stack Traces | 0.00502s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48247
 ❯ ../../../root:8:48463
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:53:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-text-color.web.bundle
Stack Traces | 0.00506s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48270
 ❯ ../../../root:8:48486
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:89:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-textarea-placeholder.web.bundle
Stack Traces | 0.00515s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:50208
 ❯ ../../../root:8:50424
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:93:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-x-viewpager-ng-bindchange.web.bundle
Stack Traces | 0.00521s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:49601
 ❯ ../../../root:8:49817
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:97:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-list-basic.web.bundle
Stack Traces | 0.00547s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:55188
 ❯ ../../../root:8:55404
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:69:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from config-css-remove-scope-false-display-linear.web.bundle
Stack Traces | 0.00557s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48498
 ❯ ../../../root:8:48714
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:37:9
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > runOnBackground works
Stack Traces | 0.00573s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:375:16
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-element-text-baseline.web.bundle
Stack Traces | 0.00616s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48955
 ❯ ../../../root:8:49171
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:49:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from config-css-default-display-linear-false.web.bundle
Stack Traces | 0.00633s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48669
 ❯ ../../../root:8:48885
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:33:9
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from config-css-selector-false-remove-css-and-style-collapsed.web.bundle
Stack Traces | 0.00653s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48708
 ❯ ../../../root:8:48924
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:43:9
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > main thread script props
Stack Traces | 0.00733s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:279:27
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > main-thread script should not update MTS function when enable background
Stack Traces | 0.0088s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:191:27
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > main-thread script should not throw when enable background thread
Stack Traces | 0.0105s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:109:27
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > nest runOnBackground->runOnMainThread works
Stack Traces | 0.0127s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:543:51
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > worklet ref should work
Stack Traces | 0.0144s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:470:27
packages/web-platform/web-core-wasm-e2e/server-tests/server-e2e.test.ts > executeTemplate should run lepusCode.root from basic-pink-rect.web.bundle
Stack Traces | 0.015s run time
TypeError: t.addEventListener is not a function
 ❯ ../../../root:8:48241
 ❯ ../../../root:8:48457
 ❯ ../../../root:9:11
 ❯ Module.executeTemplate ...../ts/server/deploy.ts:71:8
 ❯ runSnapshotTest server-tests/server-e2e.test.ts:14:24
 ❯ server-tests/server-e2e.test.ts:29:9
packages/lynx/gesture-runtime/__test__/useMainThreadMemoizedFn.test.tsx > useMainThreadMemoizedFn > should return a stable reference but execute the latest logic on background thread
Stack Traces | 0.0183s run time
TypeError: globalThis.runWorklet is not a function
 ❯ __test__/useMainThreadMemoizedFn.test.tsx:37:26
packages/lynx/gesture-runtime/__test__/gesture-callback.test.tsx > gestures mt > bind gestures should call papi correctly
Stack Traces | 0.0279s run time
TypeError: globalThis.runWorklet is not a function
 ❯ Module.triggerGestureCallback __test__/utils/callback.ts:45:16
 ❯ cb __test__/gesture-callback.test.tsx:80:7
 ❯ Module.act ../../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:91:12
 ❯ __test__/gesture-callback.test.tsx:75:11
packages/motion/__tests__/hooks.test.tsx > Hooks > Integration scenarios > should support multiple motion value refs
Stack Traces | 0.0421s run time
Error: runOnMainThread can only be used on the background thread.
 ❯ Module.runOnMainThread ...../worklet/call/runOnMainThread.ts:34:11
 ❯ Object.__ src/hooks/useMotionEvent.ts:30:10
 ❯ some ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:530:22
 ❯ x ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../hooks/src/index.js:454:26
 ❯ forEach ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:26
 ❯ finish ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:72:13
 ❯ Module.act ../../node_modules/.pnpm/@lynx-js+internal-preact@10.28.4-ee7bb26/node_modules/@.../test-utils/src/index.js:106:2
 ❯ Module.pure_render ...../testing-library/dist/pure.js:14462:9
packages/react/testing-library/src/__tests__/worklet.test.jsx > worklet > main-thread script should work
Stack Traces | 0.044s run time
AssertionError: expected "spy" to be called 1 times, but got 0 times
 ❯ src/__tests__/worklet.test.jsx:35:16
packages/rspeedy/plugin-react/test/config.test.ts > Config > lazyBundle on production mode
Stack Traces | 0.0505s run time
Error: Snapshot `Config > lazyBundle on production mode 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./src/index.js",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:2190:31
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > clamp > should clamp value within range
Stack Traces | 0.0533s run time
TypeError: Cannot read properties of undefined (reading 'within')
 ❯ __tests__/wrapper/animate.test.tsx:399:22
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > motionValue > should delegate to motion-dom motionValue
Stack Traces | 0.0544s run time
TypeError: Cannot read properties of undefined (reading '0')
 ❯ __tests__/wrapper/animate.test.tsx:249:34
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > motionValue > should create motionValue with options
Stack Traces | 0.0544s run time
TypeError: Cannot read properties of undefined (reading '0')
 ❯ __tests__/wrapper/animate.test.tsx:268:34
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > Array of elements > should animate array of elements
Stack Traces | 0.0551s run time
AssertionError: expected undefined to be true // Object.is equality

- Expected: 
true

+ Received: 
undefined

 ❯ __tests__/wrapper/animate.test.tsx:437:58
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > Multiple entries
Stack Traces | 0.0561s run time
Error: Snapshot `Config > Output Filename > Multiple entries 1` mismatched

- Expected
+ Received

@@ -8,10 +8,11 @@
    },
    "bar__main-thread": {
      "filename": ".rspeedy/bar/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
    "foo": {
      "filename": ".rspeedy/foo/background.[contenthash:8].js",
@@ -22,9 +23,10 @@
    },
    "foo__main-thread": {
      "filename": ".rspeedy/foo/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:892:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with environment["lynx"].output.filenameHash: false
Stack Traces | 0.0569s run time
Error: Snapshot `Config > Output Filename > with environment["lynx"].output.filenameHash: false 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1262:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filename.js: "[name].js"
Stack Traces | 0.0579s run time
Error: Snapshot `Config > Output Filename > with output.filename.js: "[name].js" 1` mismatched

- Expected
+ Received

@@ -8,10 +8,11 @@
    },
    "bar__main-thread": {
      "filename": ".rspeedy/bar/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
    "foo": {
      "filename": ".rspeedy/foo/background.js",
@@ -29,16 +30,18 @@
    },
    "foo/baz__main-thread": {
      "filename": "..../foo/baz/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
-     ],
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
+     ],
      "layer": "react:main-thread",
    },
    "foo__main-thread": {
      "filename": ".rspeedy/foo/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1014:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > Defaults in production
Stack Traces | 0.0588s run time
Error: Snapshot `Config > Output Filename > Defaults in production 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:848:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filenameHash: ""
Stack Traces | 0.0595s run time
Error: Snapshot `Config > Output Filename > with output.filenameHash: "" 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1354:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filename.js: "[name]/[name].js"
Stack Traces | 0.0598s run time
Error: Snapshot `Config > Output Filename > with output.filename.js: "[name]/[name].js" 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1090:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > lazyBundle on development mode
Stack Traces | 0.0599s run time
Error: Snapshot `Config > lazyBundle on development mode 1` mismatched

- Expected
+ Received

@@ -12,9 +12,10 @@
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "<WORKSPACE>.../css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs",
        "./src/index.js",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:2167:31
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > mix > should interpolate between two numbers
Stack Traces | 0.0603s run time
AssertionError: expected undefined to be 50 // Object.is equality

- Expected: 
50

+ Received: 
undefined

 ❯ __tests__/wrapper/animate.test.tsx:303:48
packages/rspeedy/plugin-react/test/hotUpdate.test.ts > hot update > should not prepend refresh runtime when hmr is set to false
Stack Traces | 0.0613s run time
Error: Snapshot `hot update > should not prepend refresh runtime when hmr is set to false 1` mismatched

- Expected
+ Received

@@ -9,9 +9,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./src/index.js",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/hotUpdate.test.ts:98:26
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > progress > should calculate progress between two values
Stack Traces | 0.0625s run time
AssertionError: expected undefined to be 0.5 // Object.is equality

- Expected: 
0.5

+ Received: 
undefined

 ❯ __tests__/wrapper/animate.test.tsx:366:53
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > animate > should delegate to framer-motion animate with MotionValue
Stack Traces | 0.0627s run time
AssertionError: expected undefined to be defined
 ❯ __tests__/wrapper/animate.test.tsx:204:50
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > mix > should return mixer function when called with two args
Stack Traces | 0.0628s run time
AssertionError: expected undefined to be 'function' // Object.is equality

- Expected: 
"function"

+ Received: 
undefined

 ❯ __tests__/wrapper/animate.test.tsx:334:48
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filename.js and output.filenameHash
Stack Traces | 0.0633s run time
Error: Snapshot `Config > Output Filename > with output.filename.js and output.filenameHash 1` mismatched

- Expected
+ Received

@@ -8,10 +8,11 @@
    },
    "bar__main-thread": {
      "filename": ".rspeedy/bar/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
    "foo": {
      "filename": ".rspeedy/foo/background.js",
@@ -29,16 +30,18 @@
    },
    "foo/baz__main-thread": {
      "filename": "..../foo/baz/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
-     ],
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
+     ],
      "layer": "react:main-thread",
    },
    "foo__main-thread": {
      "filename": ".rspeedy/foo/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1141:29
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > stagger > should delegate to framer-motion stagger
Stack Traces | 0.0644s run time
AssertionError: expected undefined to deeply equal [ 0.1 ]

- Expected: 
[
  0.1,
]

+ Received: 
undefined

 ❯ __tests__/wrapper/animate.test.tsx:227:50
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filenameHash: "contenthash"
Stack Traces | 0.0646s run time
Error: Snapshot `Config > Output Filename > with output.filenameHash: "contenthash" 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1308:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > Defaults in development
Stack Traces | 0.0656s run time
Error: Snapshot `Config > Output Filename > Defaults in development 1` mismatched

- Expected
+ Received

@@ -12,9 +12,10 @@
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "<WORKSPACE>.../css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs",
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1397:29
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filenameHash: "contenthash" in development
Stack Traces | 0.0676s run time
Error: Snapshot `Config > Output Filename > with output.filenameHash: "contenthash" in development 1` mismatched

- Expected
+ Received

@@ -12,9 +12,10 @@
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "<WORKSPACE>.../css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs",
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1447:29
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > animate > should delegate to framer-motion animate with Element
Stack Traces | 0.0689s run time
AssertionError: expected undefined to be defined
 ❯ __tests__/wrapper/animate.test.tsx:180:27
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > Nested entries
Stack Traces | 0.0716s run time
Error: Snapshot `Config > Output Filename > Nested entries 1` mismatched

- Expected
+ Received

@@ -8,10 +8,11 @@
    },
    "foo/bar__main-thread": {
      "filename": "..../foo/bar/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
    "foo/baz": {
      "filename": "..../foo/baz/background.[contenthash:8].js",
@@ -22,9 +23,10 @@
    },
    "foo/baz__main-thread": {
      "filename": "..../foo/baz/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:950:29
packages/motion/__tests__/easings.test.tsx > Easings > should call registered functions correctly
Stack Traces | 0.0729s run time
AssertionError: expected undefined to be defined
 ❯ __tests__/easings.test.tsx:92:29
packages/motion/__tests__/wrapper/animate.test.tsx > Wrapper Animation > animate > should delegate to framer-motion animate with string selector
Stack Traces | 0.0788s run time
AssertionError: expected undefined to be defined
 ❯ __tests__/wrapper/animate.test.tsx:146:27
packages/motion/__tests__/spring.test.tsx > Spring > should call registered springHandle
Stack Traces | 0.0805s run time
AssertionError: expected "spy" to be called with arguments: [ ObjectContaining{…} ]

Number of calls: 0

 ❯ __tests__/spring.test.tsx:51:24
packages/rspeedy/plugin-react/test/hotUpdate.test.ts > hot update > should prepend hot update runtime when liveReload is set to false
Stack Traces | 0.0851s run time
Error: Snapshot `hot update > should prepend hot update runtime when liveReload is set to false 1` mismatched

- Expected
+ Received

@@ -12,9 +12,10 @@
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "<WORKSPACE>.../css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs",
        "./src/index.js",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/hotUpdate.test.ts:60:26
packages/webpack/react-webpack-plugin/test/cases.test.ts > react > reactCases/worklet-runtime/chunk > reactCases/worklet-runtime/chunk > reactCases/worklet-runtime/chunk - rspack > reactCases/worklet-runtime/chunk - rspack should run sync
Stack Traces | 0.0918s run time
TypeError: lynx.getJSContext is not a function
 ❯ initEventListeners .../worklet-runtime/chunk/main__main-thread.js:12475:30
 ❯ .../worklet-runtime/chunk/main__main-thread.js:13038:9
 ❯ .../worklet-runtime/chunk/main__main-thread.js:13040:3
 ❯ .../worklet-runtime/chunk/main__main-thread.js:13042:3
 ❯ Object.<anonymous> .../worklet-runtime/chunk/main__main-thread.js:13044:3
 ❯ ../../../node_modules/.pnpm/@rspack+test-tools@1.5.6_@r_151074838e946d8a93d8da2d9c96ffb3/node_modules/@.../runner/node/index.js:330:16
 ❯ ../../../node_modules/.pnpm/@rspack+test-tools@1.5.6_@r_151074838e946d8a93d8da2d9c96ffb3/node_modules/@.../runner/node/index.js:258:45
 ❯ ../../../node_modules/.pnpm/@rspack+test-tools@1.5.6_@r_151074838e946d8a93d8da2d9c96ffb3/node_modules/@.../runner/node/index.js:97:20
 ❯ RspeedyNormalRunner.run ../../../node_modules/.pnpm/@rspack+test-tools@1.5.6_@r_151074838e946d8a93d8da2d9c96ffb3/node_modules/@.../runner/node/index.js:83:38
 ❯ RspeedyNormalRunner.run ...../test-tools/src/suite.ts:199:29
packages/motion/__tests__/animate.test.tsx > animate() > animate with function setter > should call function setter during animation
Stack Traces | 0.155s run time
AssertionError: expected 0 to be greater than 0
 ❯ __tests__/animate.test.tsx:245:29
packages/motion/__tests__/animate.test.tsx > animate() > animate with number value > should animate from number value
Stack Traces | 0.157s run time
AssertionError: expected undefined to be true // Object.is equality

- Expected: 
true

+ Received: 
undefined

 ❯ __tests__/animate.test.tsx:283:25
packages/rspeedy/plugin-react/test/config.test.ts > Config > Output Filename > with output.filenameHash: false
Stack Traces | 0.158s run time
Error: Snapshot `Config > Output Filename > with output.filenameHash: false 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./fixtures/basic.tsx",
+       "<WORKSPACE>.../worklet-runtime/dist/main.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/config.test.ts:1215:29
packages/motion/__tests__/animate.test.tsx > animate() > animate with MotionValue > should call onUpdate during animation
Stack Traces | 0.163s run time
AssertionError: expected 0 to be greater than 0
 ❯ __tests__/animate.test.tsx:118:27
packages/motion/__tests__/animate.test.tsx > animate() > animate with MotionValue > should support then() for promise-like callback
Stack Traces | 0.163s run time
AssertionError: expected undefined to be true // Object.is equality

- Expected: 
true

+ Received: 
undefined

 ❯ __tests__/animate.test.tsx:204:26
packages/motion/__tests__/animate.test.tsx > animate() > animate with MotionValue > should animate MotionValue and call onComplete when finished
Stack Traces | 0.182s run time
AssertionError: expected undefined to be true // Object.is equality

- Expected: 
true

+ Received: 
undefined

 ❯ __tests__/animate.test.tsx:79:25
packages/motion/__tests__/animate.test.tsx > animate() > spring animation > should use spring animation when type is spring
Stack Traces | 0.206s run time
AssertionError: expected false to be true // Object.is equality

- Expected
+ Received

- true
+ false

 ❯ __tests__/animate.test.tsx:337:28
packages/motion/__tests__/animate.test.tsx > animate() > MotionValue integration > should stop previous animation when starting new one
Stack Traces | 0.218s run time
AssertionError: expected undefined to be true // Object.is equality

- Expected: 
true

+ Received: 
undefined

 ❯ __tests__/animate.test.tsx:389:31
packages/rspeedy/plugin-react/test/hotUpdate.test.ts > hot update > should not prepend dev runtime when hmr and liveReload is set to false both
Stack Traces | 0.224s run time
Error: Snapshot `hot update > should not prepend dev runtime when hmr and liveReload is set to false both 1` mismatched

- Expected
+ Received

@@ -8,9 +8,10 @@
    },
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "./src/index.js",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/hotUpdate.test.ts:134:26
packages/motion/__tests__/mini-polyfill.test.tsx > Mini Polyfill Independence > should work in main thread environment
Stack Traces | 0.237s run time
AssertionError: expected null to be 'success' // Object.is equality

- Expected: 
"success"

+ Received: 
null

 ❯ __tests__/mini-polyfill.test.tsx:53:20
packages/motion/__tests__/animate.test.tsx > animate() > animate with MotionValue > should stop animation when stop() is called
Stack Traces | 0.308s run time
AssertionError: expected undefined to be true // Object.is equality

- Expected: 
true

+ Received: 
undefined

 ❯ __tests__/animate.test.tsx:165:23
packages/rspeedy/plugin-react/test/hotUpdate.test.ts > hot update > should prepend hot update runtime in development mode
Stack Traces | 0.796s run time
Error: Snapshot `hot update > should prepend hot update runtime in development mode 1` mismatched

- Expected
+ Received

@@ -12,9 +12,10 @@
    "main__main-thread": {
      "filename": ".rspeedy/main/main-thread.js",
      "import": [
        "<WORKSPACE>.../css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs",
        "./src/index.js",
+       "<WORKSPACE>.../worklet-runtime/dist/dev.js",
      ],
      "layer": "react:main-thread",
    },
  }

 ❯ test/hotUpdate.test.ts:22:26
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-bindtouchstart
Stack Traces | 3.8s run time
reactlynx.spec.ts:387:5 basic-mts-bindtouchstart
tests/react.spec.ts::reactlynx3 tests › basic › basic-replaceelement
Stack Traces | 6.04s run time
react.spec.ts:343:5 basic-replaceelement
tests/react.spec.ts::reactlynx3 tests › basic › basic-style-remove
Stack Traces | 7.13s run time
react.spec.ts:297:5 basic-style-remove
tests/react.spec.ts::reactlynx3 tests › apis › api-globalThis
Stack Traces | 7.17s run time
react.spec.ts:1863:5 api-globalThis
tests/react.spec.ts::reactlynx3 tests › basic › basic-image
Stack Traces | 7.22s run time
react.spec.ts:363:5 basic-image
tests/react.spec.ts::reactlynx3 tests › basic › basic-setstate-in-constructor
Stack Traces | 7.23s run time
react.spec.ts:169:5 basic-setstate-in-constructor
tests/react.spec.ts::reactlynx3 tests › basic › basic-event-bubble-dataset
Stack Traces | 7.41s run time
react.spec.ts:239:5 basic-event-bubble-dataset
tests/react.spec.ts::reactlynx3 tests › basic › basic-bindtap-detail
Stack Traces | 7.5s run time
react.spec.ts:129:5 basic-bindtap-detail
tests/react.spec.ts::reactlynx3 tests › basic › basic-scroll-view
Stack Traces | 7.74s run time
react.spec.ts:370:5 basic-scroll-view
tests/react.spec.ts::reactlynx3 tests › basic › basic-pink-rect
Stack Traces | 7.77s run time
react.spec.ts:68:5 basic-pink-rect
tests/react.spec.ts::reactlynx3 tests › basic › basic-style-remove-one-property
Stack Traces | 7.9s run time
react.spec.ts:307:5 basic-style-remove-one-property
tests/react.spec.ts::reactlynx3 tests › basic › basic-event-target-id
Stack Traces | 8.1s run time
react.spec.ts:140:5 basic-event-target-id
tests/react.spec.ts::reactlynx3 tests › basic › basic-event-dataset
Stack Traces | 8.14s run time
react.spec.ts:225:5 basic-event-dataset
tests/react.spec.ts::reactlynx3 tests › basic › basic-globalProps
Stack Traces | 8.51s run time
react.spec.ts:181:5 basic-globalProps
tests/react.spec.ts::reactlynx3 tests › basic › basic-list-rendering
Stack Traces | 8.68s run time
react.spec.ts:250:5 basic-list-rendering
tests/react.spec.ts::reactlynx3 tests › basic › basic-style-combinator
Stack Traces | 9.16s run time
react.spec.ts:291:5 basic-style-combinator
tests/react.spec.ts::reactlynx3 tests › basic › basic-class-selector
Stack Traces | 9.31s run time
react.spec.ts:151:5 basic-class-selector
tests/react.spec.ts::reactlynx3 tests › basic › basic-bindtap
Stack Traces | 9.32s run time
react.spec.ts:108:5 basic-bindtap
tests/react.spec.ts::reactlynx3 tests › basic › basic-style-root-selector
Stack Traces | 9.45s run time
react.spec.ts:317:5 basic-style-root-selector
tests/react.spec.ts::reactlynx3 tests › basic › basic-globalProps-reload
Stack Traces | 9.82s run time
react.spec.ts:195:5 basic-globalProps-reload
tests/react.spec.ts::reactlynx3 tests › basic › basic-lynx-reload
Stack Traces | 9.84s run time
react.spec.ts:264:5 basic-lynx-reload
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-bindtouchstart
Stack Traces | 9.91s run time
react.spec.ts:407:5 basic-mts-bindtouchstart
tests/react.spec.ts::reactlynx3 tests › basic › basic-reload-page-only-one
Stack Traces | 9.97s run time
react.spec.ts:91:5 basic-reload-page-only-one
tests/react.spec.ts::reactlynx3 tests › basic › basic-setsate-with-cb
Stack Traces | 10.6s run time
react.spec.ts:175:5 basic-setsate-with-cb
tests/react.spec.ts::reactlynx3 tests › basic › api-createLynxView-browserConfig
Stack Traces | 10.7s run time
react.spec.ts:216:5 api-createLynxView-browserConfig
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-systeminfo
Stack Traces | 11.2s run time
react.spec.ts:392:5 basic-mts-systeminfo
tests/react.spec.ts::reactlynx3 tests › basic › basic-bindtap-simultaneous
Stack Traces | 11.3s run time
react.spec.ts:119:5 basic-bindtap-simultaneous
tests/react.spec.ts::reactlynx3 tests › basic › basic-dataprocessor
Stack Traces | 11.8s run time
react.spec.ts:188:5 basic-dataprocessor
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-bindtap
Stack Traces | 11.9s run time
react.spec.ts:378:5 basic-mts-bindtap
tests/react.spec.ts::reactlynx3 tests › basic › basic-reload
Stack Traces | 12.4s run time
react.spec.ts:77:5 basic-reload
tests/react.spec.ts::reactlynx3 tests › basic › basic-wrapper-element-do-not-impact-layout
Stack Traces | 13.4s run time
react.spec.ts:275:5 basic-wrapper-element-do-not-impact-layout
tests/react.spec.ts::reactlynx3 tests › basic › basic-useeffect-hydrate
Stack Traces | 14.2s run time
react.spec.ts:323:5 basic-useeffect-hydrate
tests/react.spec.ts::reactlynx3 tests › basic › basic-lazy-component-css-selector-false-remove-css-and-reuse-css
Stack Traces | 23.8s run time
react.spec.ts:853:5 basic-lazy-component-css-selector-false-remove-css-and-reuse-css
tests/react.spec.ts::reactlynx3 tests › basic › basic-lazy-component-css-selector-false-remove-all
Stack Traces | 24.8s run time
react.spec.ts:842:5 basic-lazy-component-css-selector-false-remove-all
tests/react.spec.ts::reactlynx3 tests › basic › basic-lazy-component-css-selector-false-inline-remove-css-remove-inline
Stack Traces | 25.6s run time
react.spec.ts:813:5 basic-lazy-component-css-selector-false-inline-remove-css-remove-inline
tests/react.spec.ts::reactlynx3 tests › basic › basic-ref-main-invoke-ui-method
Stack Traces | 25.8s run time
react.spec.ts:483:5 basic-ref-main-invoke-ui-method
tests/ssr-no-js.spec.ts::SSR No JS › basic-pink-rect
Stack Traces | 26.3s run time
ssr-no-js.spec.ts:6:3 basic-pink-rect
tests/react.spec.ts::reactlynx3 tests › basic › basic-lazy-component-css-selector-false-inline-css-change-same-time
Stack Traces | 26.7s run time
react.spec.ts:800:5 basic-lazy-component-css-selector-false-inline-css-change-same-time
tests/react.spec.ts::reactlynx3 tests › basic › basic-main-query-selector
Stack Traces | 28.2s run time
react.spec.ts:499:5 basic-main-query-selector
tests/react.spec.ts::reactlynx3 tests › basic › basic-lazy-component-css-selector-false-multi-level-selector
Stack Traces | 28.8s run time
react.spec.ts:830:5 basic-lazy-component-css-selector-false-multi-level-selector
tests/react.spec.ts::reactlynx3 tests › basic › basic-lazy-component-css-selector-false-exchange-class
Stack Traces | 30.1s run time
react.spec.ts:787:5 basic-lazy-component-css-selector-false-exchange-class
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-mainthread-nested-ref
Stack Traces | 31.8s run time
react.spec.ts:445:5 basic-mts-mainthread-nested-ref
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-mainthread-ref
Stack Traces | 35.3s run time
react.spec.ts:451:5 basic-mts-mainthread-ref
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-run-on-main-thread
Stack Traces | 36s run time
react.spec.ts:471:5 basic-mts-run-on-main-thread
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-bindtap-change-element-background
Stack Traces | 36.2s run time
react.spec.ts:435:5 basic-mts-bindtap-change-element-background
tests/react.spec.ts::reactlynx3 tests › basic › basic-mts-run-on-background
Stack Traces | 36.8s run time
react.spec.ts:461:5 basic-mts-run-on-background
tests/reactlynx.spec.ts::reactlynx3 tests › apis › api-globalThis
Stack Traces | 39.6s run time
reactlynx.spec.ts:1803:5 api-globalThis
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-bindtap
Stack Traces | 41.9s run time
reactlynx.spec.ts:358:5 basic-mts-bindtap
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-systeminfo
Stack Traces | 68.3s run time
reactlynx.spec.ts:372:5 basic-mts-systeminfo
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-mainthread-nested-ref
Stack Traces | 74.8s run time
reactlynx.spec.ts:425:5 basic-mts-mainthread-nested-ref
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-run-on-main-thread
Stack Traces | 79.4s run time
reactlynx.spec.ts:451:5 basic-mts-run-on-main-thread
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-mainthread-ref
Stack Traces | 80.7s run time
reactlynx.spec.ts:431:5 basic-mts-mainthread-ref
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-run-on-background
Stack Traces | 94.9s run time
reactlynx.spec.ts:441:5 basic-mts-run-on-background
tests/reactlynx.spec.ts::reactlynx3 tests › basic › basic-mts-bindtap-change-element-background
Stack Traces | 107s run time
reactlynx.spec.ts:415:5 basic-mts-bindtap-change-element-background

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies ReactLynx worklet runtime loading by inlining the worklet-runtime into the generated main-thread.js bundle (as an entry import) instead of conditionally injecting it as a separate Lepus chunk, aligning behavior with the Vue Lynx approach.

Changes:

  • Adds @lynx-js/react/worklet-*-runtime to the main-thread entry imports during rspeedy entry setup (and updates the worklet-runtime test case config accordingly).
  • Removes the beforeEncode hook logic in ReactWebpackPlugin that conditionally injected a worklet-runtime Lepus chunk.
  • Updates loadWorkletRuntime() to a guard that checks globalThis.lynxWorkletImpl and adjusts tests to validate inline bundling.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/rspack.config.js Updates test bundler config to inline worklet runtime via entry imports.
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/index.js Updates assertions to verify inline presence rather than a separate Lepus chunk.
packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts Removes conditional worklet-runtime Lepus chunk injection logic from beforeEncode.
packages/rspeedy/plugin-react/src/entry.ts Adds worklet-runtime path resolution earlier and includes it in main-thread entry imports.
packages/react/worklet-runtime/src/bindings/loadRuntime.ts Changes loadWorkletRuntime() from chunk-loader behavior to a guard-only check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.add({
layer: LAYERS.MAIN_THREAD,
import: imports,
import: [...imports, workletRuntimePath],
Comment on lines +20 to +21
defaultConfig.entry['main__main-thread'].import,
require.resolve('@lynx-js/react/worklet-dev-runtime'),
Comment on lines 262 to 266
const hooks = LynxTemplatePlugin.getLynxTemplatePluginHooks(compilation);

const { RawSource, ConcatSource } = compiler.webpack.sources;
hooks.beforeEncode.tap(
this.constructor.name,
(args) => {
const lepusCode = args.encodeData.lepusCode;
if (
lepusCode.root?.source.source().toString()?.includes(
'registerWorkletInternal',
)
) {
lepusCode.chunks.push({
name: 'worklet-runtime',
source: new RawSource(fs.readFileSync(
options.workletRuntimePath,
'utf8',
)),
info: {
['lynx:main-thread']: true,
},
});
}
return args;
},
);
const { ConcatSource } = compiler.webpack.sources;

// Inject `module.exports` for async main-thread chunks
Comment on lines +26 to 27
expect(json['lepusCode']['root'].includes('lynxWorkletImpl'))
.toBe(true);
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts (1)

67-71: Consider removing unused workletRuntimePath option.

The workletRuntimePath option is declared and passed to the plugin (from entry.ts line 284), but it's never used within ReactWebpackPlugin.apply(). The chunk injection logic that previously used this path has been removed—the runtime is now bundled via entry imports in entry.ts.

Unless there's a planned future use for this option in the plugin, consider removing it to avoid confusion.

♻️ Proposed cleanup
 interface ReactWebpackPluginOptions {
   // ... other options ...

-  /**
-   * The file path of `@lynx-js/react/worklet-runtime`.
-   */
-  workletRuntimePath: string;
 }

And in defaultOptions:

     profile: undefined,
-    workletRuntimePath: '',

And in entry.ts:

       .use(ReactWebpackPlugin, [{
         // ... other options ...
-        workletRuntimePath,
       }])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts` around lines
67 - 71, Remove the unused workletRuntimePath option: delete the
workletRuntimePath property from the plugin options interface/type, remove any
defaultOptions entry for workletRuntimePath, stop passing workletRuntimePath
into the ReactWebpackPlugin constructor (the callsite in entry.ts), and remove
any references to workletRuntimePath inside ReactWebpackPlugin.apply(); ensure
the plugin still compiles by updating the constructor signature and any usages
of the options object (e.g., ReactWebpackPlugin and defaultOptions) to no longer
include workletRuntimePath.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts`:
- Around line 67-71: Remove the unused workletRuntimePath option: delete the
workletRuntimePath property from the plugin options interface/type, remove any
defaultOptions entry for workletRuntimePath, stop passing workletRuntimePath
into the ReactWebpackPlugin constructor (the callsite in entry.ts), and remove
any references to workletRuntimePath inside ReactWebpackPlugin.apply(); ensure
the plugin still compiles by updating the constructor signature and any usages
of the options object (e.g., ReactWebpackPlugin and defaultOptions) to no longer
include workletRuntimePath.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f3c16259-b198-444b-84e1-4e8d35a21203

📥 Commits

Reviewing files that changed from the base of the PR and between 726f600 and 65c8566.

📒 Files selected for processing (5)
  • packages/react/worklet-runtime/src/bindings/loadRuntime.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts
  • packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/index.js
  • packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/rspack.config.js

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Mar 19, 2026

Web Explorer

#8270 Bundle Size — 385.21KiB (0%).

740efde(current) vs 726f600 main#8237(baseline)

Bundle metrics  Change 1 change
                 Current
#8270
     Baseline
#8237
No change  Initial JS 155.59KiB 155.59KiB
No change  Initial CSS 35.1KiB 35.1KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 237(-0.42%) 238
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.97% 2.97%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8270
     Baseline
#8237
No change  JS 254.26KiB 254.26KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.1KiB 35.1KiB

Bundle analysis reportBranch Huxpro/inline-worklet-runtimeProject dashboard


Generated by RelativeCIDocumentationReport issue

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