Skip to content

docs(text): document the public subpaths and answer the external review - #62

Open
thejustinwalsh wants to merge 6 commits into
refactor/three-public-rigorfrom
docs/core-api-surface
Open

docs(text): document the public subpaths and answer the external review#62
thejustinwalsh wants to merge 6 commits into
refactor/three-public-rigorfrom
docs/core-api-surface

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Docs + external-review response (D-249)

Docs: the README Core API section imports from @pmndrs/text/core and @pmndrs/text/tsl instead of naming internal modules; the render-plan section stops claiming the host is unpublished; D-249 records the split; package concepts and OKF digests refresh.

External review response (read-only Codex review, trace retained at .cache/claude-review/20260811-142203-codex-core-cleanup/):

  • The published declarations broke under skipLibCheck: false — the core barrel re-exported the @internal engine-exports bridge and the session constructor leaked its stripped type. The bridge leaves the barrel, sessions construct only through TextEngineHost, and a new dist-declarations check in the package gate keeps emitted declarations strict-consumer clean.
  • The barrel gains the capabilities Three still consumed privately (firstPartyFontBindingBytes, font-selection lease helpers, disposal observation, two frame types), Three imports core/tsl through their barrels only, and the lint tightens to deny deep core/** and tsl/** imports from the integration surfaces.
  • The README walkthrough now typechecks against the real surface: msdf technique imported, singular loadFont result, binding/stack registration shown, patches dispatched by opcode, and the Three technique subpaths described as raster-contract exports.
  • Remaining private Three* slug interfaces finish the Tsl rename; stale comments corrected.
  • Two isolated size entries bundle @pmndrs/text/core and @pmndrs/text/tsl alone, with graph assertions that the renderer-neutral core pulls no three, tsl, or react code, and pinned budgets (core 207,759 raw / 30,853 Brotli; tsl 25,717 / 3,499).

Post-review amendments: the firstParty naming is gone — the integration is just a Three renderer built on the public surface, so the names stop claiming privilege (techniqueWireIds, threeRenderPolicyBytes, loadedFontBindingBytes, plain TRANSFORM_BUFFER_ID/STABLE_GLYPH_BUFFER_ID). The stack's intermediate layers were also repaired to pass the CI static gates standalone (per-layer OKF digests, formatting, and an unused import that had only been fixed at the top); every branch now runs the exact CI static suite green locally.

Full root check green end-to-end.

Stack created with GitHub Stacks CLIGive Feedback 💬

@thejustinwalsh thejustinwalsh changed the title docs/core api surface docs(text): document the public subpaths and answer the external review Aug 11, 2026
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
Core JS (gzip) 18.37 KB (0%)
Shaper Wasm (gzip) 418.76 KB (0%)
Three.js adapter JS (gzip) 57.61 KB (+0.03% 🔺)
Inter font · Bitmap (gzip) 545.26 KB (0%)
Inter font · MTSDF (gzip) 6.48 MB (0%)
Inter font · Slug (gzip) 604.06 KB (0%)
Font Awesome icons · Bitmap (gzip) 439.53 KB (0%)
Font Awesome icons · MTSDF (gzip) 6.89 MB (0%)
Font Awesome icons · Slug (gzip) 642.64 KB (0%)
Font validator JS (gzip) 134.24 KB (0%)
Runtime bake host JS (gzip) 5.38 KB (0%)
Runtime bake Worker JS (gzip) 142.45 KB (0%)
Font baker JS (gzip) 2.41 KB (0%)
Font baker Wasm (gzip) 379.63 KB (0%)
Bitmap baker JS (gzip) 4.66 KB (0%)
Bitmap baker Wasm (gzip) 228.3 KB (0%)
MTSDF baker JS (gzip) 5.39 KB (0%)
MTSDF baker Wasm (gzip) 209.22 KB (0%)
Slug baker JS (gzip) 4.01 KB (0%)
Slug baker Wasm (gzip) 181.24 KB (0%)

@thejustinwalsh
thejustinwalsh force-pushed the docs/core-api-surface branch 2 times, most recently from 47532da to e6d17f3 Compare August 11, 2026 23:33
@thejustinwalsh
thejustinwalsh marked this pull request as ready for review August 12, 2026 00:30
The README Core API section imports from @pmndrs/text/core and
@pmndrs/text/tsl instead of naming internal modules, the render-plan
section stops claiming the host is unpublished, and D-249 records the
surface split with the first-party rigor lint.
Responds to the external review of the subpath split. The published
declarations broke under skipLibCheck: false because the core barrel
re-exported the @internal engine-exports bridge and the session
constructor leaked its stripped type; the bridge leaves the barrel, the
constructor is internal (sessions come from TextEngineHost), and a new
dist-declarations check keeps emitted declarations strict-consumer
clean. The barrel gains the capabilities Three still consumed
privately — firstPartyFontBindingBytes, the font-selection lease
helpers, disposal observation, and the TextEngineFeature/FlowVertex
frame types — and Three now imports core and tsl through their barrels
only, enforced by the tightened per-surface lint. The remaining
Three-prefixed private slug interfaces finish the Tsl rename.
The example now imports the msdf technique, takes the singular loadFont
result, registers the binding and stack that styles reference, dispatches
patches by opcode instead of describing every patch as a byte copy, and
describes the Three technique subpaths as raster-contract exports rather
than side-effect registrars.
Two new measured entries bundle @pmndrs/text/core and @pmndrs/text/tsl
alone, with graph assertions that the renderer-neutral core pulls no
three, tsl, or react integration code and pinned budgets at the
measured sizes.
The integration is just a Three renderer built on the public surface —
nothing about it is privileged, so the names stop claiming otherwise:
techniqueWireIds, threeRenderPolicyBytes, loadedFontBindingBytes, and
the Three policy's TRANSFORM/STABLE_GLYPH buffer ids.
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.

1 participant