Skip to content

fix: remove HotUpdateChunk in chunks#7810

Merged
SyMind merged 4 commits intomainfrom
fix-hot-update-chunk
Sep 6, 2024
Merged

fix: remove HotUpdateChunk in chunks#7810
SyMind merged 4 commits intomainfrom
fix-hot-update-chunk

Conversation

@SyMind
Copy link
Copy Markdown
Member

@SyMind SyMind commented Sep 5, 2024

Summary

  1. In webpack, there is no need to add HotUpdateChunk to compilation.chunks, because HotUpdateChunk is no longer used after generating the manifest.

    However, in Rspack, we need to add HotUpdateChunk to compilation.chunk_by_ukey because during the manifest generation, HotUpdateChunk is passed to various plugins via the ukey. The plugins then use the ukey to query compilation.chunk_by_ukey to get the HotUpdateChunk instance.

    Therefore, in Rspack, after the manifest is generated, we need to manually remove the HotUpdateChunk from compilation.chunks.

  2. In webpack, compilation.chunkGraph uses a WeakMap to maintain the relationship between Chunks and Modules.
    This means the lifecycle of these data is tied to the Chunk, and they are garbage-collected when the Chunk is.

    In Rspack, we need to manually clean up the data in compilation.chunk_graph after HotUpdateChunk is used.

Checklist

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

@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 Sep 5, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 5, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 0452435
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66d9a108a3dbac0008049cd9

@SyMind SyMind force-pushed the fix-hot-update-chunk branch from 70bc82f to a5fdca5 Compare September 5, 2024 11:22
@SyMind SyMind merged commit 200d4db into main Sep 6, 2024
@SyMind SyMind deleted the fix-hot-update-chunk branch September 6, 2024 04:28
shulaoda pushed a commit to shulaoda/rspack that referenced this pull request Sep 9, 2024
* fix: remove HotUpdateChunk in chunks
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.

2 participants