-
Notifications
You must be signed in to change notification settings - Fork 122
test: strengthen worklet runtime guardrails #2373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Yradex
merged 10 commits into
lynx-family:main
from
Yradex:wt/move-mts-runtime-2-20260319
Mar 26, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e3590f8
test(transform): strengthen worklet runtime guardrails
Yradex eb138ae
test(webpack): strengthen worklet runtime bundler guardrails
Yradex 9bd717f
test(webpack): guard single worklet runtime injection
Yradex ed531b8
test(webpack): prove multiple worklets reach main-thread output
Yradex 32142c8
test(webpack): assert unique worklet registrations
Yradex 090e69d
test(worklet-runtime): cover repeated initialization
Yradex 6659207
test(testing-library): cover multiple main-thread worklets
Yradex 91dbfc4
test(runtime): reduce worklet guardrail brittleness
Yradex 421ce08
fix(worklet-runtime): clear stale worklet cache on init
Yradex cdf5f12
test(worklet-runtime): drop repeated init guardrail
Yradex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 1 addition & 23 deletions
24
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1 @@ | ||
| /// <reference types="vitest/globals" /> | ||
| // @ts-check | ||
|
|
||
| import fs from 'node:fs/promises'; | ||
| import path from 'node:path'; | ||
|
|
||
| import './a.jsx'; | ||
|
|
||
| it('should have worklet-runtime', async () => { | ||
| const source = await fs.readFile( | ||
| path.resolve( | ||
| path.join( | ||
| path.dirname(__filename), | ||
| '.rspeedy', | ||
| 'tasm.json', | ||
| ), | ||
| ), | ||
| 'utf-8', | ||
| ); | ||
| const json = JSON.parse(source); | ||
| expect(json['lepusCode']['lepusChunk']['worklet-runtime'].length > 0) | ||
| .toBe(true); | ||
| }); | ||
| export { a2 } from './a.jsx'; |
6 changes: 2 additions & 4 deletions
6
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/chunk/test.config.cjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| /** @type {import("@lynx-js/test-tools").TConfigCaseConfig} */ | ||
| module.exports = { | ||
| bundlePath: [ | ||
| 'main__main-thread.js', | ||
| 'main__background.js', | ||
| ], | ||
| // This case only asserts encoded output artifacts in worklet-runtime.test.ts. | ||
| bundlePath: [], | ||
| }; |
24 changes: 1 addition & 23 deletions
24
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/not-using/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1 @@ | ||
| /// <reference types="vitest/globals" /> | ||
| // @ts-check | ||
|
|
||
| import fs from 'node:fs/promises'; | ||
| import path from 'node:path'; | ||
|
|
||
| import './a.jsx'; | ||
|
|
||
| it('should not have worklet-runtime', async () => { | ||
| const source = await fs.readFile( | ||
| path.resolve( | ||
| path.join( | ||
| path.dirname(__filename), | ||
| '.rspeedy', | ||
| 'tasm.json', | ||
| ), | ||
| ), | ||
| 'utf-8', | ||
| ); | ||
| const json = JSON.parse(source); | ||
| expect(json['lepusCode']['lepusChunk']['worklet-runtime']) | ||
| .toBe(undefined); | ||
| }); | ||
| export { a2 } from './a.jsx'; |
6 changes: 2 additions & 4 deletions
6
packages/webpack/react-webpack-plugin/test/cases/worklet-runtime/not-using/test.config.cjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| /** @type {import("@lynx-js/test-tools").TConfigCaseConfig} */ | ||
| module.exports = { | ||
| bundlePath: [ | ||
| 'main__main-thread.js', | ||
| 'main__background.js', | ||
| ], | ||
| // This case only asserts encoded output artifacts in worklet-runtime.test.ts. | ||
| bundlePath: [], | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.