Repository navigation
fix(wiki-v2#409,#407,#384): self-hosted fonts, no-store documents, lazy code grammars, request-error UX - #68
Merged
Conversation
… documents, lazy code grammars, request-error UX - docmost#409: Inter (variable) + Roboto 500 are self-hosted via fontsource and served from hashed /assets (immutable, same-origin, font-display swap) instead of a render-blocking fonts.googleapis.com stylesheet; woff/woff2 are never inlined. Every HTML document (/, /index.html, the * fallback, a stale asset URL) now sends the fallback's `no-cache, no-store, must-revalidate`: no-store is the only cross-browser control that keeps an authenticated page out of bfcache after logout. - docmost#407: lowlight starts empty; highlight.js grammars load in one lazy chunk when an editor mounts and a meta-only transaction re-decorates code blocks (LowlightPlugin honours LOWLIGHT_REFRESH_META). The language picker reads a store so it fills in once grammars arrive. Initial JS 721,339 -> 681,334 B br; budget ratcheted to 745,000. - docmost#384: queries get a status-aware error text (rate limit / offline / HTTP status), one deduped rate-limit toast, and one retry only for a short (<=10 s) Retry-After. The api-client 404 branch no longer throws a TypeError on a 404 without a string message. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ntries only Co-Authored-By: Claude Opus 5.5 <[email protected]>
- lowlight.ts: prefetchCodeGrammarsWhenIdle() schedules the lazy grammar load once via requestIdleCallback (3 s timeout), else a 300 ms timer, and swallows a failure (the load logs and un-memoizes it; the editor mount retries). main.tsx (seam docmost#120) calls it after the render call, so a cold page with code starts the fetch after first paint instead of at editor mount (~205 ms of plain code on Fast-4G before). - code-block-view.tsx (seam docmost#186): pre-existing upstream bug. The language picker's disabled and the mermaid source's hidden read editor.isEditable at render time, and a ReactNodeView does not re-render on setEditable(), so after Read -> Edit the picker stayed disabled until the block changed. New fork-owned useEditorEditable() subscribes to the 'update' event that setEditable emits; @tiptap/react's useEditorState listens to 'transaction' only and misses it (pinned in the test). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, not strictly after first paint Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
This is the fork half of the cccvu/wiki-v2 change for issues 409, 407 and 384:
no-store;The super PR carries the console half,
UPSTREAM_MODIFICATIONS.md(docmost#183–docmost#189 plus the updated entries), the ADR 0020 amendment and the e2e changes. Review the pair together in the super PR.What changed
fix(#409,#407,#384)d4b91c4:coloring table cells and formatting text docmost/docmost#409 fonts:
@fontsource-variable/interand@fontsource/roboto(5.3.0, exact pins) are imported once fromfeatures/brand/fonts.ts. The Google Fonts links are removed fromindex.html,theme.tsnow leads with"Inter Variable", andassetsInlineLimitnever inlines woff/woff2.coloring table cells and formatting text docmost/docmost#409 documents: in
authz/http-headers/client-static.ts, every.htmldocument getsDOCUMENT_CACHE_CONTROL(no-cache, no-store, must-revalidate). A spec pins it to the literal in the upstream*fallback;static.module.tsitself is unchanged.fix: improve sidebar page tree syncing docmost/docmost#407:
features/editor-ux/code-highlight/adds:lowlight, plus a memoized lazyimport("./grammars");CodeHighlightLoader, a meta-onlyLOWLIGHT_REFRESH_METArefresh;useCodeLanguages().vite.config.tsadds the grammars tomustStayLazyand ratchets the budget to 745,000.How to publish as a public webpage? docmost/docmost#384:
features/request-errors/addsrequestErrorMessage,createAppQueryClient()(one retry, only for a 429 with Retry-After ≤ 10 s, plus a single deduped toast) andRequestErrorText. It also fixes theapi-client.ts404 TypeError.smoke.sh §5 asserts the document policy.
chore(#409)cdcf81b: the lockfile, written with the pinned pnpm 10.4.0 and containing only the two fontsource entries.fix(#407)9c57629:prefetchCodeGrammarsWhenIdle()is called frommain.tsx.useEditorEditablemakes the code-block picker and the mermaid source followsetEditable. That was a pre-existing upstream bug;useEditorStatecan't seesetEditable, and a test pins that.docs(#407)d3613e8: wording for when the prefetch fires.Upstream-owned files touched:
apps/client/package.json,lowlight-plugin.ts,custom-code-block/index.ts,code-block-view.tsx,recent-changes.tsx,favorites-pages.tsx,created-by-me.tsx(super §183–189)api-client.ts, §11vite.config.ts, §12theme.ts, §13index.html, §59extensions.ts, §120main.tsx, §132favorites-page.tsx, §149pnpm-lock.yaml, §162api-client.test.tsscripts/check-upstream-boundary.shpasses.How this was tested
authz/http-headers: 38/38.tscpasses for the client and the build plugin.vendor-hljs: 48,473 → 7,760 B br.woff2is immutable and same-origin.no-store.Retry-After.Full evidence is in the super PR.
🤖 Generated with Claude Code