Skip to content

feat!: classigo v2 — object syntax, /lite export, minified build#2

Merged
SUP2Ak merged 6 commits into
mainfrom
v2
Apr 25, 2026
Merged

feat!: classigo v2 — object syntax, /lite export, minified build#2
SUP2Ak merged 6 commits into
mainfrom
v2

Conversation

@SUP2Ak
Copy link
Copy Markdown
Owner

@SUP2Ak SUP2Ak commented Apr 25, 2026

Summary

  • Object syntaxclassigo("btn", { "btn--active": isActive }) now supported via ClassObject type
  • classigo/lite — new strings-only export (137B minified), typed separately so passing an object is a compile error
  • Minified build — replaced bare tsc output with tsc (declarations only) + bun build --minify (JS); v2 goes from 1.04kB → 217B, lite is 137B
  • perf(core) — inverted typeof check puts the object branch first so the JIT predicts the string path as not-taken; measurable gain on short string workloads
  • Bench — expanded to 9 groups including design-system (20 dynamic args), css-modules (15-key object), and all lite comparisons; added honest framing (these numbers exist for regression tracking, not as an adoption argument)
  • Docs — full rewrite of README.md and README.fr.md for v2: real benchmark numbers, honest positioning vs clsx, when-to-use-which guidance, migration notes from v1; new CONTRIBUTING.fr.md

Breaking changes

  • ESM only — CommonJS (require("classigo")) is removed
  • ClassValue now includes ClassObject — string-only callers can switch to classigo/lite to keep the narrower type

Test plan

  • bun run test passes
  • bun run typecheck passes
  • bun run build produces dist/index.js (217B) and dist/lite.js (137B)
  • bun run bench runs all 9 groups without error
  • dist/index.d.ts and dist/lite.d.ts are present and correct

SUP2Ak added 6 commits April 25, 2026 13:58
BREAKING CHANGES:
- CJS output removed — ESM only (import classigo from "classigo")
- Object syntax added: classigo({ "btn--active": isActive })
- pnpm replaced by bun
- vite/eslint/vitest removed — tsc + bun test only

New features:
- Object syntax support: { [className]: boolean | null | undefined }
- Mixed strings + objects in a single call
- ClassValue and ClassObject types exported

Architecture:
- src/types.ts — type definitions
- src/index.ts — core logic, fully inlined, no internal helpers
- tsconfig.build.json — separate build config like matchigo
- bench/bench.ts — mitata bench vs clsx and classnames
- tests/runtime.test.ts — 16 tests covering all input types
- CONTRIBUTING.md — commit convention, PR scope, bun-first
- SECURITY.md — private vulnerability reporting via GitHub
- CI updated to bun, publish workflow simplified
@SUP2Ak SUP2Ak merged commit 36bd936 into main Apr 25, 2026
@SUP2Ak SUP2Ak deleted the v2 branch April 25, 2026 15:30
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