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(chunkId): care about Chunk#id_name_hints and generate more stable chunk id #3043

Merged
merged 3 commits into from
May 9, 2023

Conversation

hyf0
Copy link
Collaborator

@hyf0 hyf0 commented May 6, 2023

Related issue (if exists)

Summary

🤖 Generated by Copilot at 0deb1b3

This pull request enhances the StableNamedChunkIdsPlugin module in the rspack_ids crate, which assigns stable and meaningful names and ids to webpack chunks. It uses a concurrent hash map to store and retrieve the chunk name-key mapping, adds support for code splitting chunks, and improves the naming logic for unnamed chunks. It also adds the dashmap and iter_intersperse dependencies to the rspack_ids crate.

Walkthrough

🤖 Generated by Copilot at 0deb1b3

  • Add dashmap crate as a dependency and enable iter_intersperse feature for rspack_ids crate (link, link)
  • Import DashMap type from dashmap crate in stable_named_chunk_ids_plugin module (link)
  • Create reverse mapping from chunk keys to root module identifiers for code splitting chunks in StableNamedChunkIdsPlugin (link)
  • Assign names and ids to chunks based on code splitting dependencies, id_name_hints, and intersperse method in StableNamedChunkIdsPlugin (link)
  • Rename variable unnamed_chunks to chunks_has_no_name and pass it to assign_ascending_chunk_ids function (link)

@hyf0 hyf0 requested a review from h-a-n-a as a code owner May 6, 2023 13:37
@changeset-bot
Copy link

changeset-bot bot commented May 6, 2023

⚠️ No Changeset found

Latest commit: c82a732

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added release: feature team The issue/pr is created by the member of Rspack. labels May 6, 2023
@hyf0 hyf0 marked this pull request as draft May 6, 2023 14:59
@hyf0 hyf0 assigned ahabhgk and unassigned h-a-n-a May 8, 2023
@hyf0 hyf0 force-pushed the hyf_2u39489023894023 branch 2 times, most recently from c82a732 to 03cacc6 Compare May 9, 2023 03:25
@hyf0 hyf0 marked this pull request as ready for review May 9, 2023 03:25
@hyf0 hyf0 requested a review from ahabhgk May 9, 2023 03:26
@hyf0 hyf0 enabled auto-merge May 9, 2023 09:25
@hyf0 hyf0 added this pull request to the merge queue May 9, 2023
Merged via the queue into main with commit c5a1867 May 9, 2023
11 checks passed
@hyf0 hyf0 deleted the hyf_2u39489023894023 branch May 9, 2023 09:53
IWANABETHATGUY pushed a commit that referenced this pull request May 9, 2023
…ble chunk id (#3043)

* feat(chunkId): care about `Chunk#id_name_hints` and generate more stable chunk id

* Fix code

* Fix clippy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants