From e5869338ac79733e4153c54b054773c9d8b6e6a4 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 2 Dec 2025 10:29:50 -0500 Subject: [PATCH 1/2] Bump bundled Tailwind CSS version --- .../tailwindcss-language-server/package.json | 2 +- .../src/project-locator.test.ts | 16 ++++++++-------- .../tests/colors/colors.test.js | 4 ++-- .../tests/diagnostics/diagnostics.test.js | 8 -------- .../tests/env/v4.test.js | 18 +++++++++--------- .../tests/fixtures/v4/basic/package-lock.json | 8 ++++---- .../tests/fixtures/v4/basic/package.json | 2 +- .../v4/css-loading-js/package-lock.json | 8 ++++---- .../fixtures/v4/css-loading-js/package.json | 2 +- .../fixtures/v4/dependencies/package-lock.json | 8 ++++---- .../fixtures/v4/dependencies/package.json | 2 +- .../v4/invalid-import-order/package-lock.json | 8 ++++---- .../v4/invalid-import-order/package.json | 2 +- .../v4/missing-files/package-lock.json | 8 ++++---- .../fixtures/v4/missing-files/package.json | 2 +- .../fixtures/v4/multi-config/package-lock.json | 8 ++++---- .../fixtures/v4/multi-config/package.json | 2 +- .../v4/path-mappings/package-lock.json | 8 ++++---- .../fixtures/v4/path-mappings/package.json | 2 +- .../fixtures/v4/with-prefix/package-lock.json | 8 ++++---- .../tests/fixtures/v4/with-prefix/package.json | 2 +- .../fixtures/v4/workspaces/package-lock.json | 8 ++++---- .../tests/fixtures/v4/workspaces/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 24 files changed, 70 insertions(+), 78 deletions(-) diff --git a/packages/tailwindcss-language-server/package.json b/packages/tailwindcss-language-server/package.json index 70ff6075..40b3e05a 100644 --- a/packages/tailwindcss-language-server/package.json +++ b/packages/tailwindcss-language-server/package.json @@ -89,7 +89,7 @@ "rimraf": "3.0.2", "stack-trace": "0.0.10", "tailwindcss": "3.4.18", - "tailwindcss-v4": "npm:tailwindcss@4.1.15", + "tailwindcss-v4": "npm:tailwindcss@4.1.17", "tinyglobby": "^0.2.12", "tsconfck": "^3.1.4", "tsconfig-paths": "^4.2.0", diff --git a/packages/tailwindcss-language-server/src/project-locator.test.ts b/packages/tailwindcss-language-server/src/project-locator.test.ts index 19575f82..8e53c180 100644 --- a/packages/tailwindcss-language-server/src/project-locator.test.ts +++ b/packages/tailwindcss-language-server/src/project-locator.test.ts @@ -455,7 +455,7 @@ testLocator({ }, expected: [ { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/src/a/b/c/index.css', content: [], }, @@ -487,12 +487,12 @@ testLocator({ }, expected: [ { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/index.css', content: [], }, { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/src/vendor/c.css', content: [], }, @@ -519,12 +519,12 @@ testLocator({ }, expected: [ { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/src/app.css', content: [], }, { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/a/foo.css', content: [], }, @@ -554,12 +554,12 @@ testLocator({ }, expected: [ { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/src/app.css', content: [], }, { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/a/foo.css', content: [], }, @@ -581,7 +581,7 @@ testLocator({ }, expected: [ { - version: '4.1.15 (bundled)', + version: '4.1.17 (bundled)', config: '/src/app.css', content: [], }, diff --git a/packages/tailwindcss-language-server/tests/colors/colors.test.js b/packages/tailwindcss-language-server/tests/colors/colors.test.js index 570d2330..92da0d58 100644 --- a/packages/tailwindcss-language-server/tests/colors/colors.test.js +++ b/packages/tailwindcss-language-server/tests/colors/colors.test.js @@ -349,7 +349,7 @@ defineTest({ expect(c.project).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: true, }, }) @@ -388,7 +388,7 @@ defineTest({ expect(c.project).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: true, }, }) diff --git a/packages/tailwindcss-language-server/tests/diagnostics/diagnostics.test.js b/packages/tailwindcss-language-server/tests/diagnostics/diagnostics.test.js index 957185d0..4ddee0f2 100644 --- a/packages/tailwindcss-language-server/tests/diagnostics/diagnostics.test.js +++ b/packages/tailwindcss-language-server/tests/diagnostics/diagnostics.test.js @@ -446,14 +446,6 @@ defineTest({ defineTest({ name: 'Shows warning when using non-canonical classes', fs: { - // TODO: Drop this when the embedded version of tailwindcss is v4.1.15 - 'package.json': json` - { - "dependencies": { - "tailwindcss": "0.0.0-insiders.249bed0" - } - } - `, 'app.css': css` @import 'tailwindcss'; `, diff --git a/packages/tailwindcss-language-server/tests/env/v4.test.js b/packages/tailwindcss-language-server/tests/env/v4.test.js index 2ba3076c..f054287a 100644 --- a/packages/tailwindcss-language-server/tests/env/v4.test.js +++ b/packages/tailwindcss-language-server/tests/env/v4.test.js @@ -21,7 +21,7 @@ defineTest({ expect(await client.project()).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: true, }, }) @@ -137,7 +137,7 @@ defineTest({ expect(await client.project()).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: true, }, }) @@ -188,7 +188,7 @@ defineTest({ 'package.json': json` { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } `, @@ -205,7 +205,7 @@ defineTest({ expect(await client.project()).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: false, }, }) @@ -243,7 +243,7 @@ defineTest({ 'package.json': json` { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } `, @@ -270,7 +270,7 @@ defineTest({ expect(await client.project()).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: false, }, }) @@ -322,7 +322,7 @@ defineTest({ expect(await client.project()).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: true, }, }) @@ -354,7 +354,7 @@ defineTest({ 'package.json': json` { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } `, @@ -831,7 +831,7 @@ defineTest({ expect(await client.project()).toMatchObject({ tailwind: { - version: '4.1.15', + version: '4.1.17', isDefaultVersion: true, }, }) diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package-lock.json index b34f71b1..db44ced8 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/basic/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package-lock.json index 7c638edf..74935ce0 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package-lock.json index 9e7a982c..3a6f2cc8 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/dependencies/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package-lock.json index 9bc190ce..ce9b94be 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package-lock.json index 0414c9ca..6f89483b 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/missing-files/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package-lock.json index 0912a2e0..f46fb487 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/multi-config/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package-lock.json index 1f5accbd..0580cf52 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/path-mappings/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package-lock.json index e60772d7..6d75bfb8 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package.json index 9c2c538b..f1752f59 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package-lock.json b/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package-lock.json index 8526ae36..3dd6db07 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package-lock.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package-lock.json @@ -8,7 +8,7 @@ "packages/*" ], "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } }, "node_modules/@private/admin": { @@ -32,9 +32,9 @@ "link": true }, "node_modules/tailwindcss": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.15.tgz", - "integrity": "sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", "license": "MIT" }, "packages/admin": { diff --git a/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package.json b/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package.json index 60653706..5a5b8df9 100644 --- a/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package.json +++ b/packages/tailwindcss-language-server/tests/fixtures/v4/workspaces/package.json @@ -3,6 +3,6 @@ "packages/*" ], "dependencies": { - "tailwindcss": "4.1.15" + "tailwindcss": "4.1.17" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4b1b6e87..216c758a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,8 +204,8 @@ importers: specifier: 3.4.18 version: 3.4.18 tailwindcss-v4: - specifier: npm:tailwindcss@4.1.15 - version: tailwindcss@4.1.15 + specifier: npm:tailwindcss@4.1.17 + version: tailwindcss@4.1.17 tinyglobby: specifier: ^0.2.12 version: 0.2.12 @@ -2434,8 +2434,8 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - tailwindcss@4.1.15: - resolution: {integrity: sha512-k2WLnWkYFkdpRv+Oby3EBXIyQC8/s1HOFMBUViwtAh6Z5uAozeUSMQlIsn/c6Q2iJzqG6aJT3wdPaRNj70iYxQ==} + tailwindcss@4.1.17: + resolution: {integrity: sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==} tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} @@ -4674,7 +4674,7 @@ snapshots: transitivePeerDependencies: - ts-node - tailwindcss@4.1.15: {} + tailwindcss@4.1.17: {} tapable@2.2.1: {} From 29eab267deab838c33d8ffc03afbc3099f32108c Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 3 Dec 2025 14:28:36 -0500 Subject: [PATCH 2/2] Improve performance in large files (#1507) There are two performance improvements here that both come down to caching: - We call `indexToPosition` *a lot*. Every time this is called it takes the string passed in and re-computes the indices every time. There's no need for this so we have a small, module-level LRU cache to store the data. This should eventually be replaced with parsing and storing data up front when files are edited instead of just doing this whenever we receive a request. That would negate the need for a module-level cache. - We call `compile()` and `candidatesToCss` *a lot* as well. This is expected but 90% of the time the classes passed in have already been seen. We take the generated CSS and convert to a PostCSS node because a lot of the implementation uses that internally. There's no need to go through the whole parse -> serialize -> re-parse routine like we are. I've opted to store the compiled PostCSS roots on the `designSystem.storage` object (which will be created when it doesn't exist on old versions) and we'll return clones of those objects every time (since they may get mutated). With this there's only one large-ish block in a left-heavy profile: `findClassListsInHtmlRange`. That is mostly related to the class attribute lexer. Fixing it will require us to scan document and store info about them when they change. We shouldn't need to run the class attribute lexer if the document hasn't changed. Fixing this will require some more work though. Fixes #1503 --- .../src/util/v4/design-system.ts | 37 +++++++++++++++---- .../src/util/find.ts | 16 +++++++- .../src/util/v4/design-system.ts | 4 ++ packages/vscode-tailwindcss/CHANGELOG.md | 1 + 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/packages/tailwindcss-language-server/src/util/v4/design-system.ts b/packages/tailwindcss-language-server/src/util/v4/design-system.ts index f312b95c..b7bf8daf 100644 --- a/packages/tailwindcss-language-server/src/util/v4/design-system.ts +++ b/packages/tailwindcss-language-server/src/util/v4/design-system.ts @@ -13,6 +13,7 @@ import { plugins } from './plugins' const HAS_V4_IMPORT = /@import\s*(?:'tailwindcss'|"tailwindcss")/ const HAS_V4_THEME = /@theme\s*\{/ +const COMPILE_CACHE = Symbol('LSP_COMPILE_CACHE') export async function isMaybeV4(css: string): Promise { // Look for: @@ -215,6 +216,11 @@ export async function loadDesignSystem( }), }) + // This object doesn't exist in older versions but we can patch it in so it + // seems like it always existed. + design.storage ??= {} + design.storage[COMPILE_CACHE] = {} + // Step 4: Augment the design system with some additional APIs that the LSP needs Object.assign(design, { dependencies: () => dependencies, @@ -227,25 +233,42 @@ export async function loadDesignSystem( // - Replace `candidatesToCss` with a `candidatesToAst` API // First step would be to convert to a PostCSS AST by transforming the nodes directly // Then it would be to drop the PostCSS AST representation entirely in all v4 code paths - compile(classes: string[]): (postcss.Root | null)[] { - let css = design.candidatesToCss(classes) + compile(classes: string[]): postcss.Root[] { + // 1. Compile any uncached classes + let cache = design.storage[COMPILE_CACHE] as Record + let uncached = classes.filter((name) => cache[name] === undefined) + + let css = design.candidatesToCss(uncached) let errors: any[] = [] - let roots = css.map((str) => { - if (str === null) return postcss.root() + for (let [idx, cls] of uncached.entries()) { + let str = css[idx] + + if (str === null) { + cache[cls] = postcss.root() + continue + } try { - return postcss.parse(str.trimEnd()) + cache[cls] = postcss.parse(str.trimEnd()) } catch (err) { errors.push(err) - return postcss.root() + cache[cls] = postcss.root() + continue } - }) + } if (errors.length > 0) { console.error(JSON.stringify(errors)) } + // 2. Pull all the classes from the cache + let roots: postcss.Root[] = [] + + for (let cls of classes) { + roots.push(cache[cls].clone()) + } + return roots }, diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts index 1bd51cfa..ab1df1f6 100644 --- a/packages/tailwindcss-language-service/src/util/find.ts +++ b/packages/tailwindcss-language-service/src/util/find.ts @@ -1,4 +1,4 @@ -import type { Range, Position } from 'vscode-languageserver' +import { type Range, type Position, LRUCache } from 'vscode-languageserver' import type { TextDocument } from 'vscode-languageserver-textdocument' import type { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' import lineColumn from 'line-column' @@ -591,8 +591,20 @@ export function findHelperFunctionsInRange( return fns } +let lineTableCache = new LRUCache>(20) + +function createLineTable(str: string) { + let existing = lineTableCache.get(str) + if (existing) return existing + + let table = lineColumn(str + '\n') + lineTableCache.set(str, table) + return table +} + export function indexToPosition(str: string, index: number): Position { - const { line, col } = lineColumn(str + '\n').fromIndex(index) ?? { line: 1, col: 1 } + let table = createLineTable(str) + let { line, col } = table.fromIndex(index) ?? { line: 1, col: 1 } return { line: line - 1, character: col - 1 } } diff --git a/packages/tailwindcss-language-service/src/util/v4/design-system.ts b/packages/tailwindcss-language-service/src/util/v4/design-system.ts index 2ddcc2b3..2e00d8ce 100644 --- a/packages/tailwindcss-language-service/src/util/v4/design-system.ts +++ b/packages/tailwindcss-language-service/src/util/v4/design-system.ts @@ -50,6 +50,10 @@ export interface DesignSystem { // Added in v4.1.15 canonicalizeCandidates?(classes: string[], options?: CanonicalizeOptions): string[] + + // Added in v4.1.16 + // We can patch it into any design system if it doesn't exist though + storage?: Record } export interface DesignSystem { diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md index d8c536d0..d817fbb7 100644 --- a/packages/vscode-tailwindcss/CHANGELOG.md +++ b/packages/vscode-tailwindcss/CHANGELOG.md @@ -3,6 +3,7 @@ ## Prerelease - Add a source to all emitted diagnostics ([#1491](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1491)) +- Improve performance in large files ([#1507](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1507)) ## 0.14.29