ref(opt): compile out Clay's unused debug-tools UI - #89
Merged
Conversation
commit: |
natemoo-re
marked this pull request as draft
June 6, 2026 16:46
Contributor
natemoo-re
force-pushed
the
ref/clay-debug-tools
branch
from
June 6, 2026 17:12
81528b8 to
d08642c
Compare
This was referenced Jun 6, 2026
natemoo-re
force-pushed
the
ref/clay-debug-tools
branch
2 times, most recently
from
August 27, 2026 09:14
fe8bf96 to
fe0f62d
Compare
|
Size Reduced — -18.8 KB 100.0 KB unpacked |
Clay's debug inspector (Clay__RenderDebugView, ~700 lines + ~150 UI strings) is reachable from the exported Clay_EndLayout behind runtime debugModeEnabled branches, so --gc-sections can't drop it; at -O2 clang inlines it into the layout monolith. clayterm never enables debug mode, so it's dead weight. Adds an upstream-compatible CLAY_DEBUG_MODE_ENABLED value macro (default 1; patches/clay-debug-mode-enabled.patch), named to match the runtime context->debugModeEnabled selector. Generated against the submodule's recorded commit (938967a) and covering all four debugModeEnabled sites; opted out via -DCLAY_DEBUG_MODE_ENABLED=0. The Makefile now applies Clay patches generically: every patches/*.patch is applied (in sorted order) after resetting clay/clay.h to pristine, so the applied set always matches the directory exactly and future patches (e.g. #115's grow-minDimensions fix) need no per-patch Makefile wiring. Reverted by make clean. Drop individual patches as they ship upstream. raw wasm 155,877 -> 101,208 (-35.1%); brotli 44,141 -> 29,133. Cold path only (debugModeEnabled always false at runtime); deno task test test/ passes (19 files, 227 steps).
natemoo-re
force-pushed
the
ref/clay-debug-tools
branch
from
August 27, 2026 10:08
fe0f62d to
0a1e0a8
Compare
natemoo-re
marked this pull request as ready for review
August 27, 2026 10:17
Collaborator
|
🎉 |
natemoo-re
added a commit
that referenced
this pull request
Sep 1, 2026
Cover everything landed since v0.8.0 that affects the published package; resolves to a 0.9.0 minor bump. - #116 border sides reserve layout space (minor, breaking within 0.x) - #103 hardware cursor via text() caret (minor) - #89 compile out Clay debug-tools, ~35% smaller wasm (patch) - #49 correct width for non-printable/surrogate codepoints, Unicode 17 (patch) Dependabot/CI bumps, the 2048 example, and docs-only commits get no changeset.
natemoo-re
added a commit
that referenced
this pull request
Sep 1, 2026
* feat: adopt changesets for versioning and releases Replace the tag-triggered publish workflow with a changesets-driven flow and seed the historical changelog so future releases build on it. - package.json becomes the version source of truth (0.8.0, private); the publishable artifact remains build/npm produced by dnt. - .changeset config uses @changesets/changelog-github against bombshell-dev/tty. - release.yml runs changesets/action on main: it opens a "Version Packages" PR from pending changesets, and on merge runs the publish command (npm run release). - tasks/release.ts wraps the Deno/dnt flow: build:npm, publish build/npm, then tag v<version> and push. It no-ops when the version is already on npm, because changesets/action runs the publish command on every changeset-less push to main. Tags keep the existing v<version> format for continuity with v0.0.0..v0.8.0. - CHANGELOG.md seeds all 14 releases in changelog-github format, with PRs attributed by the tag range their merge commit falls in and authors credited. - deno.json fmt excludes CHANGELOG.md/.changeset so deno fmt does not rewrap changesets output. * build(changeset): upgrade to changesets v3 Bump @changesets/cli ^2.29.7 -> ^3.0.1 and @changesets/changelog-github ^0.5.1 -> ^1.0.0, tracking the transitive @changesets/config@4.0.0 in the config schema URL. v3 stops versioning private packages by default. @bomb.sh/tty is `private: true` (root is a build source; publish happens from build/npm via tasks/release.ts), so opt back in with privatePackages.version. Leave privatePackages.tag off because release.ts owns git tagging. * chore(changeset): backfill changesets for unreleased main changes Cover everything landed since v0.8.0 that affects the published package; resolves to a 0.9.0 minor bump. - #116 border sides reserve layout space (minor, breaking within 0.x) - #103 hardware cursor via text() caret (minor) - #89 compile out Clay debug-tools, ~35% smaller wasm (patch) - #49 correct width for non-printable/surrogate codepoints, Unicode 17 (patch) Dependabot/CI bumps, the 2048 example, and docs-only commits get no changeset. * docs(changeset): retrofit CHANGELOG to Astro conventions Rework the backfilled history to match the changeset message style used for new entries: - Third-person present verbs throughout (Adds/Fixes/Renames), so future changeset-generated entries read consistently against the history. - Reframe entries toward user-visible impact, dropping wire-format and build-mechanism detail that consumers can't act on. - Drop non-user-facing entries (CI, tooling, tests, benchmarks, examples, internal docs); keep LICENSE since it ships in the package. - Hoist the breaking Op->directive/name->id rename to the top of its Patch section (bump stays patch; it already shipped). * build(changeset): refresh deno.lock for changesets v3 * fix(release): tag before publish and backfill missing tags * fix(release): use changesets action v2.1.1 input names * fix(release): disable action GH releases, drop hardcoded pkg name * fix(release): keep publish.yml filename to preserve npm trusted publisher * chore(changeset): tighten backfilled messages to match detail scale Trim to the level of detail each bump warrants: patches to a single sentence, the caret minor to one paragraph. The breaking border change keeps its two paragraphs plus migration diff. * fix(release): parse npm view --json for publish check Rely on structured --json output instead of plain-text stdout when checking whether the version is already on npm.
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.
Clay's built-in debug inspector is gated behind
if (context->debugModeEnabled), but tty doesn't benefit from this code path at all.This PR patches Clay to add a
CLAY_DEBUG_MODE_ENABLEDmacro (defaults to1), which allows us to strip out the unused code. Good candidate for an upstream PR!Makefile has also been updated with a generic patch mechanism, with
patches/*.patchapplied in order against the latest upstream base.Net result size is reduced by 18.8 KB (down to 100.0 KB unpacked)