Skip to content

Conversation

@CPunisher
Copy link
Contributor

Summary

  1. Remove lazyCompilationMiddleware support in @rspack/browser
  2. Change the format of worker entry from esm to iife to fix the imported rslib runtime errors.
  3. Add basic-react e2e for @rspack/browser

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 15, 2026 08:24
@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Jan 15, 2026
@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit f8d1ef1
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6968af971375f70008b85356

Copy link
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 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 esm to iife in 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/browser with 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 825.4 KB 0
react-5k 2.7 MB 0
rome 984.3 KB 0
ui-components 2.1 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

📦 Binary Size-limit

Comparing f8d1ef1 to chore(lint): bump @rslint/core to 0.2.0 and enable default-param-last rule (#12746) by senze.fan

🙈 Size remains the same at 48.03MB

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 15, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing 01-15-fix/browser (f8d1ef1) with main (cd15818)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@CPunisher CPunisher merged commit 5b35090 into main Jan 19, 2026
208 of 224 checks passed
@CPunisher CPunisher deleted the 01-15-fix/browser branch January 19, 2026 03:27
LingyuCoder pushed a commit that referenced this pull request Jan 19, 2026
* 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
LingyuCoder pushed a commit that referenced this pull request Jan 19, 2026
* 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
@github-actions github-actions bot mentioned this pull request Jan 19, 2026
2 tasks
chenjiahan pushed a commit that referenced this pull request Jan 19, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants