Bundle Change Comments
Post bundle size diffs as a structured table in your PR. Use the CUSTOM_TABLE template to show route-level changes, size deltas, and status indicators — so reviewers can catch regressions before merge.
What you’ll build
A sticky comment with a table showing each route’s size and change from the base branch:
| Route | Size | Δ | Status |
|---|---|---|---|
/ | 45.2 KB | +2.1 KB | ⚠️ Watch |
_app | 12.3 KB | -0.5 KB | ✅ Improved |
Workflow example
Compute bundle sizes in your CI, then pass the results to the CUSTOM_TABLE template:
- name: Post Bundle Size Analysis
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
template: CUSTOM_TABLE
sticky-id: bundle-analysis
template-data: |
{
"title": "Bundle Size Analysis",
"headers": ["Route", "Size", "Change", "Status"],
"rows": [
{
"cells": [
{ "markdown": "[/](/)" },
{ "markdown": "45.2 KB" },
{ "markdown": "+2.1 KB ⬆️" },
{ "markdown": "⚠️ Watch" }
]
},
{
"cells": [
{ "markdown": "_app" },
{ "markdown": "12.3 KB" },
{ "markdown": "-0.5 KB ⬇️" },
{ "markdown": "✅ **Improved**" }
]
}
],
"showTimestamp": true
}Dynamic data from CI
Use a script step to compute bundle sizes and write template-data dynamically:
- name: Analyze bundle size
id: bundle
run: |
# Your bundler analysis script here — output JSON to bundle-report.json
node scripts/analyze-bundle.js > bundle-report.json
- name: Post Bundle Size Analysis
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
template: CUSTOM_TABLE
sticky-id: bundle-analysis
template-data: ${{ steps.bundle.outputs.template-data }}Each cell supports full GitHub-Flavored Markdown — links, bold, code, and emoji all render correctly in the PR comment.
Tips
- Use a consistent
sticky-id(e.g.,bundle-analysis) so the comment updates on every push - Add
if: always()if your analysis step can fail but you still want to post partial results - Compare against your base branch in the analysis script to compute meaningful deltas
Next steps
- See all Custom Table template fields
- For ongoing bundle tracking across your codebase (not just per-PR), see Health Reports and the Signals reference
Last updated on