Skip to content

Reduce documentation build memory use - #1439

Open
dahlia wants to merge 3 commits into
fedify-dev:mainfrom
dahlia:bugfix/vitepress-shiki-oom
Open

dahlia wants to merge 3 commits into
fedify-dev:mainfrom
dahlia:bugfix/vitepress-shiki-oom

Conversation

@dahlia

@dahlia dahlia commented Nov 13, 2026

Copy link
Copy Markdown
Member

Fedify's documentation build intermittently runs out of memory. Large Twoslash popups add Vue compiler overhead, so this change carries the popup optimization from shikijs/shiki#1349 as a temporary pnpm patch, following dahlia/optique#1119. It also updates VitePress to 2.0.0-alpha.21 and @shikijs/vitepress-twoslash to 4.6.0. Separate commits cover the VitePress update, the integration update, and the patch with its regression tests.

The patch compiles static popup descendants as HTML strings while preserving popup roots and Floating Vue behavior. Interpolated fences, custom renderers, and unrecognized hook orders retain their original output. The integration is pinned to the exact patched version; the patch can be removed after upgrading to a release containing the upstream fix and verifying the documentation build. Unrelated workspace dependency resolutions are preserved.

Verification includes a --frozen-lockfile install, mise run check, the installed-package regression tests, and mise run docs:build with the existing 3072 MiB heap limit. The optimization regression test fails without the patch. Browser checks of the production tutorial confirm hydration and a working type popup with no console errors. These checks cover the combined dependency updates and patch rather than isolating their memory effects.

Refresh the documentation generator and its transitive dependencies while
preserving unrelated workspace dependency resolutions.

Changelog: none
Assisted-by: Codex:GPT-6
Use the latest integration alongside VitePress's updated Shiki stack.
Pin the integration version so the downstream popup optimization can be
applied separately to a known package build.

Changelog: none
Assisted-by: Codex:GPT-6
Carry the upstream static-popup optimization as an exact-version pnpm
patch to reduce Vue compiler overhead in documentation builds. Preserve
existing output for interpolated fences and unsupported configurations.

Exercise the installed integration through VitePress's highlighter, wire
the regression tests into quality and type checks, and document when to
remove the temporary patch.

shikijs/shiki#1349
dahlia/optique#1119

Changelog: none
Assisted-by: Codex:GPT-6
@dahlia dahlia added this to the Fedify 2.5 milestone Nov 13, 2026
@dahlia dahlia added component/build Build system and packaging dependencies Dependency updates and issues labels Nov 13, 2026
@dahlia dahlia self-assigned this Nov 13, 2026
@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fedify-json-schema ready!

Name Link
🔨 Latest commit 38f6b5f
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6af7241d53834f2021f51baa
😎 Deploy Preview https://deploy-preview-1439--fedify-json-schema.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T14:24:23.867278Z 38f6b5f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change patches Twoslash popup rendering to optionally emit eligible popup contents as static HTML. It pins the patched package, adds regression tests for TypeScript and ts-vue fences, and includes those tests in repository checks.

Changes: Twoslash popup optimization

Layer / File(s) Summary
Add conditional popup optimization
patches/@shikijs__vitepress-twoslash@4.6.0.patch
The patch adds the optimizePopups option, enabled by default. It converts eligible popup children to escaped static HTML in v-html. Eligibility depends on fence type, renderer configuration, and transformer-hook ordering.
Pin and verify the patched renderer
docs/package.json, package.json, docs/.vitepress/twoslash-renderer.test.mts, mise.toml, scripts/check_types.ts, tsconfig.check.json, docs/README.md
The repository pins Twoslash to version 4.6.0 and registers the patch. Tests cover optimized and disabled rendering for ts fences and compare optimized and disabled output for ts-vue fences. The test task is added to check and type-check inputs. The README documents the patch and its removal conditions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: Minimal · up to 38f6b

This change patches documentation build rendering to reduce memory use and adds regression tests. No concrete merge-blocking risk was identified, though the patch and the documentation build were not independently executed here.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Reduce documentation build memory use" matches the main goal of the PR, which addresses intermittent out-of-memory failures in Fedify's docs build. The changeset implements this through a T…
Description check Passed The description explains the reason for the change (intermittent out-of-memory failures in the docs build) and the approach (a temporary pnpm patch for the Twoslash popup optimization, plus VitePress …
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 "Reduce documentation build memory use" matches the main goal of the PR, which addresses intermittent out-of-memory failures in Fedify's docs build. The changeset implements this through a Twoslash popup optimization patch and VitePress/integration version updates. The title is short, specific, and does not describe unrelated work. It does not name the mechanism, but the summary does not need to cover every detail.

Full details: Description check

Explanation

The description explains the reason for the change (intermittent out-of-memory failures in the docs build) and the approach (a temporary pnpm patch for the Twoslash popup optimization, plus VitePress and integration updates). It also covers the exact-version pin, removal conditions, and verification steps. This matches the changeset files, including the patch, package.json, the regression test, and the README section.

Finishing Touches

Generate unit tests (beta)

  • 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1310b090-6b6a-4e89-b267-24f291a24498
Commits

Reviewing files that changed from the base of the PR and between 624c7e0 and 38f6b5f.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 8

  • docs/.vitepress/twoslash-renderer.test.mts
  • docs/README.md
  • docs/package.json
  • mise.toml
  • package.json
  • patches/@shikijs__vitepress-twoslash@4.6.0.patch
  • scripts/check_types.ts
  • tsconfig.check.json

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

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
12210 1 12209 81
View the full list of 1 ❄️ flaky test(s)
./packages/postgres/src/kv.index.test.ts::PostgresKvStore provisions a fresh expiry index and accepts both spellings

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.088s run time
AssertionError: Expected values to be strictly equal:

2 !== 1

      assert.equal((await indexes(sql, tableName)).length, 1);
             ^
    at NodeTestContext.<anonymous> (file:.../postgres/src/kv.index.test.ts:132:14)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/build Build system and packaging dependencies Dependency updates and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant