Skip to content

fix(markdown): serve bundle size report - #1196

Open
lukonik wants to merge 1 commit into
TanStack:mainfrom
lukonik:codex/fix-markdown-bundle-report
Open

fix(markdown): serve bundle size report#1196
lukonik wants to merge 1 commit into
TanStack:mainfrom
lukonik:codex/fix-markdown-bundle-report

Conversation

@lukonik

@lukonik lukonik commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • add a version-aware Markdown bundle report route backed by the existing cached docs fetcher
  • render the generated report with the existing document shell and SEO/cache conventions
  • add route smoke coverage and avoid emitting unavailable Markdown endpoints for pages without a page path

Verification

  • TypeScript checks
  • type-aware lint
  • unit tests: 466 passed, 1 environment-gated smoke test skipped
  • git diff --check

Closes #1195

Summary by CodeRabbit

  • New Features

    • Added a version-specific bundle-size report page to the Markdown documentation library.
    • Added SEO metadata, caching, and library branding to the new report page.
  • Bug Fixes

    • Improved screen-reader link handling so the Markdown download link appears only when a valid page path is available.
  • Tests

    • Added route coverage to verify the new report page loads successfully.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c6d3d87c-8b93-427e-8e41-de1995ea1873

📥 Commits

Reviewing files that changed from the base of the PR and between 50bf8c0 and 871945d.

📒 Files selected for processing (4)
  • src/components/Doc.tsx
  • src/routeTree.gen.ts
  • src/routes/_library/markdown.$version.reports.sizes.tsx
  • tests/docs-route-smoke.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Adds the versioned Markdown bundle-size report route, registers it in the generated TanStack Router tree, renders report metadata and content, guards optional Markdown links, and adds a successful-route smoke test.

Changes

Markdown bundle-size report

Layer / File(s) Summary
Load and render the bundle-size report
src/routes/_library/markdown.$version.reports.sizes.tsx
The new route loads version-specific configuration and reports/sizes.md in parallel. It sets metadata and cache headers, then renders the report with library branding.
Register the versioned report route
src/routeTree.gen.ts
The generated route tree registers /markdown/$version/reports/sizes under the library layout and adds the related route type mappings.
Guard Markdown links and validate routing
src/components/Doc.tsx, tests/docs-route-smoke.test.ts
The screen-reader-only Markdown link renders only when pagePath exists. The smoke test expects /markdown/latest/reports/sizes to return 200.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 87194

This PR adds a versioned Markdown bundle-size report route and safely limits unavailable endpoint links; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Request
  participant LibraryMarkdownVersionReportsSizesRoute
  participant MarkdownBundleSizeReport
  Request->>LibraryMarkdownVersionReportsSizesRoute: request /markdown/latest/reports/sizes
  LibraryMarkdownVersionReportsSizesRoute->>MarkdownBundleSizeReport: provide report content and library metadata
  MarkdownBundleSizeReport-->>Request: render bundle-size report
Loading

Suggested reviewers: tannerlinsley

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: serving the Markdown bundle size report.
Linked Issues check ✅ Passed The PR adds the expected version-aware route /markdown/$version/reports/sizes, renders the bundle size report, and adds smoke coverage for /markdown/latest/reports/sizes. It addresses issue #1195.
Out of Scope Changes check ✅ Passed The changes remain within scope. They implement the report route, update generated route metadata, add smoke coverage, and prevent invalid Markdown links when pagePath is unavailable.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"bundle report" link navigates to 404 on Markdown docs

2 participants