Skip to content

fix: hotUpdate chunk modified with new runtime should have correct runtime#18901

Merged
alexander-akait merged 1 commit intowebpack:mainfrom
JSerFeng:fix/add-runtime
Oct 30, 2024
Merged

fix: hotUpdate chunk modified with new runtime should have correct runtime#18901
alexander-akait merged 1 commit intowebpack:mainfrom
JSerFeng:fix/add-runtime

Conversation

@JSerFeng
Copy link
Copy Markdown
Contributor

@JSerFeng JSerFeng commented Oct 30, 2024

What kind of change does this PR introduce?

Initial compile we have only entry runtime, and we split a module 'lib' into separate chunk, then we modify some of entry module, make it imports a worker, the worker contains the module 'lib' as well.

We have 2 runtime: entry and worker

if one module exist both in entry and worker, and we split it into separate chunk, the chunk has runtime entry and worker, but the HotUpdate chunk only have runtime in the previous compilation, which is entry only, so it cannot render module 'lib', because 'lib' is generated using runtime entry + worker

For the detailed repro, you could check my test case

Did you add tests for your changes?

Yes.

Does this PR introduce a breaking change?

What needs to be documented once your changes are merged?

@webpack-bot
Copy link
Copy Markdown
Contributor

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)

@alexander-akait
Copy link
Copy Markdown
Member

@JSerFeng Is it ready to review/merge?

@JSerFeng JSerFeng marked this pull request as ready for review October 30, 2024 14:13
@JSerFeng
Copy link
Copy Markdown
Contributor Author

Done

@alexander-akait
Copy link
Copy Markdown
Member

Thank you! Good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants