Repository navigation
feat(site): documentation site and examples gallery - #332
Draft
thejustinwalsh wants to merge 55 commits into
Draft
thejustinwalsh wants to merge 55 commits into
thejustinwalsh wants to merge 55 commits into
Conversation
Imports site/ from feat/glyph-docs-explainers (3d6075d, #138), the newest of the three docs-site branches and a file-level superset of feat/docs-site-bootstrap-ac8db7 and feat/docs-site-modern-api-recovery. Adds the workspace entry and lockfile importer, pins react, three, fiber and vitest to the versions the rest of the workspace already resolves, and keeps the React Compiler lint off the landing page, which is not built with the compiler. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
split() replaces breakApart(), detached glyphs are indexed densely over drawable glyphs, the R3F onError prop is gone, and the caret and editing scenes use hitTest, caret, move, rangeRects and replace, which prepare the text themselves and never return undefined. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…es onto 0.2.0 The errors page states where each failure is thrown now that onError, TextFrameError and per-text error state are gone; the interaction page documents hitTest, caret, move, boundary, rangeRects and replace. Every ts/tsx fence typechecks against the package (138 snippets). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… in the proxy A proxy that loses its lease now keeps the frame it was last given instead of fading to nothing, and its scene stays mounted and paused in its pool slot, so a returning proxy resumes rather than remounts. The pool hands a returning key its warm slot, grows before evicting another key's scene, and recycles the least recently used free slot at the cap. glyph-proxy takes a poster attribute and shows it until the first frame; its poster and canvas live in a shadow tree and nothing is upgraded at import, which removes the hydration mismatch the docs pages raised. A pooled root is put back to its own camera and viewport before it takes another scene; a scene that installed a camera left the next one a zero-sized viewport, which 0.2.0 rejects as a non-positive font size. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ake posters The docs are built under /docs so the composed dist serves as deployed, and the preview serves the landing page, the docs and the examples together. verify:browser drives the built site in a GPU-enabled Chromium and checks one device per page, poster, live, held frame, pool limit and input targeting. capture:thumbnails returns from feat/docs-site-bootstrap-ac8db7 and supplies the two posters the gallery was missing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The root build and check include @pmndrs/glyph-site, CI's check job runs it, and the site's preview, browser verification, poster capture and snippet check are listed workflows. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e root The catalog is split into sections (start, layout, styling, fonts, editing, inspect, scene, motion). A docs page's root names the sections it embeds; the loader fetches those section tables and each scene only when its proxy first takes a lease, and the root's posters attribute gives every proxy its still. Section and scene chunks are named for what they are, and verify:pages drives every proxy on every docs page live, checks that a page fetched only its own sections and scenes on one GPU device, and records what each page transferred. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…and slim the docs pages A pooled root resets its camera and viewport before it takes another scene but no longer unmounts the outgoing scene first: scenes share fonts, and a font whose last user unmounted was disposed before the next scene could retain it. pointerToWorld overwrote its own ray direction, so every pointer mapped to the origin under a perspective camera. A textbox proxy keeps the editing keys from scrolling the page. The pinned @pmndrs/docs is run through a script that keeps compiled page bodies out of client props, which took a page from 9.4 MB to 1.6 MB of HTML at 96 pages. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The old styling, effects and rich-text scenes are removed: their feature rows were no-ops on the ASCII Inter subset and their outline and shadow exceeded the distance field's reach. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e demos Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e and eight live demos Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… and three live demos Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nd migration Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rence Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… collapse Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…in check The landing page was blank with 'baked font asset is invalid': its wordmark face, playwrite-glyph.font.glb, was baked by a September package and lacks the shaping fingerprint, the source fingerprint and the 32-digit raster key the 0.2.0 artifact schema requires. It is rebaked by a new bake:wordmark script, and the chorus is rebaked from sources now checked in beside the landing page, so neither needs the network. A test validates every font the landing page, the docs and the examples ship against the package's artifact validator. verify:browser now loads the landing page and fails on any console error or warning; the page gets a favicon, and the scenes read state.renderer instead of the deprecated state.gl. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…age issues Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Every bake now keeps only the common OpenType layout features, so the Source Serif features face is baked with layoutFeatures smcp, onum and zero, which its scene enables. Every other site font is rebaked by its own script for the kept .notdef outline and legacy kern table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kage's hosts The snippet checker resolves typegpu, pixi.js, @pixi/3d, vue and their plugins to the copies the package is typechecked with, and the partial fences declare what they use. Ignored fences: 11 -> 1 (the Vue Vite config, whose plugin the workspace does not install). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every bake keeps the common OpenType layout features; --layout-features and layoutFeatures add or remove; the shaping floor; GlyphInputError for text that enables a dropped feature; .notdef and legacy kern kept by subsets. Covers the bake, subset, runtime-bake and OpenType-features guides and the CLI, bake, runtime-bake, TextStyle and error references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… TypeGPU page sampler glyphFacts and bitmapFilter on the three.js, TypeGPU and PixiJS 3D configs; glyphIndex and glyphOrigin on material contexts, decorations included; pixelSnapping on TypeGPU and PixiJS 3D text and decorations snapping with their text; the sampler entry of TypeGpuBitmapPageLayout; the decoration baseline lane and glyphFacts system buffer on /core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rigin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… strikes demo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 0.2.0 renderer changes Subset sizes re-measured with the 0.2.0 baker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nnects Sections were registered once, on window load, for the roots present then. The docs are a hydrated app with client-side navigation, so a root reached in-app that named another section threw 'Unknown docs explainer page' from createScene and its proxies never left their posters. A registry now fetches each named section once, when a root connects or is given other names; the root keeps its proxies on their posters until its sections are here. A root reused across pages ends its leases, and a proxy given another scene drops the old scene's frame. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tion React does not execute a script it renders on the client unless it is async, so a reader who arrived on a page with no explainer and navigated to one that has them got no elements at all: no poster, no scene, and a box of the wrong height. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Next prefetches each link it can see, and with the search index in the layout one prefetch is 1.2 MB. Loading a docs page in WebKit fetched 44 to 53 of them, 18 to 23 MB, before the reader did anything; the same pages now fetch two small ones. The sidebar and pager links are told not to prefetch. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ple at its own shape The three scenes on the introduction had no still. The capture script now also takes the scenes a docs page owns, from their proxies on that page, into docs/assets/posters/<set>/. An example's still was 16:9 whatever shape its card or proxy is, so a square or 4:3 box showed a crop of it at another scale than the scene it stands for. Stills are now captured at the entry's aspect, and the four scenes on the pixel camera at the width of a docs column, where their fixed-size text lays out as a reader sees it. The 18 examples that are not 16:9 perspective scenes are recaptured. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…le of its frame A proxy got its poster from the element, so it was an empty dark box until the explainer script had loaded, on a first visit and on every page reached in-app, and stayed one if the script or the scene failed. The explainer stylesheet now carries one background rule per checked-in still, the box is sized from the same stylesheet before the element is upgraded, and the stylesheet has a precedence so a page reached in-app waits for it. A covering proxy shows its frame at full width; its still is laid out the same way, so a still of another shape than the box no longer jumps in scale when the scene starts. A test holds every proxy the docs declare, and every example, to a still on disk. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…isplay The landing frame is bound by pixels, and WebKit shades far fewer of them per frame than Chromium: at a 2x display the page ran at 30 frames a second in a 1440x900 window, 20 at 1920x1200 and 12 at 2560x1440 in Playwright WebKit, against about 80 in Chromium at every size. When two windows of frames in a row run over budget the canvas now takes the density at which the work fits, down to 0.75. WebKit holds 60 at all three sizes; Chromium keeps its full density. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Every browser check ran in Chromium and loaded each route as a new document, so none saw a page arrive by client navigation and none saw the engine Safari is built on. verify:navigation walks the docs in-app in both engines across every kind of page pair: to and from a page with no scenes, within a section, between sections, to roots naming two sections, back and forward, and from a deep link. At each page it holds that every proxy has its still before its element is upgraded, that the first scene goes live and draws, that only the named sections were fetched, that one GPU device is alive, and that nothing was logged. Against the build before these fixes it fails 52 checks in WebKit. verify:browser and verify:pages take the engine from SITE_BROWSERS and run in both by default; verify:browser also holds the idle time to live. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ts scene's ground Two of the introduction's scenes lay themselves out to the frame's width, but their proxies show the frame unscaled, so below the column width they were captured at their stills were larger than the scene. A proxy can now ask for the covering layout of its still with poster-fit='width'. A box showed the docs' own dark blue until its still arrived, and beside a still narrower than it. Each poster set now names the colour its scenes draw on and the generated stylesheet gives the set's boxes that colour. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A root with two logical roots and three proxies in view gave its leases to the two nearest the viewport centre, with no margin. Where two were equally far, a page moving four pixels either way traded the lease every frame: 118 to 120 scene mounts in 120 frames in Chromium and WebKit, each restarting a scene in a box that was holding another moment of it, with 'cannot retain a disposed default Glyph root' thrown throughout. A holder now keeps its lease until another proxy is nearer by a fifth of the viewport. Input to a proxy with no lease gave it one and gave it up once delivered, so the next scroll took it away and the next pointer move took it back. The proxy the reader last acted on keeps its place while it is in view. A proxy records the frames it was given and the scene the last came from, and a slot presents only to the proxy that asked for the scene it holds. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Held to 30 frames a second, as a low power mode holds a page, the governor took every window as over budget and resized the canvas three or four times on its way to the floor, for no gain. When a lowering does not shorten the frames they were never bound by pixels: the density is put back, once, and the governor stops. Uncapped behaviour is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
verify:pages watches every proxy for 90 animation frames after it goes live: one scene, one size, no change of state, no blank or transparent frame, no two pictures taking turns, and no frame for a proxy without a lease. verify:browser puts three proxies in view of a root with two logical roots, moves the page about the tie and a pointer over the proxy without a lease, and counts mounts; the previous build fails it in both engines. It also watches the gallery and the standalone example. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ish arriving Watching all 75 scenes in both engines found no frame from another scene, no blank or transparent frame and no resize. It did find four single samples unlike both neighbours (the marble strike, three times), which is a flash a scene may draw: two pictures taking turns do it on most frames, so three or more in a run is the fault. A proxy that came into view beside the one being watched may still be going live. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…icket A reader on desktop Safari 27 saw the first scene of a page alternate with the second scene's picture. Every proxy of a root is presented from one shared surface that the host renders the next scene into straight after, in one task, and a proxy kept the image transferToImageBitmap gave it as its canvas. Not reproduced: the screen could not be captured, and the iOS 27 simulator has no WebGPU adapter. A proxy now takes the frame by transfer, draws it into its own 2D canvas and closes it, so it owns its pixels. It issues a ticket (proxy, scene, lease) when it takes a lease, the slot carries it from render to delivery, and a frame under any other ticket, or from a surface of another size, is dropped at delivery. examples/public/diagnostics/shared-surface.html presents two colours through one shared WebGPU surface three ways on three schedules and reads both canvases back. Reading the surface with drawImage, which this change first used, gives the second canvas the first colour in WebKit 26.5 when both are drawn in one task. The frame watch passed that build, so it now fails two scenes that end a run showing one picture, and verify:browser watches two scenes live together. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The host rendered every live scene into the one shared surface in a single animation-frame task, each followed by its hand-off to a proxy. What a canvas holds is resolved per task: WebKit 26.5, asked to read a WebGPU canvas twice in one task, answers the second read with the first frame. The first scene is now rendered in the frame's task and each further one in a task of its own, ahead of the next frame. On the diagnostic page every way of presenting is right on that schedule in Chromium and WebKit. Whether this is what Safari 27 needs is not known. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…one task The previous pass made a proxy copy each frame into a 2D canvas and rendered each further live scene of a root in a task of its own, as guesses at a flicker seen in Safari 27 that was not reproduced. It still is not: after the object showcase's own "Run" click, with the physics scene live, held or on its still, every frame reached its own box in Playwright WebKit 627 and Chromium, on this presentation and on the copying one. The click is state inside the scene; the host mounts nothing and moves no lease. The frame is once more the contents of the proxy's bitmaprenderer canvas, and the host steps every live scene in the animation-frame task. Handing over one frame in WebKit costs 0.80-1.04 ms of main thread at 1384x748 by transfer and 1.09-1.80 ms with the copy; 2.15-2.37 ms against 3.28-3.40 ms at 2076x1558. Kept: the ticket checked at delivery and the refusal of a surface of another size than the frame. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…frame The frame watch compared pictures between proxies only at the end of a run. It now counts every frame on which a proxy shows what another scene's proxy shows on that frame or the one before. verify:browser clicks an object in the introduction's showcase, presses the scene's "Run" pill, confirms from the picture that the dense mode was entered, and watches the showcase and the physics scene for 300 frames: own scene on every frame, both live, nothing mounted. Its step that waits for two live scenes on the introduction scrolls both into view itself; it depended on where a click's own scrolling left the page and timed out once in WebKit. The context check expects bitmaprenderer proxies again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…wrong frames /examples/diagnostics/scene-mode.html frames the real introduction, presses the object showcase's "Run" on request and counts the frames on which either box held the other's picture, with a switch to stop reading the canvases: a box that flickers on screen while the counts stay 0 is being composited wrongly, not drawn wrongly. It is for desktop Safari 27, which could not be driven here. Logs the pass and corrects the frames note in the examples README. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…0-alpha.6 The alpha moves useRenderPipeline to @react-three/tsl, publishes the pipeline on the root state only once a scene has asked for one, and no longer takes shadows for a renderer it is handed. The bloom scenes and the post-processing guide import the hook from its new package, the explainer presents through a pipeline that may be absent, and the pooled renderer turns its own shadow map on. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Declares @react-three/tsl, which owns useRenderPipeline from alpha.6, and narrows the flare node for this Three release's node typings. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Dec 2, 2026
Docs report 📚Advisory only — this never blocks merging. Anything left open is tracked in the
✅ attested · After your last source change, update each concept if it is now wrong, then record what you changed and checked:
|
size-limit report 📦
|
Package performance:
|
| statistic | baseline | candidate |
|---|---|---|
| Median workload p50 | 2.380ms | 2.270ms |
| Workloads ≤1 ms | 0 | 0 |
| Workloads ≤2 ms | 2 | 2 |
| Workloads ≤3 ms | 3 | 3 |
| Workloads >3 ms | 2 | 2 |
Largest candidate workloads (including neutral results):
| workload | baseline | candidate | Δ time |
|---|---|---|---|
| relayout after font-size change | 3.98ms | 4.02ms | +0.040ms |
| publish after text change | 3.64ms | 3.54ms | -0.100ms |
| publish after color change | 2.38ms | 2.27ms | -0.110ms |
| measure after text change | 1.95ms | 1.96ms | +0.010ms |
| reflow after width change | 1.20ms | 1.13ms | -0.070ms |
faster ◀ ┊ ▶ slower Δ p50 p baseline candidate
relayout after font-size change ├───┼●─┤ +1.1% .886 ▁█▃▅▁▂▃▂▃▂ ▁█▅▅▂▂▂▃▃▁
measure after text change ├────●──┤ +0.8% .886 ▁▄▅█▄▂▃▄▃▁ ▂██▆▇▄▆▄▁▁
publish after text change ├────────●─┼─────┤ -2.7% .486 ▂▇▆▄█▅▄▄▃▂ ▂▇█▄▆▃▅▃▁▁
publish after color change ├───●──┼────┤ -4.7% .486 ▃█▄▅▃▆▆▂▂▂ ▅██▄▂▁▅▅▃▁
reflow after width change ├─────────●──┤ -5.4% .057 ▁▂█▅▃▂▂▃▅▂ ▃█▆▃▃▂▃▄▂▂
└──────────────┴──────────────┘
-25% 0 +25%All 5 compared benches are neutral.
5 neutral, 1 skipped
| status | bench | baseline | candidate | Δ time | Δ p50 | p | 95% CI |
|---|---|---|---|---|---|---|---|
| neutral | measure after text change | 1.95ms | 1.96ms | +0.010ms | +0.8% | .886 | -7.9..+4.3% |
| neutral | publish after text change | 3.64ms | 3.54ms | -0.100ms | -2.7% | .486 | -19.1..+10.0% |
| neutral | reflow after width change | 1.20ms | 1.13ms | -0.070ms | -5.4% | .057 | -21.4..+0.7% |
| neutral | publish after color change | 2.38ms | 2.27ms | -0.110ms | -4.7% | .486 | -11.6..+8.5% |
| neutral | relayout after font-size change | 3.98ms | 4.02ms | +0.040ms | +1.1% | .886 | -5.9..+5.6% |
| skipped: clock-confounded: neutral→faster · 3.41→3.22 | measure 100 unchanged labels |
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.
The documentation site, the examples gallery and their shared renderer, under
site/. Replaces #138. Bottom of a two-PR stack; #333 (The Living Page as the landing page) sits on top.No milestone: this does not gate 0.2.0. It adds no code to
@pmndrs/glyph.What is here
site/docs): getting started, guides, API pages and 584 code snippets, written against the 0.2.0 API.site/examples): the scenes carried over from feat(site): reconcile documentation and examples #138, running on React Three Fiber 10.0.0-alpha.6.<glyph-proxy>elements backed by one shared WebGPU renderer per page. Each proxy holds a lease; frames reach the page throughtransferToImageBitmapinto abitmaprenderercanvas (no copy). CSS stills show before a scene has a frame.site/landing): still the earlier one on this layer; feat(hero): The Living Page as the landing page #333 replaces it.Verification (at
a68f1431d, merged withmain0ea9451e1)pnpm checkinsite/: typecheck, examples build, 584 snippets type-checked against@pmndrs/glyph, lint, format, 35 test files / 187 tests, docs components, MDX build, landing build. Passed.pnpm buildinsite/: passed.Known issues
/examples/diagnostics/scene-mode.html.verify:browser,verify:navigation,verify:pages) are not part of CI and were not rerun after the merge withmain.@pmndrs/glyph-benchmarksas unattested and one broken local link in a log record.🤖 Generated with Claude Code