Skip to content

fix: handle weak dynamic imports without async chunks - #13848

Merged
hardfist merged 1 commit into
mainfrom
codex/fix-weak-dynamic-import
Apr 28, 2026
Merged

hardfist merged 1 commit into
mainfrom
codex/fix-weak-dynamic-import

Conversation

@hardfist

Copy link
Copy Markdown
Contributor

Summary

  • preserve webpackMode: "weak" on literal dynamic imports
  • avoid creating async dependency blocks/chunks for weak imports
  • add regression coverage and update weak import stats snapshots

Related links

Closes #13814

Checklist

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

Documentation is not required for this bug fix.

Tested with:

  • pnpm run build:binding:dev
  • pnpm run build:js
  • cd tests/rspack-test && pnpm run test -t "configCases/parsing/import-weak"
  • cd tests/rspack-test && pnpm run test -t "statsOutputCases/import-weak"
  • cd tests/rspack-test && pnpm run test -t "normalCases/chunks/inline-options"

@hardfist
hardfist requested a review from LingyuCoder as a code owner April 27, 2026 09:18
@github-actions github-actions Bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Apr 27, 2026
@github-actions

github-actions Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 09b79c9 to perf(split-chunks): lazily precompute sorted modules for compare (#13854) by harpsealjs

❌ Size increased by 24.13KB from 62.87MB to 62.89MB (⬆️0.04%)

@github-actions

github-actions Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 6 projects in monorepo, 6 projects with changes.

📊 Quick Summary
Project Total Size Change
popular-libs 1.7 MB -
react-10k 5.7 MB -
react-1k 826.1 KB -
rome 1.6 MB -
react-5k 2.7 MB -
ui-components 4.8 MB -
📋 Detailed Reports (Click to expand)

📁 popular-libs

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 1.7 MB - -
📄 JavaScript 1.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-10k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-1k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 826.1 KB - -
📄 JavaScript 826.1 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 rome

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 1.6 MB - -
📄 JavaScript 1.6 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-5k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 ui-components

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 4.8 MB - -
📄 JavaScript 4.7 MB - -
🎨 CSS 106.8 KB - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@codspeed

codspeed Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 34 untouched benchmarks


Comparing codex/fix-weak-dynamic-import (09b79c9) with main (5e44e58)1

Open in CodSpeed

Footnotes

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

@hardfist
hardfist force-pushed the codex/fix-weak-dynamic-import branch 7 times, most recently from 4792fb4 to 490496d Compare April 28, 2026 08:10
@hardfist
hardfist force-pushed the codex/fix-weak-dynamic-import branch from 490496d to 09b79c9 Compare April 28, 2026 08:40
@hardfist
hardfist enabled auto-merge (squash) April 28, 2026 10:31
@hardfist
hardfist merged commit ecc70b3 into main Apr 28, 2026
98 of 113 checks passed
@hardfist
hardfist deleted the codex/fix-weak-dynamic-import branch April 28, 2026 11:25
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.

[Bug]: webpackMode: "weak" emits normal async chunk loader in Rspack

2 participants

⌂ 换网址