Skip to content
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

feat: split big chunks based on modules path similarities #8775

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

JSerFeng
Copy link
Collaborator

Summary

Webpack has an heuristic algorithm that splits big chunks into small ones based on their path similarities. For example, if user's project structure is like:

src
 |-aaa
 |   index_1.js
 |   index_2.js
 |   index_3.js
 |-bbb
 |   index_1.js
 |   index_2.js
 |   index_3.js

let's say there is one chunk that contains all modules in /aaa and /bbb folders, and it's too big, we set maxSize to split it into smaller pieces, webpack will split them based on path similarities, I assume it's based on one assumption: users modify files that are closed to each other, for example you usually make some changes in some specific sub folders, and don't affect other folders, so other chunks should not change.

we can split them by their paths like, 'aaa.js' and bbb.js, or aaa_1.js aaa_2.js bbb_1.js bbb_2.js, instead of random splitting

Checklist

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

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Dec 19, 2024
Copy link

netlify bot commented Dec 19, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 61f2f4f
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67642a87c8e34d0008d420ed

Copy link

codspeed-hq bot commented Dec 19, 2024

CodSpeed Performance Report

Merging #8775 will not alter performance

Comparing JSerFeng:fix/max-size-many-chunks (61f2f4f) with main (22f3bb0)

Summary

✅ 1 untouched benchmarks

@h-a-n-a
Copy link
Collaborator

h-a-n-a commented Dec 19, 2024

Failing CI is resolved in #8776. You may rebase and it will pass.

@LingyuCoder LingyuCoder force-pushed the fix/max-size-many-chunks branch from 34991a8 to 5619829 Compare December 19, 2024 12:53
@LingyuCoder LingyuCoder force-pushed the fix/max-size-many-chunks branch from 5619829 to 61f2f4f Compare December 19, 2024 14:15
@LingyuCoder LingyuCoder merged commit d476fda into web-infra-dev:main Dec 20, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants