Skip to content

docs: enhance output.asyncChunks documentation and examples#12500

Merged
chenjiahan merged 2 commits intomainfrom
async_chunks_doc_1218
Dec 18, 2025
Merged

docs: enhance output.asyncChunks documentation and examples#12500
chenjiahan merged 2 commits intomainfrom
async_chunks_doc_1218

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan commented Dec 18, 2025

Summary

Expanded the explanation for the output.asyncChunks option, detailing how it controls whether dynamically imported modules are emitted as separate async chunks, and added example.

Checklist

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

Copilot AI review requested due to automatic review settings December 18, 2025 09:25
@chenjiahan chenjiahan requested a review from hardfist as a code owner December 18, 2025 09:25
@github-actions github-actions bot added release: document release: document related release(mr only) team The issue/pr is created by the member of Rspack. labels Dec 18, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 18, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 4036c85
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6943c9ff5b9d2e00081b64b3
😎 Deploy Preview https://deploy-preview-12500--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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 enhances the documentation for the output.asyncChunks configuration option by adding detailed explanations of how it controls async chunk generation for dynamically imported modules, along with a practical configuration example.

  • Expanded the output.asyncChunks documentation with detailed behavior descriptions for both true and false values
  • Added a configuration example showing how to disable async chunks
  • Added cross-references in the code-splitting guide to help users discover this option

Reviewed changes

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

Show a summary per file
File Description
website/docs/en/config/output.mdx Enhanced output.asyncChunks documentation with detailed explanations and code example
website/docs/zh/config/output.mdx Chinese translation of the enhanced output.asyncChunks documentation
website/docs/en/guide/optimization/code-splitting.mdx Added reference to output.asyncChunks option in the dynamic import section
website/docs/zh/guide/optimization/code-splitting.mdx Chinese translation of the added reference to output.asyncChunks option
packages/rspack/src/config/types.ts Updated JSDoc comment for asyncChunks property with detailed behavior descriptions

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

@chenjiahan chenjiahan requested a review from JSerFeng December 18, 2025 09:32
@chenjiahan chenjiahan enabled auto-merge (squash) December 18, 2025 09:32
@github-actions
Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

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

Found 5 project(s) in monorepo.

📊 Quick Summary (Click to expand)
Project Total Size Change
react-10k 5.7 MB ➡️ 0 B (0.0%)
react-1k 823.4 KB ➡️ 0 B (0.0%)
react-5k 2.7 MB ➡️ 0 B (0.0%)
rome 984.3 KB ➡️ 0 B (0.0%)
ui-components 2.1 MB ➡️ 0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: b9a962df2e | PR: #12494

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB 0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: b9a962df2e | PR: #12494

Metric Current Baseline Change
📊 Total Size 823.4 KB 823.4 KB 0 B (0.0%)
📄 JavaScript 823.4 KB 823.4 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: b9a962df2e | PR: #12494

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB 0 B (0.0%)
📄 JavaScript 2.7 MB 2.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: b9a962df2e | PR: #12494

Metric Current Baseline Change
📊 Total Size 984.3 KB 984.3 KB 0 B (0.0%)
📄 JavaScript 984.3 KB 984.3 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: b9a962df2e | PR: #12494

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 4036c85 to fix: compile-time evaluation of optional chaining (#12494) by harpsealjs

🙈 Size remains the same at 48.27MB

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging #12500 will not alter performance

Comparing async_chunks_doc_1218 (4036c85) with main (3a59c3d)1

Summary

✅ 17 untouched

Footnotes

  1. No successful run was found on main (aa88f43) during the generation of this report, so 3a59c3d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: document release: document 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