Conversation
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
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.
Summary
classigo("btn", { "btn--active": isActive })now supported viaClassObjecttypeclassigo/lite— new strings-only export (137B minified), typed separately so passing an object is a compile errortscoutput withtsc(declarations only) +bun build --minify(JS); v2 goes from 1.04kB → 217B, lite is 137Bperf(core)— invertedtypeofcheck puts the object branch first so the JIT predicts the string path as not-taken; measurable gain on short string workloadsBreaking changes
require("classigo")) is removedClassValuenow includesClassObject— string-only callers can switch toclassigo/liteto keep the narrower typeTest plan
bun run testpassesbun run typecheckpassesbun run buildproducesdist/index.js(217B) anddist/lite.js(137B)bun run benchruns all 9 groups without errordist/index.d.tsanddist/lite.d.tsare present and correct