Skip to content

Trim redundant comments and tests, add a bundle size check - #2

Merged
0xdhrv merged 2 commits into
mainfrom
chore/cleanup-and-ci
Nov 12, 2026
Merged

0xdhrv merged 2 commits into
mainfrom
chore/cleanup-and-ci

Conversation

@0xdhrv

@0xdhrv 0xdhrv commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What changed

Cleanup (chore: trim redundant comments and overlapping tests)

  • Removes comments that restate the code: five in src/core.ts, the // ---- section banners in demos.tsx and cases.ts (the component names and the group field already say it), and two in the bench.
  • Keeps public JSDoc (it ships in the .d.ts and shows on hover for users) and every comment that explains a non-obvious why.
  • Merges three test pairs that checked the same behavior in two halves. The conflict test now also asserts onConflict is called, which it previously passed without checking.

Build (build: add a bundle size check and stop tracking the tool cache)

  • Adds scripts/size.mjs and a Size step in check.yml. It gzips dist/index.js plus the chunks it imports and fails above 3.25 KB. Run locally with pnpm size.
  • Corrects the README size claim from ~2 KB to ~3 KB. The core bundle measures 3,087 B gzipped.
  • Removes site/.impeccable/hook.cache.json from git and ignores .impeccable/. It held local session IDs and absolute paths.
  • Adds npm keywords.

No library behavior changes.

Reviewer notes

  • The size number covers the whole bundle, including formatKeybinding and recordKeybinding. Users who import only microkeys() may ship less after tree-shaking.
  • The limit leaves about 240 B of headroom, so a meaningful addition will trip it on purpose. Raise LIMIT in scripts/size.mjs when that is intended.

Verification

  • pnpm install --frozen-lockfile, vp check, vp test run (94 tests), vp pack and node scripts/size.mjs all pass locally on this branch, rebased on main.

Drop comments that restate the code and merge test pairs that covered the
same behavior.
- Fail CI when the core bundle grows past 3.25 KB gzipped (3,087 B today)
- Correct the README size claim, which said ~2 KB
- Stop tracking the .impeccable tool cache
- Add npm keywords
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://chore-cleanup-and-ci-microkeys.dhrvs.workers.dev (commit edc2774)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9ceebcd8-microkeys.dhrvs.workers.dev edc2774 2026-11-12T11:48:15.842Z Visit the dashboard ↗

@0xdhrv
0xdhrv merged commit aa43172 into main Nov 12, 2026
2 checks passed
@0xdhrv
0xdhrv deleted the chore/cleanup-and-ci branch November 12, 2026 11:52
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