Skip to content

Add tracking of frontend bundle size stats to CI#13078

Merged
lukasmasuch merged 2 commits intodevelopfrom
add-bundle-size-tracking
Nov 21, 2025
Merged

Add tracking of frontend bundle size stats to CI#13078
lukasmasuch merged 2 commits intodevelopfrom
add-bundle-size-tracking

Conversation

@lukasmasuch
Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch commented Nov 20, 2025

Describe your changes

Adds an optional bundle analysis to our vite config. Runs the analysis and uploads the html and raw data to our CI artefacts. As a follow up task, we will also add a dashboard to https://issues.streamlit.app to track the changes in bundle size + PR comments to warn from significant changes similar to how its done with the wheel size.


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@lukasmasuch lukasmasuch requested a review from Copilot November 20, 2025 20:39
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Nov 20, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@lukasmasuch lukasmasuch added security-assessment-completed change:other PR contains other type of change impact:internal PR changes only affect internal code labels Nov 20, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 20, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13078/streamlit-1.51.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13078.streamlit.app (☁️ Deploy here if not accessible)

@lukasmasuch lukasmasuch marked this pull request as ready for review November 20, 2025 20:41
@lukasmasuch lukasmasuch requested a review from a team as a code owner November 20, 2025 20:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automated tracking of frontend bundle size statistics to the CI pipeline. The implementation uses the vite-bundle-analyzer plugin to generate both JSON and HTML reports of the bundle composition during the build process.

  • Adds vite-bundle-analyzer dependency to analyze bundle composition
  • Configures bundle analysis to generate JSON and HTML output files
  • Implements a new CI workflow job to build the frontend with analysis enabled and upload artifacts

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
frontend/app/package.json Adds vite-bundle-analyzer@^1.2.3 as a dev dependency
frontend/yarn.lock Lock file update for the new vite-bundle-analyzer package
frontend/app/vite.config.ts Configures bundle analyzer plugin conditionally via ANALYZE_BUNDLE env var, generates JSON and HTML reports, enables sourcemaps when analyzing
.github/workflows/pr-preview.yml Adds new analyze-frontend-bundle job that builds frontend with analysis enabled and uploads resulting artifacts

Copy link
Copy Markdown
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for this!

@lukasmasuch lukasmasuch merged commit 2207d78 into develop Nov 21, 2025
40 checks passed
@lukasmasuch lukasmasuch deleted the add-bundle-size-tracking branch November 21, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:other PR contains other type of change impact:internal PR changes only affect internal code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants