You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parsed sources collide across assets, and getViewerData mutates input stats #732
Current main (23adc7a) has two independent getViewerData() correctness issues.
Parsed-source lookup is not asset-scoped
Verified with Node 24.18.0 and Webpack 5.105.2:
root asset app.js and child-compilation asset worker.js both used module ID 0;
their parsed sources were 60 and 182 bytes;
the app.js module received the worker source, reporting 182 parsed bytes despite app.js being 116 bytes.
The public test/stats/with-worker-loader fixture also produced two incorrect same-ID source assignments.
getViewerData() currently combines parsed module maps from every asset, keyed only by module ID. IDs reused by separate compilations can therefore overwrite each other.
Analysis mutates the supplied stats
The same reproduction showed that getViewerData():
replaced and grew the root assets array from one item to two;
removed an asset query string in place;
appended the child asset and set isChild;
added parsedSrc to the root module.
Calling it again grew the assets array from two items to three.
Expected behavior
Resolve parsed sources from the current asset’s module map.
Produce chart data without modifying the supplied stats object.
Return stable results when called repeatedly with the same input.
Proposed follow-up PRs
Asset-scoped parsed-source lookup
Retain parsed module maps per asset.
Add regressions for root and child assets that reuse a module ID.
Keep parsed-source lookup and unrelated analyzer changes out of scope.
PR #723 changes module selection immediately above the parsed-source loop. Its optimization is semantically separate, but these follow-ups will likely need a textual rebase.
Activity
valscion commentedon Aug 21, 2026
Yeah #723 was now merged, thanks for pointing to that!
fix: scope parsed module sources by asset (webpack#734)