bundle-analyzer: record historical snapshots on each analyze run#93520
Draft
wbinnssmith wants to merge 1 commit intocanaryfrom
Draft
bundle-analyzer: record historical snapshots on each analyze run#93520wbinnssmith wants to merge 1 commit intocanaryfrom
wbinnssmith wants to merge 1 commit intocanaryfrom
Conversation
This was referenced May 6, 2026
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
After each successful analyze run (both `next build --analyze` and `next experimental-analyze`), persist a snapshot of the current build's data directory into `history/<id>/` alongside a `history/history.json` index. The analyzer UI can use this index to offer comparison baselines in a future PR. Each snapshot captures git branch/sha/dirty state, Next.js version, and route count. The history is capped at 20 snapshots; older entries are pruned automatically. Also adds `apps/bundle-analyzer/lib/snapshot.ts` with the client-side type mirror that will be consumed by the comparison UI.
07951e1 to
3473946
Compare
Contributor
Tests PassedCommit: 3473946 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

After each
next experimental-analyzerun, snapshot the output data into a rollinghistory/directory so later builds can use it as a comparison baseline.Each snapshot gets a
metadata.jsonwith git branch/sha/dirty status, Next.js version, and route count. Ahistory/history.jsonindex (newest-first, capped at 20 entries) lets the UI list available baselines without re-reading every snapshot directory. Old snapshots beyond the cap are pruned automatically.The client-side
SnapshotMetadatatype mirror lives inapps/bundle-analyzer/lib/snapshot.tsso the compare UI can reference it without a build-time dependency on the Next.js package.