From f425720c249cfada073bc54b3b4d600ff8c3592f Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Tue, 3 Jun 2025 20:27:59 +0200 Subject: [PATCH] Do not migrate `blur` in `wire:model.blur` (#18216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CHANGELOG.md | 1 + .../src/codemods/template/is-safe-migration.test.ts | 3 +++ .../src/codemods/template/is-safe-migration.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d293fd5c1..ef1694dfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgrade: migrate arbitrary modifiers with values without percentage sign to bare values `/[0.16]` -> `/16` ([#18184](https://github.com/tailwindlabs/tailwindcss/pull/18184)) - Upgrade: migrate CSS variable shorthand if fallback value contains function call ([#18184](https://github.com/tailwindlabs/tailwindcss/pull/18184)) - Upgrade: Migrate negative arbitrary values to negative bare values, e.g.: `mb-[-32rem]` → `-mb-128` ([#18212](https://github.com/tailwindlabs/tailwindcss/pull/18212)) +- Upgrade: Do not migrate `blur` in `wire:model.blur` ([#18216](https://github.com/tailwindlabs/tailwindcss/pull/18216)) ## [4.1.8] - 2025-05-27 diff --git a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts index 455b68660..b4c9c0124 100644 --- a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts +++ b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts @@ -58,4 +58,7 @@ test('does not replace classes in invalid positions', async () => { await shouldNotReplace('
', '!duration') await shouldNotReplace('
', '!duration') await shouldNotReplace('
', '!visible') + + // Alpine/Livewire wire:… + await shouldNotReplace('', 'blur') }) diff --git a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.ts b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.ts index 047424e11..27c2e2321 100644 --- a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.ts +++ b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.ts @@ -15,6 +15,7 @@ const CONDITIONAL_TEMPLATE_SYNTAX = [ // Alpine /x-if=['"]$/, /x-show=['"]$/, + /wire:[^\s]*?$/, ] const NEXT_PLACEHOLDER_PROP = /placeholder=\{?['"]$/