-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix(browser): update worker format and add e2e test #12747
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
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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 updates the @rspack/browser package to fix worker format issues and adds basic end-to-end testing. The changes address runtime errors by switching the worker entry format from esm to iife and properly handling lazy compilation middleware for browser environments.
Changes:
- Changed worker entry format from
esmtoiifein rslib.browser.config.mts to resolve rslib runtime import errors - Added middleware stub for lazy compilation that throws an error since it's not supported in browser environments
- Added basic-react e2e test case for
@rspack/browserwith conditional test directory switching based on WASM environment variable
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/rslib.browser.config.mts | Updated worker format from esm to iife and added middleware replacement plugin |
| packages/rspack/src/browser/middleware.ts | Added stub that throws error for unsupported lazy compilation middleware |
| tests/e2e/playwright.config.ts | Added conditional test directory based on WASM environment variable |
| tests/e2e/tsconfig.json | Added browser-cases to include paths |
| tests/e2e/package.json | Added @rspack/browser as dependency |
| tests/e2e/browser-cases/basic-react/* | New e2e test for @rspack/browser with React app bundling |
| .github/workflows/reusable-build-test.yml | Added separate e2e job for wasm32-wasi-threads target with WASM=1 |
| pnpm-lock.yaml | Updated to include @rspack/browser in e2e tests |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.03MB |
Merging this PR will not alter performance
Comparing Footnotes
|
* fix: remove lazyCompilationMiddleware * chore: change worker entry to iife * chore: add e2e test * chore: fix format * fix: add await for e2e * fix: remove unused imports * chore: fix ci yml * chore: fix ci WASM env injection
* fix: remove lazyCompilationMiddleware * chore: change worker entry to iife * chore: add e2e test * chore: fix format * fix: add await for e2e * fix: remove unused imports * chore: fix ci yml * chore: fix ci WASM env injection
* fix: remove lazyCompilationMiddleware * chore: change worker entry to iife * chore: add e2e test * chore: fix format * fix: add await for e2e * fix: remove unused imports * chore: fix ci yml * chore: fix ci WASM env injection
Summary
lazyCompilationMiddlewaresupport in @rspack/browseresmtoiifeto fix the imported rslib runtime errors.Checklist