Skip to content

perf: serve changelogs from a static client-only shell - #3480

Merged
danielroe merged 3 commits into
perf-package-codefrom
changelog-shell
Nov 26, 2026
Merged

danielroe merged 3 commits into
perf-package-codefrom
changelog-shell

Conversation

@danielroe

Copy link
Copy Markdown
Member

🧭 Context

changelog pages are disallowed in robots.txt, yet crawlers that ignore it still hit them and trigger full SSR responses. rendering /package-changelog/nuxt produces over 2 MB of HTML (with more than half of that duplicated inside the Nuxt payload) and takes over 2s cold.

📚 Description

this PR serves /package-changelog/** and /changelog/:name/** from the prerendered static /_spa.html shell, matching what the code and docs pages do. link preview bots still get a lightweight server-rendered response with title, description and a plain Package.takumi OG card, with no upstream fetches.

Note

#3476 adds s-maxage CDN header rules for /package-changelog/** and /changelog/**. I probably rework it to stack it on this PR instead as this static shell supersedes them.

@danielroe
danielroe added this pull request to stack #3481 November 25, 2026 17:42
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
npmx.dev Ready Ready Preview Nov 26, 2026 1:36am UTC
2 Skipped Deployments
Project Deployment Actions Updated
docs.npmx.dev Ignored Ignored Preview Nov 26, 2026 1:36am UTC
npmx-lunaria Ignored Ignored Nov 26, 2026 1:36am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Changelog pages now show loading placeholders consistently while content is being fetched or has not yet started loading.
    • Improved loading and fallback states when package details or changelog content are unavailable, helping reduce layout shifts during loading.
    • Documentation page hash navigation now responds only when a version has been explicitly requested.
  • New Features
    • Changelog pages now provide package- and version-specific titles and descriptions, and use a package download chart for link previews.

Changelog routes now use client-only shells and client-side data loading. The page uses fetch status for loading states, sets localized SEO metadata and uses a package download-chart Open Graph image. Package documentation hash navigation now requires an explicitly requested version.

Changes: Changelog pages

Layer / File(s) Summary
Client-only route setup
modules/spa-shells.ts, test/unit/modules/spa-shells.spec.ts
Changelog route patterns receive noindex rules. A build hook disables SSR after route generation. Unit tests cover matching paths and server-rendered near-matches.
Client-side loading and rendering
app/composables/npm/useResolvedVersion.ts, app/composables/usePackageChangelog.ts, app/pages/package-changelog/[[org]]/[name].vue, app/components/Changelog/*, test/e2e/changelog.spec.ts, test/e2e/layout-shift.spec.ts
Package and changelog requests support client-side loading. The page and components show skeletons while requests are pending or idle. End-to-end tests cover successful loads, failures, missing packages and layout shift.
Page and link-preview metadata
app/pages/package-changelog/[[org]]/[name].vue, i18n/locales/en.json, i18n/schema.json, test/e2e/changelog.spec.ts, test/e2e/og-image.spec.ts
The page sets localized title and description metadata and uses a package download-chart Open Graph image. Locale definitions and tests cover the metadata.

Package documentation navigation

Layer / File(s) Summary
Version-gated hash navigation
app/pages/package-docs/[...path].vue
Post-render hash navigation now runs only when a version was explicitly requested.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ClientOnlyRoute
  participant PackageChangelogPage
  participant PackageAPI
  participant ChangelogAPI
  Browser->>ClientOnlyRoute: Request changelog URL
  ClientOnlyRoute-->>Browser: Return client-only shell
  Browser->>PackageChangelogPage: Hydrate page
  PackageChangelogPage->>PackageAPI: Resolve version and retrieve package
  PackageAPI-->>PackageChangelogPage: Return package data
  PackageChangelogPage->>ChangelogAPI: Fetch releases or Markdown
  ChangelogAPI-->>PackageChangelogPage: Return changelog data or error
  PackageChangelogPage-->>Browser: Render loading state or changelog result
Loading

Possibly related issues

  • npmx-dev/npmx.dev#2669 — The issue reports Vercel function instances being killed during page loads. This PR changes changelog pages to use client-only shells, but does not claim to fix the reported crash.

Suggested reviewers: 43081j, trueberryless

Merge Risk: Minimal · up to a93a0 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title 'perf: serve changelogs from a static client-only shell' matches the main change. The PR serves /package-changelog/** and /changelog/:name/** from the prerendered /_spa.html shell, which the…
Description check Passed The description states the purpose (crawlers hitting full SSR on changelog pages), the change (serving /package-changelog/** and /changelog/:name/** from the static /_spa.html shell), the retained lin…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title 'perf: serve changelogs from a static client-only shell' matches the main change. The PR serves /package-changelog/** and /changelog/:name/** from the prerendered /_spa.html shell, which the summary and objectives confirm. The title is concise, specific, and follows a conventional commit style.

Full details: Description check

Explanation

The description states the purpose (crawlers hitting full SSR on changelog pages), the change (serving /package-changelog/** and /changelog/:name/** from the static /_spa.html shell), the retained link-preview behaviour, and a related PR (#3476). This matches the changeset, so the description is on topic.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9aba79d and a93a054.

Files selected for processing: 1

  • app/pages/package-docs/[...path].vue

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

@danielroe danielroe changed the title Changelog shell perf: serve changelogs from a static client-only shell Nov 25, 2026
@danielroe
danielroe requested a review from serhalp November 25, 2026 17:42
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the tracking.ignoredKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

On a warm docs cache the HTML typically arrives before the versionless URL redirect occurs,
resulting in a race.
@danielroe
danielroe added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 4a757a4 Nov 26, 2026
27 checks passed
@danielroe
danielroe deleted the changelog-shell branch November 26, 2026 09:53
@github-actions github-actions Bot mentioned this pull request Nov 26, 2026
@serhalp serhalp added the perf npmx.dev app performance label Nov 29, 2026

This branch was successfully deployed

1 active deployment
Preview – npmx.dev — a93a054d Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf npmx.dev app performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants