Repository navigation
perf(core): trim what contrastRatio pulls in - #227
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Oct 6, 2026
Owner
Author
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
pbroom
force-pushed
the
perf/core-contrast-imports
branch
from
October 8, 2026 02:44
3b66661 to
aa15141
Compare
pbroom
force-pushed
the
perf/core-size-budget
branch
from
October 8, 2026 02:44
9c62afa to
a44bd65
Compare
This was referenced Oct 8, 2026
Owner
Author
pbroom
changed the base branch from
perf/core-size-budget
to
graphite-base/227
October 10, 2026 19:41
pbroom
added a commit
that referenced
this pull request
Oct 10, 2026
Store the 141 distinct CSS Color 4 keywords as one alphabetical, prefix-coded string (a digit for the letters shared with the previous name, then the rest) plus one string of fixed-width rrggbb values, decoded into a Map on first lookup. grey spellings still fold onto gray and transparent is added separately. parse + toHex + contrastRatio: 5336 B -> 5233 B gzip (-103 B) everyday toolkit: 5380 B -> 5281 B gzip (-99 B) Add a test that the packed table decodes to exactly the CSS Color 4 keyword list (checked against colorjs.io). Part of the color-kit assessment stack (#204 → #227). Build, test, lint, typecheck, format, size and check:artifacts pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oklab.ts destructured all four OKLab matrices into row constants at module scope. Bundlers keep top-level destructuring even when nothing reads it, so any bundle that needed only one direction (contrastRatio needs OKLab -> linear sRGB; parse needs only the reverse) carried the other two matrices too. Read the rows inside each kernel instead; the arithmetic is unchanged, so results are bit-identical. Gzip, size-limit (on top of #225 in parentheses): contrastRatio alone: 1310 -> 1096 B (1466 -> 1243 B) parse alone: 4565 -> 4346 B parse + toHex + contrastRatio: 5233 -> 5225 B (5358 -> 5354 B) everyday toolkit: 5281 -> 5275 B (5412 -> 5405 B) packColors + unpackColors: 2317 -> 2277 B Co-Authored-By: Claude Opus 5.5 <[email protected]>
pbroom
force-pushed
the
perf/core-contrast-imports
branch
from
October 10, 2026 19:43
aa15141 to
a7f2bea
Compare
This branch was successfully deployed
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.

oklab.ts destructured all four OKLab matrices into row constants at
module scope. Bundlers keep top-level destructuring even when nothing
reads it, so any bundle that needed only one direction (contrastRatio
needs OKLab -> linear sRGB; parse needs only the reverse) carried the
other two matrices too. Read the rows inside each kernel instead; the
arithmetic is unchanged, so results are bit-identical.
Gzip, size-limit (on top of #225 in parentheses):
contrastRatio alone: 1310 -> 1096 B (1466 -> 1243 B)
parse alone: 4565 -> 4346 B
parse + toHex + contrastRatio: 5233 -> 5225 B (5358 -> 5354 B)
everyday toolkit: 5281 -> 5275 B (5412 -> 5405 B)
packColors + unpackColors: 2317 -> 2277 B
Part of the color-kit assessment stack (#204 → #227). Build, test, lint, typecheck, format, size and check:artifacts pass.
🤖 Generated with Claude Code