Skip to content

fix: compilation.*_dependencies iterator ignore added items when sync call#9782

Merged
jerrykingxyz merged 1 commit intomainfrom
jerry/fix
Mar 25, 2025
Merged

fix: compilation.*_dependencies iterator ignore added items when sync call#9782
jerrykingxyz merged 1 commit intomainfrom
jerry/fix

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Mar 24, 2025

Summary

MergeCaller will store the calls to compilation.*_dependencies.add and add them to the rust side in the next microtask. However, if methods such as has and iterator are called before the microtask is executed, these pending items will not be obtained.

compiler.hooks.afterCompile.tap("TEST", compilation => {
	compilation.contextDependencies.add("/a");
	console.log(compilation.contextDependencies.has("/a"))) // ==> false
	console.log([...compilation.contextDependencies].includes("/a")) // ==> false
});

Checklist

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

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Mar 24, 2025
@netlify
Copy link

netlify bot commented Mar 24, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit f947f4f
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67e149b891b72a0008f5905a
😎 Deploy Preview https://deploy-preview-9782--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 24, 2025

CodSpeed Performance Report

Merging #9782 will not alter performance

Comparing jerry/fix (f947f4f) with main (71a1834)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 8 untouched benchmarks

@jerrykingxyz jerrykingxyz merged commit 42c32b7 into main Mar 25, 2025
37 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/fix branch March 25, 2025 06:23
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