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

fix: add return value to subtractRuntime fn #18342

Merged

Conversation

hai-x
Copy link
Contributor

@hai-x hai-x commented Apr 21, 2024

What kind of change does this PR introduce?
fixes subtractRuntime returns undefined when params a is Set<runtime~a, runtime~b,runtime~c> and params b is runtime~a but it is expected to return Set<runtime~b,runtime~c>

Did you add tests for your changes?
No

Does this PR introduce a breaking change?
No

What needs to be documented once your changes are merged?
No

@webpack-bot
Copy link
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)

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case?

@hai-x
Copy link
Contributor Author

hai-x commented Apr 30, 2024

Sorry for delay.

Try adding a test case, but can't find a specific case that can hit this logic (a is SortableSet, b is string).

But I try to use webpack-dev-server to test HotModuleReplacementPlugin locally.

When one chunk that was before in three runtime is removing from two runtimes, removedFromRuntime should be two removed runtime instead of undefined.

image

@alexander-akait
Copy link
Member

@hai-x hm, can you provide manual steps to reproducible it I will think how we can test it, thank you and sorry for delay

@hai-x
Copy link
Contributor Author

hai-x commented May 7, 2024

@hai-x hm, can you provide manual steps to reproducible it I will think how we can test it, thank you and sorry for delay

Reproduction steps:

  1. git clone project https://github.com/hai-x/webpack-pr-18342
  2. pnpm i
  3. pnpm dev
  4. try to make comments in two enry file within 5 seconds because of watchOptions.aggregateTimeout: 5000
/* ./src2/index.js */
// import(/* webpackChunkName: 
// "common-chunk" */ '../common')


/* ./src3/index.js */
// import(/* webpackChunkName: 
// "common-chunk" */ '../common')
  1. rebuild result
image

@alexander-akait alexander-akait merged commit 4baf1c0 into webpack:main May 8, 2024
54 of 56 checks passed
@alexander-akait
Copy link
Member

Thank you

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.

None yet

3 participants