Skip to content

refactor: bump up all dependencies, rspress to 2.0.8, migrate from deprecated APIs#121

Merged
artus9033 merged 8 commits into
mainfrom
feat/bumps-and-rspress208
Apr 7, 2026
Merged

refactor: bump up all dependencies, rspress to 2.0.8, migrate from deprecated APIs#121
artus9033 merged 8 commits into
mainfrom
feat/bumps-and-rspress208

Conversation

@artus9033

Copy link
Copy Markdown
Collaborator

Summary

This PR:

  • bumps up all deps, including typescript, to latest versions
  • bumps up rspress to 2.0.8
  • fixes problems in tester website (for instance, duplicate social link keys error due to same links)
  • migrates from deprecated rspress APIs
  • drops deprecated imports
  • adjusts biome rules to work on newest version
  • fixes duplicate CSS rule in variables.css

Test plan

CI green, tester working locally.

@artus9033 artus9033 requested a review from satya164 April 7, 2026 16:27
@artus9033 artus9033 self-assigned this Apr 7, 2026
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/rspress-theme/pr-preview/pr-121/

Built to branch gh-pages at 2026-04-07 19:00 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Solid dependency bump PR. The rspress API migrations and biome v2 adjustments look correct. A few issues worth flagging:

1. 🔴 zod v3 → v4: z.record() key/value swap

packages/preset/src/options.ts:55 — The socials schema changed from z.record(z.string().url()) to z.record(z.union([z.url(), z.string()]), z.string()). In zod v4, z.record(keySchema, valueSchema) — so the first arg is the key schema, second is the value schema. Previously socials was Record<string, url> (name → URL). Now it's Record<url | string, string> — the value is just a plain string rather than a validated URL. If the intent was to keep validating URLs as values:

z.record(z.string(), z.url())

2. 🔴 @ts-ignore-next-line is not a valid TypeScript directive

packages/theme/src/plugin/theme.ts:16// @ts-ignore-next-line doesn't exist in TypeScript. Valid directives are @ts-ignore or @ts-expect-error. This still suppresses the error because TS matches on the @ts-ignore substring, but the -next-line suffix is misleading. Should be just @ts-ignore or preferably @ts-expect-error.

3. 🔴 Biome includes semantics may be inverted

biome.jsonc:23 — The old config was "ignore": ["pnpm-lock.yaml"] (exclude lockfile from formatting). The new config "includes": ["**", "pnpm-lock.yaml"] means "include everything + lockfile" — which includes the lockfile in formatting, the opposite of the old behavior. Should this be "includes": ["**", "!!pnpm-lock.yaml"] with the negation pattern (like the files section uses)?

4. 🔴 CSS selector meaning changed

packages/theme/src/styles/nav.css:144 — The indentation removal changes the selector meaning:

/* Before: descendant selector (.rp-nav-screen-menu-item__left INSIDE .rp-link) */
.rp-nav-screen-menu-item.rp-link[target="_blank"]
  .rp-nav-screen-menu-item__left:after {

/* After: compound selector (element matching BOTH classes) */
.rp-nav-screen-menu-item.rp-link[target="_blank"]
.rp-nav-screen-menu-item__left:after {

Was this intentional or a formatting artifact?

5. 🟡 CSS variable commented out instead of removed

packages/theme/src/styles/variables.css:132--rp-c-text-code is commented out rather than deleted. If it's no longer needed, remove it. If temporarily disabled, a comment explaining why would help.

6. 🟡 Major version bumps worth calling out

  • @vercel/analytics v1 → v2 is a peer-facing dependency — consumers may need to update their integration
  • @types/node ^22 → ^25 and TypeScript ^5 → ^6 are very large jumps — worth verifying rspress supports TS 6
  • zod ^3 → ^4 is a major bump

These should probably be mentioned in the changeset since they affect consumers.

7. ✅ Hooks fix looks correct

packages/theme/src/theme/components/announcement/index.tsx — Moving useState above the early return is the right fix (React hooks must not be called conditionally).

8. ✅ export * ordering is fine

packages/theme/src/plugin/theme.ts — The export * moved before named exports, but named exports still take precedence per ES module semantics.

@artus9033 artus9033 merged commit ef07076 into main Apr 7, 2026
6 checks passed
@artus9033 artus9033 deleted the feat/bumps-and-rspress208 branch April 7, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants