Repository navigation
Show async module scope in bundle analyzer - #98918
Merged
wbinnssmith merged 2 commits intoOct 2, 2026
Merged
wbinnssmith merged 2 commits into
wbinnssmith merged 2 commits into
Conversation
Contributor
Tests PassedCommit: 5c0e8b0 |
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 22, 2026 22:43
ad47f1f to
5dd4d24
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 24, 2026 17:39
5dd4d24 to
7f6b183
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
4 times, most recently
from
September 25, 2026 19:55
37c5dcf to
5f38e02
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
2 times, most recently
from
September 25, 2026 21:50
81b2912 to
ea38acf
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
2 times, most recently
from
September 28, 2026 16:33
1d704c8 to
da27048
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 28, 2026 19:21
da27048 to
cce7862
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 28, 2026 19:33
cce7862 to
eb166cc
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 28, 2026 21:22
eb166cc to
76542f9
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 28, 2026 22:29
76542f9 to
6fc165c
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 28, 2026 22:42
6fc165c to
6b547c9
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
September 28, 2026 23:19
6b547c9 to
a8b2884
Compare
wbinnssmith
marked this pull request as ready for review
September 29, 2026 00:06
wbinnssmith
commented
Sep 30, 2026
| } | ||
| }, [modulesData, analyzeData]) | ||
|
|
||
| const filterSource = useMemo(() => { |
Member
Author
There was a problem hiding this comment.
this can go with react compiler
| className="flex h-8 cursor-pointer items-center gap-2 whitespace-nowrap px-1" | ||
| title="Show only modules with an initial synchronous path" | ||
| > | ||
| <span className="text-xs">Initial only</span> |
lukesandberg
approved these changes
Sep 30, 2026
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
October 1, 2026 01:06
23ca839 to
0da39f5
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
3 times, most recently
from
October 1, 2026 21:32
6351a7d to
a08b81d
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
October 2, 2026 00:07
a08b81d to
616ae35
Compare
sokra
reviewed
Oct 2, 2026
| export type SourceLoadScope = | ||
| | 'initial' | ||
| | 'async' | ||
| | 'mixed' |
Member
There was a problem hiding this comment.
Initial|Async → "mixed"
That logic doesn't make sense to me. If a module is loaded initially and async, that will cause it to be loaded initially and not async.
So I think it should be Initial|Async → Initial
Member
Author
There was a problem hiding this comment.
The distinction may matter to the user: it might be surprising to turn an import async only to find it's still part of the initial payload. Showing it as mixed would be a cue that something is still retaining it synchronously.
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
October 2, 2026 15:43
1977904 to
d776af5
Compare
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
2 times, most recently
from
October 2, 2026 18:17
616ae35 to
ca4d491
Compare
Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com> Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
wbinnssmith
force-pushed
the
wbinnssmith/bundle-analyzer-async-scopes
branch
from
October 2, 2026 20:44
ca4d491 to
5c0e8b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Show source load scope in the bundle analyzer's single-build view: label async-only and mixed sources in the table, mark them in the treemap with a legend, and add an Initial only filter.
Why?
Help distinguish sources reachable only behind an async import boundary from sources reachable through an initial path (or both). This describes module-graph reachability, not when a browser actually requests a chunk.
How?
Traverse the route's active-entry module graph, propagating initial, async, and traced reachability across dependencies. Combine the reached module scopes for each source, then pass the resulting classification to the table, treemap, and filter. The new filter and indicators apply to the single-build view; the comparison view keeps its existing behavior.
Verification: Bundle-analyzer typecheck, focused lint/format checks, and production build passed; all eight combinations of the scope flags were checked when simplifying the classification logic.