Skip to content

feat(text): prepare the Rust text stack for publishing - #48

Draft
thejustinwalsh wants to merge 25 commits into
feat/rust-wasm-render-planfrom
feat/publishing-fixes
Draft

feat(text): prepare the Rust text stack for publishing#48
thejustinwalsh wants to merge 25 commits into
feat/rust-wasm-render-planfrom
feat/publishing-fixes

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

This publishing-readiness slice sits directly above #47 and turns the Rust text stack into one coherent @pmndrs/text product surface.

  • Moves the font-baker Rust/Wasm implementation, schemas, tests, and build tooling into @pmndrs/text; no separate font-baker package is published.
  • Adds the package-owned text CLI with bake and glyphs commands, direct and project-discovery baking, Unicode-range selection, Bitmap/MSDF/Slug selection, command-specific help, JSON output, and byte-exact --check verification.
  • Performs Unicode subsetting and font inspection in the package-owned Fontations/Skrifa baker Wasm. Product baking has no HarfBuzz executable or platform-binary dependency; HarfBuzz remains an internal test oracle only.
  • Shares one prepare-once pipeline across the CLI, @pmndrs/text/bake, and the browser runtime Worker. One prepared source feeds shaping plus every selected raster baker and produces one validated canonical GLB.
  • Lets one typed load request select multiple techniques from one GLB while fetching, validating, registering, and retaining the font artifact once.
  • Caches only the final validated runtime-baked GLB. Cache identity includes source, face, normalized ranges, raster descriptors, and contract versions; persistent lifetime follows reusable Cache-Control/Expires metadata from the source response, while unavailable or non-cacheable storage remains a transparent miss.
  • Keeps the R3F Vite example direct: one App, one switched world Text, explicit world/UI TextGroup layers, one multi-technique load per asset, and font-stack icon fallback.
  • Reports independently attributable gzip rows for core JavaScript, shaper Wasm, Three adapter JavaScript, optional baker/validator payloads, and fixed Inter and Font Awesome assets. Three.js, React, and R3F remain external peers.
  • Restores release gates for licenses, generated Wasm contracts, optimized package-owned Wasm artifacts, packed-package behavior, and retained CI evidence.

Package surfaces

  • @pmndrs/text
  • @pmndrs/text/bake
  • @pmndrs/text/runtime-bake
  • @pmndrs/text/three
  • @pmndrs/text/r3f
  • package executable: text

The root runtime graph has no static edge to the optional baker Wasm, its std-enabled dependencies, Ajv, or glTF Validator. Shared runtime Rust remains no_std; the optional baker alone owns its Fontations subsetting requirements.

Stack

main#44#45#47#48

Validation

The stack includes focused coverage for:

  • direct CLI baking, Unicode subsetting, glyph inspection, help/version behavior, and byte-exact checks;
  • Node and browser Worker prepare-once, multi-raster composition, transfer, validation, and failure behavior;
  • runtime cache identity, source-derived freshness, corruption, quota/storage failure, and memory-only fallbacks;
  • typed multi-technique loading and R3F API inference;
  • package exports, ESM-only and packed-package execution, license inclusion, and optimized Wasm ABI/export gates;
  • R3F typecheck, lint, format, production build, and live GPU switching across Bitmap, MSDF, and Slug;
  • fail-closed package-size projection and repository documentation validation.

GitHub Actions reports the final full-stack status for the published commit.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
Core JS (gzip) 18.22 KB (+4.6% 🔺)
Shaper Wasm (gzip) 432.95 KB (+0.13% 🔺)
Three.js adapter JS (gzip) 56.77 KB (+3.25% 🔺)
Inter font · Bitmap (gzip) 545.22 KB (0%)
Inter font · MTSDF (gzip) 6.48 MB (0%)
Inter font · Slug (gzip) 603.99 KB (0%)
Font Awesome icons · Bitmap (gzip) 439.5 KB (0%)
Font Awesome icons · MTSDF (gzip) 6.89 MB (0%)
Font Awesome icons · Slug (gzip) 642.59 KB (0%)
Font validator JS (gzip) 134.18 KB (-0.17% 🔽)
Runtime bake host JS (gzip) 5.38 KB (+44.14% 🔺)
Runtime bake Worker JS (gzip) 142.39 KB (+4799.37% 🔺)
Font baker JS (gzip) 2.41 KB (+14.83% 🔺)
Font baker Wasm (gzip) 382.14 KB (+138.13% 🔺)
Bitmap baker JS (gzip) 4.66 KB (0%)
Bitmap baker Wasm (gzip) 229.22 KB (0%)
MTSDF baker JS (gzip) 5.39 KB (0%)
MTSDF baker Wasm (gzip) 209.99 KB (0%)
Slug baker JS (gzip) 4.01 KB (0%)
Slug baker Wasm (gzip) 182.3 KB (0%)

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