Repository navigation
fix(provide): await asynchronous provided dependencies - #22661
bjohansebas wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: d74d589 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⛔ Files ignored due to path filters (1)
⚙️ Run configuration
⛔ Files ignored due to path filters (1)
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains; the change is ready to merge after normal checks. Pre-merge checks ·
|
Types CoverageCoverage after merging fix/provide-plugin-async-dependencies into main will be
Coverage Report |
|
This PR is packaged and the instant preview is available (d74d589). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@d74d589
yarn add -D webpack@https://pkg.pr.new/webpack@d74d589
pnpm add -D webpack@https://pkg.pr.new/webpack@d74d589 |
Generated code sizeComparing base (
Read 181 asset(s) changed size, test untouched, biggest 20 by raw or gzip change
8 asset(s) changed size, test edited
58 asset(s) this pull request adds, biggest 20 by raw size
No runtime that both runs build changed which runtime modules it carries. 6 runtime(s) this pull request adds or no longer builds
Built |
e9ecd4b to
d74d589
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22661 +/- ##
=======================================
Coverage 96.34% 96.35%
=======================================
Files 774 774
Lines 132985 133022 +37
Branches 44448 44465 +17
=======================================
+ Hits 128125 128170 +45
+ Misses 4860 4852 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alexander-akait
left a comment
There was a problem hiding this comment.
Not sure we really should resolve it in this way, look like AI again generated just a code to patch and resolve the issue, not design or architecture changes, that will be more right here
|
Fixed with more simple version, thanks for raising it and feel free to fix more them |
Summary
ProvidePluginreads asynchronous dependencies before they finish, producingundefinedor throwing on nested properties. Await them using the existing async import machinery, preserve CommonJS exports, and propagate errors through dependents. This reuses the module graph without parsing source again.Targeted size comparison: synchronous ProvidePlugin cases are unchanged; existing async-externals and generator-lowering entry bundles grow by 36 B and 40 B gzip, respectively.
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes:
test/configCases/plugins/provide-plugin-async/covers exports, promise externals, CommonJS, failures, cycles, deferred imports, and generator lowering. All 278 targeted tests pass, including persistent cache; fullyarn lintpasses.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
Codex assisted with reproducing the bug, implementing the fix, adding regression tests, and running validation.
Summary by CodeRabbit
ProvidePluginnow correctly handles asynchronously loaded dependencies, including their exports and errors.