Skip to content

Fix docs SSR retention during the VuePress upgrade - #6814

Merged
mergify[bot] merged 3 commits into
espnet:masterfrom
meryemsakin:fix/docs-upgrade-ssr
Sep 28, 2026
Merged

mergify[bot] merged 3 commits into
espnet:masterfrom
meryemsakin:fix/docs-upgrade-ssr

Conversation

@meryemsakin

@meryemsakin meryemsakin commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What did you change?

Resume the documentation dependency upgrade from #6641: VuePress rc.31,
theme-hope rc.109, and the matching search/config migration.

Apply a small, versioned patch-package patch to @vuepress/client during
installation. It skips onContentUpdated callback registration during SSR.
The patch README links the equivalent upstream fix, vuepress/core#1722, and
explains when to remove the patch. Theme comments record the renamed options.

Regenerate the lockfile with npm 10.9.7 to include the missing nested Markdown
dependencies. Use npm ci in ci/doc.sh so CI rejects an incomplete lockfile
instead of repairing it during the build. No heap increase is included.


Why did you make this change?

Related to #6644. VuePress stores content-update callbacks in a global set and
removes them on unmount. SSR does not run unmount hooks, so theme callbacks that
capture component state can retain previously rendered pages. These callbacks
are for DOM updates and do not need to be registered on the server.

With ESPnet's navigation structure and placeholder page bodies, the unpatched
upgrade exhausts a 4 GiB heap. Skipping SSR registration lets the same 1,715-page
fixture complete. A VuePress release containing the upstream fix should replace
the temporary patch.


Is your PR small enough?

Six files; the changes outside the generated lockfile are below 1,000 lines.
The dependency migration regenerates package-lock.json, making the overall
diff exceed that limit. The lockfile and matching package/config changes need
to stay together; this needs an exception to the size guideline.


Additional Context

This builds on the dependency/config work in #6641 by @sw005320.

Latest local validation on macOS arm64, Node 22.22.0 and npm 10.9.7:

  • Reproduced the reviewer's npm ci failure before regeneration, including
    missing markdown-it, argparse, entities, linkify-it, and uc.micro.
  • npm ci now succeeds and applies the SSR patch. The regenerated lockfile adds
    50 package records without changing any existing package versions.
  • npm audit: 0 vulnerabilities.
  • Repository pre-commit checks pass for the four files updated in this revision;
    bash -n ci/doc.sh and git diff --check also pass.
  • NODE_OPTIONS=--max-old-space-size=4096 npm run docs:build: 1,715 fixture pages
    rendered in 42.86 seconds, with the full VuePress build completing in 45.48 seconds.

The fixture uses ESPnet API page names and its menu generator, but placeholder
bodies. The reviewer separately verified the patch on the actual 1,904-page
corpus in their review.
The full documentation CI build passes on e547048. Search, navigation, and code rendering still need a visual check of the generated output before merging.

Build on the dependency/config migration from espnet#6641. Skip server-side content-update callback registration with a versioned client patch, and document its removal after an upstream release.
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: espnet/espnet/.coderabbit.yaml

Review profile: QUIET

Plan: Advanced

Run ID: 0fc5c2f0-e2bb-4e4c-8c9b-05d9e8d9da4e

📥 Commits

Reviewing files that changed from the base of the PR and between 5c51f9a and e547048.

⛔ Files ignored due to path filters (1)
  • doc/vuepress/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • ci/doc.sh
  • doc/vuepress/package.json
  • doc/vuepress/patches/@vuepress+client+2.0.0-rc.31.patch
  • doc/vuepress/patches/README.md
  • doc/vuepress/src/.vuepress/theme.ts

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


📝 Walkthrough

Walkthrough

The VuePress package updates its framework, bundler, theme, and search dependencies. Installation runs patch-package to apply an SSR guard to onContentUpdated. The theme configuration moves Markdown options and icon assets and changes the search plugin settings. The documentation script now installs dependencies with npm ci.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: sw005320

Merge Risk: ⚪ Minimal · up to e5470

No concrete issue currently prevents merging. Complete the pending documentation build and rendered-site checks as normal validation.

Architecture Summary

Architecture risk: 🔵 Low · up to e5470

The change affects 2 systems.

Changed systems: doc, ci

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — doc (service) was modified; 4 changed files map to changed impact.
  • observed — ci (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in ci/doc.sh: The script replaces npm i with npm ci to install dependencies from the lockfile without updating it.
  • observed — Modified behavior in doc/vuepress/package.json: Adds a postinstall script and patch-package and sass-embedded dev dependencies; upgrades the VuePress bundler, VuePress, and theme versions; and replaces vuepress-plugin-search-pro with @vuepress/plugin-slimsearch.
  • observed — Modified behavior in doc/vuepress/patches/@vuepress+client+2.0.0-rc.31.patch: When __VUEPRESS_SSR__ is true, onContentUpdated now exits before adding the callback or registering its unmount cleanup.
  • observed — Modified behavior in doc/vuepress/patches/README.md: Added README documentation describing the patch’s SSR callback-registration behavior and scope, installation requirements, and VuePress upgrade steps for removing or revising the patch.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Title check ✅ Passed The title clearly identifies the VuePress upgrade and its primary SSR retention fix.
Description check ✅ Passed The description directly explains the dependency upgrade, SSR patch, lockfile regeneration, CI change, validation, and remaining visual checks.
✨ 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.

@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.97%. Comparing base (056e3df) to head (e1ce458).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6814      +/-   ##
==========================================
- Coverage   73.34%   68.97%   -4.37%     
==========================================
  Files         858      850       -8     
  Lines       80259    79603     -656     
==========================================
- Hits        58866    54907    -3959     
- Misses      21393    24696    +3303     
Flag Coverage Δ
test_configuration_espnet2 26.82% <ø> (ø)
test_integration_espnet2 ?
test_integration_espnet3 ?
test_python_espnet2 62.53% <ø> (ø)
test_python_espnet3 19.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sw005320 sw005320 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, this is the fix - I verified it on the real corpus, see my comment on #6644: same generated doc/vuepress/src/ (1904 pages), same 4 GB heap, patch reversed dies at 3983 MB mid-render, patch applied renders in 77.75 s. The mechanism (SSR never unmounts, so contentUpdatedCallbacks retains every page) is also what vuepress/core#1722 describes.

One blocker and two small requests before merging.

Blocker: the lockfile is not in sync with package.json. With Node 22.22 / npm 10.9.7:

npm ci
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync.
npm error Missing: markdown-it@15.0.2 from lock file
npm error Missing: argparse@3.0.2 from lock file
npm error Missing: entities@8.1.0 from lock file
npm error Missing: linkify-it@6.1.0 from lock file
npm error Missing: uc.micro@3.0.0 from lock file
(repeated 10x)

The nested markdown-it@15 trees under @vuepress/plugin-markdown-{chart,hint,image,include,math,preview,stylize,tab}, @vuepress/plugin-icon and vuepress-plugin-md-enhance are missing. npm install regenerates them (+959 lines) and npm audit on the result is still 0 vulnerabilities. CI did not catch this because ci/doc.sh runs npm i, which repairs the lockfile silently, and CodeRabbit ignores package-lock.json. Please run npm install in doc/vuepress, confirm npm ci passes on the result, and commit the regenerated lockfile.

Please link the upstream PR. patches/README.md says the fix is not released upstream; vuepress/core#1722 is the upstream PR with the identical change. Referencing it makes it clear when this patch can be dropped.

Optional: theme.ts is now identical to fix/vuepress-rc31-upgrade minus the comments that explained the four rc.109 renames (plugins.mdEnhance -> markdown, codetabs -> codeTabs, iconAssets -> plugins.icon.assets, searchPro -> plugins.slimsearch, autoSuggestions -> suggestion). I would keep them; nothing else in the repo records why those keys moved.

Also, the doc job skipped on this run because the Documentation label was applied a few seconds after the pull_request event and the label check reads the frozen event payload. A rerun will not help; your next push will.

@github-actions github-actions Bot added the CI Travis, Circle CI, etc label Sep 27, 2026
@meryemsakin

meryemsakin commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @sw005320. Addressed in e547048: regenerated the lockfile, linked vuepress/core#1722, and restored the config migration comments. CI now uses npm ci; a clean install, npm audit (0 vulnerabilities), and the full documentation build all pass. Could you take another look?

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

@meryemsakin, I’ll run a full review of PR #6814, including the lockfile, CI, and documentation updates.

✅ Action performed

Full review finished.

@mergify

mergify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@sw005320 sw005320 added the auto-merge Enable auto-merge label Sep 28, 2026
@sw005320

Copy link
Copy Markdown
Contributor

Thanks, @meryemsakin!

@mergify
mergify Bot merged commit f18b801 into espnet:master Sep 28, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enable auto-merge CI Travis, Circle CI, etc Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants