Skip to content

Upgrade Rspress to 2.1.2 - #635

Merged
ruibaby merged 1 commit into
mainfrom
upgrade/rspress-2.1.2
Nov 11, 2026
Merged

ruibaby merged 1 commit into
mainfrom
upgrade/rspress-2.1.2

Conversation

@ruibaby

@ruibaby ruibaby commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

What this does

Bumps @rspress/core from 2.1.0 to 2.1.2.

  • 2.1.1: enables the Shiki notation transformers (transformerNotationHighlight, transformerNotationDiff, etc.) by default and re-exports all @shikijs/transformers helpers from @rspress/core/shiki-transformers. The config already imported transformerNotationDiff explicitly, so it is removed and @shikijs/transformers is dropped from dependencies.
  • 2.1.2: adds "View as Markdown" in the Markdown menu, more built-in theme translations, nested sidebar layout refinements, and search/dropdown accessibility fixes.

Verification

  • pnpm install → @rspress/core 2.1.2; the lockfile still carries @shikijs/transformers 4.5.0 as a transitive dependency, and no source file references it any more.
  • pnpm build passes and exits 0: 255 Markdown outputs, 256 HTML files (including 404) and a 255-entry sitemap, matching main. The generated .md files are byte-identical to a 2.1.1 build; against main (2.1.0) only 5 files / 10 lines differ, all Markdown escaping (\_ → _, \@ → @, trailing spaces →  ).
  • pnpm check:ci (Rslint + Rsfmt) passes.
  • Checked a static build of the branch for the sidebar, code block highlighting, meta-highlight blocks (```yaml {2-3}), search (⌘K) and client-side navigation, which all still work.
  • Independent verification reproduced the results below and confirmed the merge state is CLEAN.

Known issue

Rspress 2.1.2 logs ReferenceError: window is not defined six times while rendering the Markdown export pages (the __ssg_md__ pass). The cause is in useStorageValue: the useSyncExternalStore refactor in web-infra-dev/rspress#3851 calls window.addEventListener inside the subscribe callback without a server guard. The call chain here is ClientApp → useThemeState → useStorageValue.subscribe, i.e. the theme's appearance preference — not the GitHub social link, which uses mode: "link" and never renders the star count.

Measured: 2.1.0 = 0 occurrences, 2.1.1 = 0, 2.1.2 = 6. Adding a typeof window guard to the installed useStorageValue.subscribe drops it to 0 and restoring it brings the 6 back, which confirms the source. It is noisy rather than breaking: the build exits 0, every page is still generated, and only the Markdown export pass is affected. Worth reporting upstream; pinning to 2.1.1 is the fallback if it ever becomes blocking.

pnpm-workspace.yaml keeps a stale minimumReleaseAgeExclude entry for @rspress/core@2.1.0, which is now unused and harmless.

🤖 Generated with OpenBot

- Bump @rspress/core from ^2.1.0 to ^2.1.2.
- Drop the explicit transformerNotationDiff since Rspress 2.1.1
  enables the Shiki notation transformers by default, and remove the
  now-unused @shikijs/transformers dependency.
- Allow the new Rspress versions in minimumReleaseAgeExclude.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
docs e0f2a2f Commit Preview URL

Branch Preview URL
Nov 11 2026, 11:17 AM

@ruibaby
ruibaby merged commit 7f75fb1 into main Nov 11, 2026
2 checks passed
@ruibaby
ruibaby deleted the upgrade/rspress-2.1.2 branch November 11, 2026 15: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.

1 participant