clsx-rails 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da83a9921c3d24cf5c9743bcaf1a11a63bae43f38f7ba197116436f8b2471d5
4
- data.tar.gz: 280c9dfc3fc501ce352d755d620f49ec4e58b8c6de7e976487cd80ccf358e700
3
+ metadata.gz: 62267a91d9e4596cd5a4da9cf8569a0ac6420e6eb4368a099b64ed3a07e7bc18
4
+ data.tar.gz: a0d7c426b1aeea779d70a5a10cc800f9de7c5376cc3fcf5c27ae409c8ee07097
5
5
  SHA512:
6
- metadata.gz: 33c8950cb1a10e94b22fc4a442dba3181dab708f7d1d6abec2bbd0b42aae009832aebcbd1c963c6050fa0ba397f4e4f960743675679d7ad46c507a3b2d9efb52
7
- data.tar.gz: 47bb02df172c9c3d98251234112eaaef97b150d39b49c1e51a1fc5caf6d41c310719af75de32be86a15e7cb3a6062dd67fdbbe90e2c9765d9f3907f51399737f
6
+ metadata.gz: a0f10f1585daeeae9872a3e07faff6e427c453709dce9e2d698f9dca89073068eb0080fcf28c6a2d4d023c2fa68ecaf5810cdcaa12bc0728c868f88cb8c34fda
7
+ data.tar.gz: e3a77cfc660fe7295027d7447394c0b37602ba077ab6ea77c5d19cafdaa90109d1dd69d1128f3f8e504703fd996a3ced922d8185a1a4669656360df647de7e7f
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## v3.0.1 (2026-02-27)
10
+
11
+ ### Changed
12
+ - Require clsx-ruby >= 1.1.3 for correct deduplication behavior
13
+ - Updated benchmark numbers to reflect current performance (2-4x faster)
14
+
9
15
  ## v3.0.0 (2026-02-13)
10
16
 
11
17
  ### Added
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # clsx-rails [![Gem Version](https://img.shields.io/gem/v/clsx-rails)](https://rubygems.org/gems/clsx-rails) [![Codecov](https://img.shields.io/codecov/c/github/svyatov/clsx-rails)](https://app.codecov.io/gh/svyatov/clsx-rails) [![CI](https://github.com/svyatov/clsx-rails/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/svyatov/clsx-rails/actions?query=workflow%3ACI) [![GitHub License](https://img.shields.io/github/license/svyatov/clsx-rails)](LICENSE.txt)
2
2
 
3
- > Rails view helper for constructing CSS class strings conditionally. Powered by [clsx-ruby](https://github.com/svyatov/clsx-ruby).
3
+ > The fastest conditional CSS class builder for Rails 2-4x faster drop-in replacement for `class_names`.
4
+ > Powered by [clsx-ruby](https://github.com/svyatov/clsx-ruby).
4
5
 
5
- Automatically adds `clsx` and `cn` helpers to all Rails views. The fastest alternative to Rails `class_names`.
6
+ Adds `clsx` and `cn` helpers to all views automatically.
6
7
 
7
8
  ## Quick Start
8
9
 
@@ -28,16 +29,16 @@ That's it — `clsx` and `cn` are now available in all your views:
28
29
 
29
30
  ### Faster
30
31
 
31
- **3-8x faster** than Rails `class_names` across every scenario:
32
+ **2-4x faster** than Rails `class_names` across every scenario:
32
33
 
33
34
  | Scenario | clsx | Rails `class_names` | Speedup |
34
35
  |---|---|---|---|
35
- | Single string | 7.6M i/s | 911K i/s | **8.5x** |
36
- | String + hash | 2.4M i/s | 580K i/s | **4.1x** |
37
- | String array | 1.4M i/s | 357K i/s | **4.0x** |
38
- | Multiple strings | 1.5M i/s | 414K i/s | **3.7x** |
39
- | Hash | 2.2M i/s | 670K i/s | **3.3x** |
40
- | Mixed types | 852K i/s | 367K i/s | **2.3x** |
36
+ | String array | 1.2M i/s | 317K i/s | **3.9x** |
37
+ | Multiple strings | 1.3M i/s | 346K i/s | **3.8x** |
38
+ | Single string | 2.3M i/s | 812K i/s | **2.9x** |
39
+ | Mixed types | 901K i/s | 331K i/s | **2.7x** |
40
+ | Hash | 1.7M i/s | 684K i/s | **2.4x** |
41
+ | String + hash | 1.2M i/s | 550K i/s | **2.1x** |
41
42
 
42
43
  <sup>Ruby 4.0.1, Apple M1 Pro. Reproduce: `bundle exec ruby benchmark/run.rb`</sup>
43
44
 
@@ -47,7 +48,7 @@ That's it — `clsx` and `cn` are now available in all your views:
47
48
  |---|---|---|
48
49
  | Conditional classes | yes | yes |
49
50
  | Auto-deduplication | yes | yes |
50
- | 3-8x faster | yes | no |
51
+ | 2-4x faster | yes | no |
51
52
  | Returns `nil` when empty | yes | no (returns `""`) |
52
53
  | Complex hash keys | yes | no |
53
54
  | Short `cn` alias | yes | no |
@@ -196,9 +197,9 @@ Ruby 3.2+ and Rails 7.2+.
196
197
  ## Development
197
198
 
198
199
  ```bash
199
- bin/setup # install dependencies
200
- bundle exec rake test # run tests
201
- bundle exec ruby benchmark/run.rb # run benchmarks
200
+ bin/setup # install dependencies
201
+ bundle exec rake test # run tests
202
+ bundle exec ruby benchmark/run.rb # run benchmarks
202
203
  ```
203
204
 
204
205
  ## Contributing
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Clsx
4
4
  module Rails
5
- VERSION = '3.0.0'
5
+ VERSION = '3.0.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clsx-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Svyatov
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -30,6 +30,9 @@ dependencies:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.1'
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 1.1.3
33
36
  type: :runtime
34
37
  prerelease: false
35
38
  version_requirements: !ruby/object:Gem::Requirement
@@ -37,8 +40,12 @@ dependencies:
37
40
  - - "~>"
38
41
  - !ruby/object:Gem::Version
39
42
  version: '1.1'
40
- description: Adds clsx and cn helpers to all Rails views for constructing CSS class
41
- strings conditionally
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.1.3
46
+ description: Build CSS class strings from conditional expressions, hashes, arrays,
47
+ or nested structures. 2-4x faster drop-in replacement for Rails class_names. Supports
48
+ ViewComponent, Phlex, and Tailwind CSS.
42
49
  email:
43
50
  - leonid@svyatov.com
44
51
  executables: []
@@ -54,7 +61,6 @@ homepage: https://github.com/svyatov/clsx-rails
54
61
  licenses:
55
62
  - MIT
56
63
  metadata:
57
- homepage_uri: https://github.com/svyatov/clsx-rails
58
64
  source_code_uri: https://github.com/svyatov/clsx-rails
59
65
  changelog_uri: https://github.com/svyatov/clsx-rails/blob/main/CHANGELOG.md
60
66
  rubygems_mfa_required: 'true'
@@ -74,5 +80,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
80
  requirements: []
75
81
  rubygems_version: 4.0.6
76
82
  specification_version: 4
77
- summary: Rails view helper integration for clsx-ruby
83
+ summary: The fastest conditional CSS class builder for Rails
78
84
  test_files: []