clsx is a tiny JavaScript utility for building `className` strings conditionally from strings, arrays, and objects. It discards falsey values and can be used as a faster, smaller drop-in replacement for the `classnames` module, with builds available in ES Module, CommonJS, and UMD formats.
Project status
- Actively maintained: The repo shows recent activity (latest upstream push 2024-06-10) and a patch update in 2024 (v2.1.1 on 2024-04-23), suggesting ongoing maintenance rather than being abandoned.
- Update cadence: Updates are intermittent, with a noticeable gap between major/minor changes in late 2023 (v2.0.1 and v2.1.0 on 2023-12-29) and the next patch in April 2024 (v2.1.1). After that, the provided summaries contain no further tagged updates.
AI summary generated Today
Recent updates
v2.1.1
4/23/2024v2.1.1 is a patch release that updates the TypeScript typings for clsx to accept `bigint` as a valid `ClassValue`. It also adds a `licenses.dev` badge to the README and increments the package version.
Featuresv2.1.0
12/29/2023v2.1.0 introduces a new submodule, `clsx/lite`, intended for string-only class name composition by ignoring non-string arguments. The change also extends the build and package export configuration so the published package exposes separate entrypoints for `clsx` and `clsx/lite`.
Featuresv2.0.1
12/29/2023v2.0.1 is primarily a performance patch, plus routine CI and documentation/benchmark updates. The only functional code change in src appears to be loop optimizations to cache lengths, aligning with the release note performance claim.
v2.0.0
7/16/2023v2.0.0 introduces native ESM support via a new `exports` map and updates TypeScript definitions to better support `node16`/`nodenext` module resolution. The release also adds README documentation for Tailwind CSS integration and expands test coverage for number inputs.
BreakingFeaturesv1.2.1
7/6/2022v1.2.1 updates how the package builds and publishes its CJS and UMD entrypoints. The release notes mention adding a named `clsx` export to CommonJS and UMD, and that CJS/UMD are built manually instead of via the previous tool.
v1.2.0
7/2/2022v1.2.0 introduces a named export for the main `clsx` utility so TypeScript users can write `import { clsx } from 'clsx'`. The release also modernizes the test and CI setup by migrating from `tape` to `uvu` and expanding the Node test matrix.
Featuresv1.1.1
5/30/2020v1.1.1 is a performance-focused patch for `clsx`, with several micro-optimizations around how inputs are converted and concatenated. The release notes emphasize faster execution and slightly smaller bundle size, plus CI/test tooling updates.
v1.1.0
2/3/2020v1.1.0 updates clsx's array detection logic to use Array.isArray instead of checking for a truthy push property. This fixes incorrect handling of objects that define a truthy push key, and the release also notes a resulting browser support change for IE8 and older.
Breakingv1.0.4
4/6/2019v1.0.4 focuses on performance and behavior tweaks inside the core `clsx` value normalization. The release notes highlight ignoring function arguments and optimizing array iteration, plus adding/updating benchmark documentation.
Breakingv1.0.3
2/18/2019v1.0.3 updates the npm package metadata to point bundlers to a different ESM build filename via the package.json "module" field. The only code-diff change is a rename of the "module" entry from the old .mjs file to the new .m.js file.