Skip to content

Migrate to rspress#324

Merged
kdy1 merged 4 commits into
mainfrom
rspress
Jul 10, 2026
Merged

Migrate to rspress#324
kdy1 merged 4 commits into
mainfrom
rspress

Conversation

@kdy1

@kdy1 kdy1 commented Jul 10, 2026

Copy link
Copy Markdown
Member

This reverts commit e7ea679.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
plugins Ready Ready Preview, Comment Jul 10, 2026 10:44am
website Ready Ready Preview, Comment Jul 10, 2026 10:44am

Request Review

@socket-security

socket-security Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​swc/​types@​0.1.271001007387100
Addedreact@​19.2.71001008497100
Addedtypescript@​6.0.3100100909990
Added@​swc/​core@​1.15.439210010095100
Addedreact-dom@​19.2.71001009298100

View full report

## Summary

- restore the pre-migration homepage structure and Nextra-inspired color
palette
- remove Blog entry points from the navigation and homepage while
preserving archive routes
- retain Rspress-generated outline metadata and accessible navigation
labels

## Why

The Rspress migration configured the landing page as `pageType: home`,
which replaced the existing MDX body with Rspress's marketing homepage
treatment. It also restored Blog links that should remain archival only.
This brings the site back in line with the previous SWC design while
keeping the migration's documentation behavior.

## Validation

- `corepack pnpm --filter swc-site build`
- rendered homepage assertions for a single H1, expected sections,
package-manager tabs, and no visible Blog links
- archive output assertions for the existing Blog routes
- generated homepage outline assertions
- `git diff --check`
- `autoreview clean`
@claude

claude Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review: Migrate to rspress

Reviewed the diff (145 files, +4291/-2785) that replaces the Next.js + Nextra 4 docs site with Rspress v2. Overall this is a well-executed migration — the README.md documenting the Nextra → Rspress conversion notes, Twoslash caveats, and theme-alignment decisions is genuinely useful and should save the next person a lot of rediscovery. Component ports (Callout, Benchmark, Customers, TeamMembers, Authors, TypeDeclarations) are clean, drop the Next.js/Tailwind coupling as intended, and pick up small hardening wins along the way (rel="noopener noreferrer" on external links, loading="lazy" on avatar/customer images, consistent use of @rspress/core/runtime's BrowserOnly for the client-only chart). No use of dangerouslySetInnerHTML, eval, or other injection-prone patterns.

A couple of things worth double-checking before merge:

1. pnpm-lock.yaml looks out of sync with apps/website/package.json

In the lockfile diff, the apps/website importer's devDependency entry for @types/react still reads:

"@types/react":
  specifier: 19.0.12
  version: 19.0.12

but apps/website/package.json was changed from "19.0.12" to "^19.0.12" (caret added). Since pnpm validates that the lockfile's specifier matches package.json verbatim, this mismatch will make pnpm install --frozen-lockfile at the repo root reject the lockfile as stale (and a plain pnpm install will silently rewrite it). Worth regenerating the lockfile for this importer before merging, or reverting the caret if it wasn't intentional.

2. Workspace vs. standalone install story is a bit split-brained

apps/website is still matched by the root pnpm-workspace.yaml's apps/* glob and still shows up as an importer in the root pnpm-lock.yaml, but:

  • apps/website/package.json now pins "packageManager": "pnpm@10.33.1", while the root package.json pins pnpm@8.6.3.
  • The new README.md and vercel.json's installCommand both say to install with pnpm install --ignore-workspace.

So there are now two different install paths for this app (root workspace install under pnpm 8 vs. standalone --ignore-workspace install under pnpm 10) that can resolve dependencies differently and drift out of sync over time. If the intent is for apps/website to be fully standalone going forward, it'd be worth removing it from the root workspace glob (or documenting explicitly why it needs to stay); if not, the packageManager pin mismatch should be reconciled.

3. Redirects are duplicated in two places

The legacy-URL redirect list appears twice — once in vercel.json (redirects, server-side) and once in rspress.config.ts via pluginClientRedirects (client-side, for pnpm preview/non-Vercel hosting). Functionally fine, but any future redirect addition/removal has to be kept in sync manually in both files. A short comment in one file pointing at the other (or a shared source of truth) would reduce the chance of drift.

Minor / non-blocking

  • Benchmark.tsx's chart.js callback types (items: any[], item: any, options={... as any}) fall back to any rather than chart.js's typed callback signatures — acceptable for a straight TS port, but leaves a gap in the type-safety win from moving off .jsx.
  • The previously-unused lib/gtag.js (Google Analytics via a Universal Analytics ID, which Google sunset in 2023) is removed with no replacement — looks like intentional dead-code cleanup rather than a regression, since it wasn't wired into the old app/layout.jsx either, but flagging in case analytics were expected to carry over via some other mechanism.
  • No CI workflow in .github/workflows/ actually runs pnpm build for apps/website, so a broken build would currently only surface at Vercel deploy time. Given Rspress v2's built-in dead-link checker (mentioned in the README) is a nice safety net, it'd be worth wiring a build step into CI to catch regressions pre-merge rather than post-deploy.

Test coverage

No automated tests exist for this app before or after the PR (consistent with it being a docs site), so this isn't a regression, but given the scope of the rewrite it'd be reassuring to confirm pnpm build and a manual click-through of the redirect list, playground page, and benchmark chart were run against the built output.

Nice work overall — the scope here (145 files, full framework swap, content reorganization, theme parity) is substantial and the execution is careful.

…322)

## Summary

Polish the Rspress migration while preserving key website behavior and
improving the documentation experience.

## Changes

1. Fix the Playground route by using the correct custom `pageType`.
2. Migrate the current Nextra-based swc.rs design to a custom Rspress
theme, keeping the visual style as close as possible with the
[`rspress-custom-theme`
skill](https://github.com/rstackjs/agent-skills/blob/main/skills/rspress-custom-theme/SKILL.md),
and add a fully redesigned homepage.
3. Enable `llms: true` to generate LLM-friendly site outputs.
4. Replace package-manager installation snippets with
[`PackageManagerTabs`](https://rspress.rs/api/client-api/api-components/package-manager-tabs).
## Summary

- center the homepage while preserving its on-page outline
- hide Blog from the primary navigation without removing blog routes

## Why

Rspress reserves different widths for the hidden left sidebar and
visible right outline, shifting the homepage content left. The homepage
now mirrors the outline rail on desktop so its content stays centered
without affecting documentation pages.

## Validation

- `pnpm --filter swc-site build`
- `pnpm exec prettier --check apps/website/docs/index.mdx
apps/website/docs/_nav.json apps/website/src/styles/index.css`
- generated HTML confirms the outline remains and Blog is absent from
navigation

Repo-wide `turbo run lint test` remains blocked in the untouched plugins
app by `@next/next/no-html-link-for-pages`: `The "path" argument must be
of type string. Received undefined`.
@kdy1 kdy1 merged commit 6951c57 into main Jul 10, 2026
7 checks passed
@kdy1 kdy1 deleted the rspress branch July 10, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants