Skip to content

fix(browser): keep lazyCompilation and hmr enabled#1109

Merged
9aoy merged 2 commits intomainfrom
tree/dev3
Mar 26, 2026
Merged

fix(browser): keep lazyCompilation and hmr enabled#1109
9aoy merged 2 commits intomainfrom
tree/dev3

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Mar 26, 2026

Summary

Background

In browser mode, deeply nested runtime import() chains depend on lazy compilation to avoid eager bundling and startup regressions. Keeping lazy compilation active also requires HMR runtime wiring to remain enabled.

Implementation

  • Keep rspackConfig.mode = 'development' for browser runtime behavior.
  • Set browser hmr to always true in createBrowserRsbuildDevConfig.
  • Always apply createBrowserLazyCompilationConfig(setupFiles) instead of gating it by Rstest watch mode.
  • Update host controller tests to assert that non-watch browser runs also keep HMR enabled.

User Impact

Browser mode preserves lazy loading behavior for deep async imports in both watch and non-watch runs, avoiding non-watch performance regressions.

Checklist

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

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (f1326cf2af) does not have baseline artifacts. Using commit f0de5f85f0 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 12 projects in monorepo, 1 project with changes.

📊 Quick Summary
Project Total Size Change
adapter-rsbuild 2.1 KB 0
adapter-rslib 23.1 KB 0
adapter-rspack 5.9 KB 0
browser 2.0 MB -6.0 B (-0.0%)
browser-react 3.7 KB 0
browser-ui 804.3 KB 0
coverage-istanbul 9.1 KB 0
core/browser 971.6 KB 0
core/loaders 869.0 B 0
core/main 1.5 MB 0
vscode/extension 60.2 MB 0
vscode/worker 14.4 KB 0
📋 Detailed Reports (Click to expand)

📁 browser

Path: packages/browser/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: f0de5f85f0 | PR: #1107

Metric Current Baseline Change
📊 Total Size 2.0 MB 2.0 MB -6.0 B (-0.0%)
📄 JavaScript 2.0 MB 2.0 MB -6.0 B (-0.0%)
🎨 CSS 11.8 KB 11.8 KB 0
🌐 HTML 765.0 B 765.0 B 0
📁 Other Assets 96.0 B 96.0 B 0

📦 Download Diff Report: browser Bundle Diff

Generated by Rsdoctor GitHub Action

@9aoy 9aoy changed the title fix(browser): disable lazyCompilation in non-watch runs fix(browser): keep lazyCompilation and hmr enabled Mar 26, 2026
@9aoy 9aoy merged commit 414823d into main Mar 26, 2026
19 checks passed
@9aoy 9aoy deleted the tree/dev3 branch March 26, 2026 09:03
@9aoy 9aoy mentioned this pull request Mar 26, 2026
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