Skip to content

Commit f425720

Browse files
Do not migrate blur in wire:model.blur (#18216)
This PR fixes an issue where the `blur` in `wire:model.blur="…"` was incorrectly migrated. We solved it by marking `wire:…` as an unsafe region (`…` can be anything but whitespace). Fixes: #18187 ## Test plan Added a test with this use case --------- Co-authored-by: Jordan Pittman <[email protected]>
1 parent b3fde17 commit f425720

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Upgrade: migrate arbitrary modifiers with values without percentage sign to bare values `/[0.16]` -> `/16` ([#18184](https://github.com/tailwindlabs/tailwindcss/pull/18184))
1313
- Upgrade: migrate CSS variable shorthand if fallback value contains function call ([#18184](https://github.com/tailwindlabs/tailwindcss/pull/18184))
1414
- Upgrade: Migrate negative arbitrary values to negative bare values, e.g.: `mb-[-32rem]``-mb-128` ([#18212](https://github.com/tailwindlabs/tailwindcss/pull/18212))
15+
- Upgrade: Do not migrate `blur` in `wire:model.blur` ([#18216](https://github.com/tailwindlabs/tailwindcss/pull/18216))
1516

1617
## [4.1.8] - 2025-05-27
1718

packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@ test('does not replace classes in invalid positions', async () => {
5858
await shouldNotReplace('<div v-if="!duration">', '!duration')
5959
await shouldNotReplace('<div :active="!duration">', '!duration')
6060
await shouldNotReplace('<div :active="!visible">', '!visible')
61+
62+
// Alpine/Livewire wire:…
63+
await shouldNotReplace('<x-input.number required="foo" wire:model.blur="coins" />', 'blur')
6164
})

packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const CONDITIONAL_TEMPLATE_SYNTAX = [
1515
// Alpine
1616
/x-if=['"]$/,
1717
/x-show=['"]$/,
18+
/wire:[^\s]*?$/,
1819
]
1920
const NEXT_PLACEHOLDER_PROP = /placeholder=\{?['"]$/
2021

0 commit comments

Comments
 (0)