webpack icon indicating copy to clipboard operation
webpack copied to clipboard

fix: using chunkGraph from hook context

Open JSerFeng opened this issue 1 year ago • 3 comments

Use chunkGraph from hook context instead of compilation

Summary

🤖 Generated by Copilot at cc6d740

This pull request refactors and improves the runtime module system for webpack. It adds support for new features such as container references, CSS modules, WebAssembly compilation, and chunk prefetching and preloading. It also updates the plugin API to use the new chunkGraph argument and the RuntimeRequirementsContext type. It modifies various plugins and hooks to use the new runtime modules and runtime requirement hooks. It removes some redundant or deprecated code and adds type annotations for better type checking and documentation.

Details

🤖 Generated by Copilot at cc6d740

JSerFeng avatar Nov 02 '23 18:11 JSerFeng

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: JSerFeng / name: Fy (cc6d740b22d001c65bd021b3038753979dd71c3c)

For maintainers only:

  • [ ] This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • [ ] This needs to be backported to webpack 4 (issue will be created when merged)

webpack-bot avatar Nov 02 '23 18:11 webpack-bot

There is a replacement of compilation.chunkGraph in compilation.executeModule, code is here, I assume it's because plugins might use the chunkGraph from compilation, causing some logic can't be applied to the chunkGraph that compilation.executeModule created, so here is a replacement for this.

It's not actually necessary tho, just found that there are many plugins do that not use chunkGraph from hook parameters.

It's fine to ignore this PR ^, If I think it wrong, please let me know

JSerFeng avatar Dec 21 '23 04:12 JSerFeng