From 7d5e1c20f6d8489d986394470ea56aa9609fc8a7 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Tue, 29 Apr 2025 18:36:18 +0200 Subject: [PATCH 1/3] do not sort / format stylesheets that didn't change --- packages/@tailwindcss-upgrade/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/@tailwindcss-upgrade/src/index.ts b/packages/@tailwindcss-upgrade/src/index.ts index 85b5520a05ee..ed802a2e04d4 100644 --- a/packages/@tailwindcss-upgrade/src/index.ts +++ b/packages/@tailwindcss-upgrade/src/index.ts @@ -90,6 +90,7 @@ async function run() { let stylesheets = loadResults .filter((result) => result.status === 'fulfilled') .map((result) => result.value) + let originals = new Map(stylesheets.map((sheet) => [sheet, sheet.root.toString()])) // Analyze the stylesheets try { @@ -213,6 +214,7 @@ async function run() { // Format nodes for (let sheet of stylesheets) { + if (originals.get(sheet) === sheet.root.toString()) continue await postcss([sortBuckets(), formatNodes()]).process(sheet.root!, { from: sheet.file! }) } From f6d3691113a8a833bc0585b17ff61f033b8a079c Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Tue, 29 Apr 2025 18:38:54 +0200 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9126b72f7963..bbe07291ca89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - PostCSS: Ensure that errors in stylesheet dependencies are recoverable ([#17754](https://github.com/tailwindlabs/tailwindcss/pull/17754)) - Upgrade: Correctly print variants starting with `@` ([#17814](https://github.com/tailwindlabs/tailwindcss/pull/17814)) - Skip `color-mix(…)` when opacity is `100%` ([#17815](https://github.com/tailwindlabs/tailwindcss/pull/17815)) +- Upgrade: Don't format stylesheets when nothing changed ([#17824](https://github.com/tailwindlabs/tailwindcss/pull/17824)) ## [4.1.4] - 2025-04-14 From f07a60952164bbee39f1b8ac68ba17fade619067 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Tue, 29 Apr 2025 18:56:29 +0200 Subject: [PATCH 3/3] update integration tests --- integrations/upgrade/index.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/integrations/upgrade/index.test.ts b/integrations/upgrade/index.test.ts index b52031b3275c..264bd7ff4c3c 100644 --- a/integrations/upgrade/index.test.ts +++ b/integrations/upgrade/index.test.ts @@ -1266,7 +1266,6 @@ test( --- ./src/c.1.css --- @import './c.2.css' layer(utilities); - .baz-from-c { color: green; }