Skip to content

fix: serve sidebars from shared assets - #379

Merged
youyongsong merged 3 commits into
mainfrom
feat/sidebar-not-inlined
Nov 14, 2026
Merged

youyongsong merged 3 commits into
mainfrom
feat/sidebar-not-inlined

Conversation

@youyongsong

@youyongsong youyongsong commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Generated documentation pages now load navigation from a shared content-hashed JSON asset instead of embedding the complete sidebar in every HTML file. A small manifest is fetched without caching and points to the immutable payload. Existing documentation repositories need no configuration changes.

The theme preserves the original three-column layout and sidebar controls, expands the active page's ancestors, and keeps breadcrumbs, search and previous/next navigation. Server-rendered document content remains readable with JavaScript disabled. The main script uses a stable URL so a sidebar title change does not rename the script reference in every HTML page.

Measurements use the same acp-docs release-4.5 commit 6bae4f1dc33c4ff038ed71a5ec3536da0276fb0c and identical local site definitions. The baseline is Doom 9322691b52587ef0132486d4be324a946eaa3516; this branch is ae3dba252bebd5b00e10a7789ee2dd37c57fec6b.

Measurement Before After
HTML files 1,102 1,102
HTML bytes, including the 404 page 576,149,973 48,154,574
Median documentation HTML bytes 501,321 21,758
Sidebar bytes embedded across 1,101 documentation pages 528,049,323 0
Complete output: files / bytes 3,775 / 681,406,680 3,777 / 153,662,387
Changed files after one page-title edit 1,112 / 3,778 (29.4336%) 18 / 3,780 (0.4762%)
Bytes in changed files: old build / new build 608,323,101 / 608,338,949 32,816,638 / 32,817,086

The shared sidebar is 194,972 bytes plus a 92-byte manifest. The remaining title-edit changes include six HTML pages, four Markdown/text outputs and eight web assets.

Validation:

  • yarn build, yarn test and yarn docs:build pass; 72 test files and 816 tests pass. yarn lint passes with 0 errors and 3 warnings.
  • yarn typecov passes at 41,930/41,930 (100%); the threshold remains 100%.
  • A browser regression checks three-column geometry, active-item visibility, a single Install section, console errors and successful retrieval of the hashed sidebar. It fails on the prior output and passes on this output.
  • Full-page Chromium screenshots of the home page and a deep upgrade page are byte-identical to the baseline screenshots. Actual clicks verify collapse/expand, search and previous/next navigation; a JavaScript-disabled browser reads the document body.
  • The preview is rebuilt from the clean final commit. Its HTML and CSS match the measured build. One script differs only in enumeration order within generated export configuration arrays, with identical members and identical code outside that configuration.
  • yarn docs:export remains not verifiable on this machine because its isolated HOME lacks the Playwright Chromium executable. The pull request's CI covers PDF export.

This release-4.5 input contains English pages only. Chinese/Russian rendering and version/language switching cannot be verified against this single-language, single-version input.

@changeset-bot

changeset-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ae3dba2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@379.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@379.tgz

commit: ae3dba2

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.45%. Comparing base (9322691) to head (ae3dba2).

Files with missing lines Patch % Lines
packages/doom/src/plugins/global/index.ts 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #379      +/-   ##
==========================================
+ Coverage   69.12%   69.45%   +0.32%     
==========================================
  Files         102      104       +2     
  Lines        3964     4000      +36     
  Branches     1184     1196      +12     
==========================================
+ Hits         2740     2778      +38     
+ Misses        975      973       -2     
  Partials      249      249              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JounQin

JounQin commented Nov 10, 2026

Copy link
Copy Markdown
Member

Better contribute/implement on upstream rspress instead. 😂

@youyongsong
youyongsong merged commit 3129739 into main Nov 14, 2026
16 checks passed
@youyongsong
youyongsong deleted the feat/sidebar-not-inlined branch November 14, 2026 13:23
github-actions Bot pushed a commit that referenced this pull request Nov 14, 2026
* fix: serve sidebars from shared assets

* fix: preserve sidebar layout and active navigation

* test: cover shared sidebar plugin lifecycle
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.

2 participants