tailwind_merge 1.5.2 → 1.5.3

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: aadbe94d7d509ee795a2b34277fa7195f443d83081d2adaf88a11c07d2918302
4
- data.tar.gz: a6b99aea1b699341b88d7052f7e7c6b588326d74decca79a3c0caaf256042107
3
+ metadata.gz: '059b8e52b3a7bc182e6cae5db2a2c8dee46aa1d1176b6b7d26dd7f2313f566cc'
4
+ data.tar.gz: c94346250084798c59da34357f9e16acc058943eb5e64f759f87b06701adac7c
5
5
  SHA512:
6
- metadata.gz: bfadf225da1834890e98ee7b89202db8714b954c8cc077ad33eabdc1731f5617c85747aa1cd8641d659ea45b95f61b8ea9e0c00d1b852d3cc4b99ae4210850f4
7
- data.tar.gz: c5b300134da62796aaa0697e7ad341bd223139cb07a5b51a556de469692271c2750ad52d1c1ec032968dcc50f295c4e68d5c7ef502c81452ab0b4ec23baf214d
6
+ metadata.gz: 61dc28329c357f7b1bb060b499c56d6d419672f2ccade9a3cb8442ae1c77da2f3c9c9526894c836294ef6128a78041adbd1b0c291b9c6b7fa33ef34b527400f1
7
+ data.tar.gz: 76ea9d360488b4945ce4b2a3ac642fdd20a0cd0eee20b85a3baec2f363ce3dcddbbd3dc9a6be2f7207d30a5776aeff328df792b742770e5b2d1c63867a076eac
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.5.3](https://github.com/gjtorikian/tailwind_merge/compare/v1.5.2...v1.5.3) (2026-08-11)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **config:** classify shadow-inner into the shadow class group ([99bccc2](https://github.com/gjtorikian/tailwind_merge/commit/99bccc2b66d5a6e94735515676102534a3f29e37))
6
+
7
+ ### Performance Improvements
8
+
9
+ * **parse:** skip modifiers array alloc for no-modifier classes ([0ee620e](https://github.com/gjtorikian/tailwind_merge/commit/0ee620e7e464074fb490fd363afaa5b404a4faf4))
10
+
11
+ ### Miscellaneous Chores
12
+
13
+ * trigger release-please run ([65e80ae](https://github.com/gjtorikian/tailwind_merge/commit/65e80ae41d08e813c0d6ce9317aa235454bfc935))
14
+ * **config:** deep-freeze DEFAULTS to prevent global-state mutation ([9bf4778](https://github.com/gjtorikian/tailwind_merge/commit/9bf47789b778b4d1e0503e9b69ce30d407826483))
15
+
16
+
1
17
  # [v1.5.2] - 06-07-2026
2
18
  ## What's Changed
3
19
  * fix: thread-safety of Merger's internal LRU cache by @svyatov in https://github.com/gjtorikian/tailwind_merge/pull/79
@@ -6,6 +6,19 @@ module TailwindMerge
6
6
  module Config
7
7
  include Validators
8
8
 
9
+ class << self
10
+ # Recursively freezes nested Hash/Array structures so shared config
11
+ # constants can't be mutated in place. Keys are strings/symbols and are
12
+ # already immutable, so only values need walking.
13
+ private def deep_freeze(object)
14
+ case object
15
+ when Hash then object.each_value { |value| deep_freeze(value) }
16
+ when Array then object.each { |value| deep_freeze(value) }
17
+ end
18
+ object.freeze
19
+ end
20
+ end
21
+
9
22
  THEME_KEYS = [
10
23
  "color",
11
24
  "font",
@@ -1432,6 +1445,8 @@ module TailwindMerge
1432
1445
  "shadow" => [
1433
1446
  # Deprecated since Tailwind CSS v4.0.0
1434
1447
  "",
1448
+ # Deprecated since Tailwind CSS v4.0.0
1449
+ "inner",
1435
1450
  "none",
1436
1451
  THEME_SHADOW,
1437
1452
  IS_ARBITRARY_VARIABLE_SHADOW,
@@ -2441,7 +2456,8 @@ module TailwindMerge
2441
2456
  "placeholder",
2442
2457
  "selection",
2443
2458
  ],
2444
- }.freeze
2459
+ }
2460
+ deep_freeze(DEFAULTS)
2445
2461
 
2446
2462
  def merge_config(incoming_config)
2447
2463
  extended_config = TailwindMerge::Config::DEFAULTS.dup
@@ -6,6 +6,7 @@ module TailwindMerge
6
6
 
7
7
  module ParseClassName
8
8
  IMPORTANT_MODIFIER = "!"
9
+ EMPTY_MODIFIERS = [].freeze
9
10
  MODIFIER_SEPARATOR = ":"
10
11
  MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length
11
12
 
@@ -29,7 +30,7 @@ module TailwindMerge
29
30
  else
30
31
  return TailwindClass.new(
31
32
  is_external: true,
32
- modifiers: [],
33
+ modifiers: EMPTY_MODIFIERS,
33
34
  has_important_modifier: false,
34
35
  base_class_name: class_name,
35
36
  maybe_postfix_modifier_position: nil,
@@ -37,7 +38,9 @@ module TailwindMerge
37
38
  end
38
39
  end
39
40
 
40
- modifiers = []
41
+ # Stays nil until the first modifier separator, so the common no-modifier
42
+ # class (`px-2`, `block`) never allocates an array.
43
+ modifiers = nil
41
44
 
42
45
  bracket_depth = 0
43
46
  paren_depth = 0
@@ -55,7 +58,7 @@ module TailwindMerge
55
58
 
56
59
  if bracket_depth.zero? && paren_depth.zero?
57
60
  if byte == MODIFIER_SEPARATOR_BYTE
58
- modifiers << class_name.byteslice(modifier_start, index - modifier_start)
61
+ (modifiers ||= []) << class_name.byteslice(modifier_start, index - modifier_start)
59
62
  modifier_start = index + MODIFIER_SEPARATOR_LENGTH
60
63
  index += 1
61
64
  next
@@ -76,7 +79,7 @@ module TailwindMerge
76
79
  index += 1
77
80
  end
78
81
 
79
- base_class_name_with_important_modifier = modifiers.empty? ? class_name : class_name.byteslice(modifier_start, size - modifier_start)
82
+ base_class_name_with_important_modifier = modifiers ? class_name.byteslice(modifier_start, size - modifier_start) : class_name
80
83
 
81
84
  base_class_name, has_important_modifier = strip_important_modifier(base_class_name_with_important_modifier)
82
85
 
@@ -86,7 +89,7 @@ module TailwindMerge
86
89
 
87
90
  TailwindClass.new(
88
91
  is_external: false,
89
- modifiers:,
92
+ modifiers: modifiers || EMPTY_MODIFIERS,
90
93
  has_important_modifier:,
91
94
  base_class_name: base_class_name,
92
95
  maybe_postfix_modifier_position:,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindMerge
4
- VERSION = "1.5.2"
4
+ VERSION = "1.5.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwind_merge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
@@ -74,15 +74,15 @@ files:
74
74
  - lib/tailwind_merge/version.rb
75
75
  - script/test
76
76
  - tailwind_merge.gemspec
77
- homepage: https://github.com/gjtorikian/tailwind_merge/tree/v1.5.2
77
+ homepage: https://github.com/gjtorikian/tailwind_merge/tree/v1.5.3
78
78
  licenses:
79
79
  - MIT
80
80
  metadata:
81
- homepage_uri: https://github.com/gjtorikian/tailwind_merge/tree/v1.5.2
82
- source_code_uri: https://github.com/gjtorikian/tailwind_merge/tree/v1.5.2
83
- changelog_uri: https://github.com/gjtorikian/tailwind_merge/blob/v1.5.2/CHANGELOG.md
81
+ homepage_uri: https://github.com/gjtorikian/tailwind_merge/tree/v1.5.3
82
+ source_code_uri: https://github.com/gjtorikian/tailwind_merge/tree/v1.5.3
83
+ changelog_uri: https://github.com/gjtorikian/tailwind_merge/blob/v1.5.3/CHANGELOG.md
84
84
  bug_tracker_uri: https://github.com/gjtorikian/tailwind_merge/issues
85
- documentation_uri: https://rubydoc.info/gems/tailwind_merge/1.5.2
85
+ documentation_uri: https://rubydoc.info/gems/tailwind_merge/1.5.3
86
86
  funding_uri: https://github.com/sponsors/gjtorikian
87
87
  rubygems_mfa_required: 'true'
88
88
  rdoc_options: []