Skip to content

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

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

lukonik wants to merge 2 commits 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, with SEO metadata, caching, and library branding.
  • Bug Fixes

    • The screen-reader Markdown download link now appears only when a page path is available.
  • Tests

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

@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 186a79bf-cffe-4903-a280-264cd2827af9
📥 Commits

Reviewing files that changed from the base of the PR and between 871945d and 3fcb049.

📒 Files selected for processing: 2
  • src/routeTree.gen.ts
  • tests/docs-route-smoke.test.ts

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

📝 Walkthrough

Adds a versioned Markdown bundle-size report route, registers it in the generated route tree, renders the report with library metadata, and adds route smoke coverage. The screen-reader-only Markdown link now renders only when pagePath is provided.

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 route loads version-specific configuration and report content in parallel. It sets SEO metadata and cache headers, then renders the report with library metadata.
Register and smoke-test the report route
src/routeTree.gen.ts, tests/docs-route-smoke.test.ts
The generated route tree registers /markdown/$version/reports/sizes under the library route. The smoke test includes /markdown/latest/reports/sizes with an expected successful outcome.
Guard optional Markdown links
src/components/Doc.tsx
The screen-reader-only Markdown link renders only when pagePath is defined.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant Request
  participant SizesRoute
  participant DocContainer
  Request->>SizesRoute: request versioned report path
  SizesRoute->>DocContainer: render report with library metadata
  DocContainer-->>Request: return report document
Loading

Suggested reviewers: tannerlinsley

Merge Risk: ⚪ Minimal · up to 3fcb0

The versioned report route points to the existing bundle-size report, and the smoke test checks for a successful response. No concrete merge-blocking issue was established; the deployed route was not checked.

Pre-merge checks: Passed 4 · Failed 1

Failed 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 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 describes the main change: adding a Markdown bundle-size report route.
Linked Issues check Passed Issue [#1195] requires the Markdown bundle report link to reach /markdown/latest/reports/sizes instead of a 404. The PR registers /markdown/$version/reports/sizes, loads reports/sizes.md for the…
Out of Scope Changes check Passed The changes stay within the stated issue scope. The route implementation and generated route registration provide the missing report endpoint. The smoke test verifies the endpoint. The conditional `Do…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3fcb049

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks for the fix! I merged current main into this branch and regenerated the route tree to resolve the conflict, preserving your implementation.

pnpm test passes. I also checked the local HTTP responses: /markdown/latest/reports/sizes and /markdown/v1/reports/sizes both return 200 and render the bundle-size table. An invalid version redirects to /markdown/latest with 308. The isolated new route module measures 1,439 minified bytes / 734 gzip bytes with imports external, not a full production bundle measurement.

Checks are starting on 3fcb049e545c652651d698cb065c4c1aea3da3b6. I'll wait for those before merging, then check the deployed report before closing #1195.

This branch has not been deployed

No deployments
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