mirror of
https://github.com/hanzoai/tailwindcss.git
synced 2026-09-24 17:03:14 +00:00
v4.3.2
292
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6f0577f691 | 4.3.2 (#20281) | ||
|
|
1ee11805a6 |
Update all pnpm dependencies (2026-06-19) (#20262)
This is your weekly update of **all** pnpm dependencies. Please take a good look at what changed and the test results before merging this pull request. ### What changed? ✳️ postcss-selector-parser (7.1.1 → 7.1.4, patch) · [Repo](https://github.com/postcss/postcss-selector-parser) · [Changelog](https://github.com/postcss/postcss-selector-parser/blob/master/CHANGELOG.md) · [Release](https://github.com/postcss/postcss-selector-parser/releases/tag/7.1.4) · [Diff](https://github.com/postcss/postcss-selector-parser/compare/cf6637ed6a2dbc9d24bc3a1d04ec7ac4629dd856...4a7e4e3685db8ab8e52e51ecdbe8162a8568f70c) ✳️ semver (7.8.1 → 7.8.4, patch) · [Repo](https://github.com/npm/node-semver) · [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) · [Release](https://github.com/npm/node-semver/releases/tag/v7.8.4) · [Diff](https://github.com/npm/node-semver/compare/76416081a8413383cf6e24c82cafa438bd076d41...8640bd68f1653e504b53e9be4030eccdfe4c307a) ✳️ turbo (2.9.14 → 2.9.18, patch) · [Repo](https://github.com/vercel/turborepo) · [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md) · [Release](https://github.com/vercel/turborepo/releases/tag/v2.9.18) · [Diff](https://github.com/vercel/turborepo/compare/fc62fe0d9c347d1d24f0ed8946284856593ddb93...3bdce3277d2e61cdbf29f244a515dd4b896d2556) ---  [Depfu](https://depfu.com) will only send you the next scheduled PR once you merge or close this one. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu refresh</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
ffb07aeb72 | 4.3.1 (#20226) | ||
|
|
0defa28d79 |
Do not crash when migrating empty classes (#20205)
This PR fixes a crash while using `npx @tailwindcss/upgrade` when
migrating classes with no body inside of an `@layer utilities`.
When running `npx @tailwindcss/upgrade`, one thing we do is migrate the
CSS from:
```css
@layer utilities {
.foo {
color: red;
}
}
```
To:
```css
@utility foo {
color: red;
}
```
We already have some logic that leaves non-classe (IDs, attribute
selectors, ...) alone. But if we are migrating a class that has no body,
then we will migrate that as well:
```css
@layer utilities {
.empty {
}
}
```
Is turned into:
```css
@utility empty {
}
```
But later in the migration process this will result in an error because
a `@utility` has to have at least _some_ nodes.
Ideally, you don't even have CSS that has empty rules since it doesn't
have any effect in the browser (except of making your CSS file bigger),
but it could be that you don't have control over this file, so a fix is
still valid.
This PR solves that by leaving those rules alone, and keep them in an
`@layer utilities`.
Fixes: #20204
## Test plan
1. Added a dedicated test for this usecase
|
||
|
|
d56460be32 |
Remove unused test (#20117)
This PR cleans up some old stale test that has been skipped from the
beginning.
While this test wants to prove that migrating from Tailwind CSS v3 to
Tailwind CSS v4 can handle the `#{!important}` SCSS notation, it doesn't
prove that we can migrate an entire SCSS project. SCSS has much more
special syntax and we never supported that.
Let's get rid of this test that's doing nothing at the moment.
Especially since we don't want to migrate SCSS projects. Enabling this
might result in the false sense that we _do_ support SCSS migrations
which is not the case.
Closes: #20106
|
||
|
|
faa86f841c |
Expose index and siblings on walk context (#20109)
This PR is a small improvement of the current `walk` implementation
where we will expose the `index` and the `siblings` on the current
context.
During a walk, we walk over objects that contain a `nodes: []` field.
The `ctx.parent` that already exists is a reference to the parent node,
but `ctx.siblings` is a reference to the `ctx.parent.nodes`.
The `ctx.index` is the index of the current node we are walking in the
`siblings` array. This way we can prevent the awkward
`ctx.parent?.nodes.indexOf(node)` which is a bit silly because we
already know the nodes we're walking and its index...
The `ctx.parent` can be `null`, but the `ctx.siblings` will never be
`null`, this can be seen in a situation like this:
```ts
let ast: AstNode = [nodeA, nodeB]
walk(ast, (node, ctx) => {
if (node === nodeA) {
ctx.parent === null; // Because there is no parent
ctx.siblings === ast; // Because that's the current list we're looping over
// Before this PR, we would have to do something like:
let siblings = ctx.parent?.nodes ?? ast
}
})
```
In the above example, the `ast` is a separately variable, but if this
was inlined, we would run into some issues:
```ts
walk([nodeA, nodeB], (node, ctx) => {
if (node === nodeA) {
ctx.parent === null; // Because there is no parent
ctx.siblings === ast; // Because that's the current list we're looping over
// At this point, there is no way to get to the `[nodeA, nodeB]` list
// without moving it to a variable first.
}
})
```
So, this PR doesn't change much, the additional information we track is
already known information that is now exposed to the caller of the
`walk` function.
In this PR we did update some usages and got rid of some awkward
`ctx.parent?.nodes ?? []` and `ctx.parent.nodes.indexOf(…)` usages.
## Test plan
- All tests still pass as expected
|
||
|
|
b05a1d9c34 |
Bump dependencies (#20095)
This PR bumps some of our dependencies, common dependencies were moved to pnpm's `catalog` feature. Closes #20092 Closes #20085 Closes #20075 Closes #20066 Closes #20062 ## Test plan - All tests still pass - Each dependency was published some time ago. Webpack has an even newer version that was published <15min ago. Will update that one later. [ci-all] |
||
|
|
7cb38ff55e |
Update jiti 2.6.1 → 2.7.0 (minor) (#20044)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ jiti (2.6.1 → 2.7.0) · [Repo](https://github.com/unjs/jiti) · [Changelog](https://github.com/unjs/jiti/blob/main/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/unjs/jiti/releases/tag/v2.7.0">2.7.0</a></h4> <blockquote><p dir="auto"><a href="https://bounce.depfu.com/github.com/unjs/jiti/compare/v2.6.1...v2.7.0">compare changes</a></p> <h3 dir="auto">🚀 Enhancements</h3> <ul dir="auto"> <li>Add explicit resource management (<code class="notranslate">using</code>/<code class="notranslate">await using</code>) support (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/422">#422</a>)</li> <li>Support opt-in <code class="notranslate">tsconfigPaths</code> (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/427">#427</a>)</li> <li>Support virtual modules (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/428">#428</a>)</li> <li>Add <code class="notranslate">jiti/static</code> subpath (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/430">#430</a>)</li> </ul> <h3 dir="auto">🔥 Performance</h3> <ul dir="auto"> <li> <strong>interopDefault:</strong> Add caching to reduce proxy overhead by ~2x (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/421">#421</a>)</li> </ul> <h3 dir="auto">🩹 Fixes</h3> <ul dir="auto"> <li> <strong>require:</strong> Passthrough resolve options (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/412">#412</a>)</li> <li> <strong>require:</strong> Fallback to transpilation when <code class="notranslate">tryNative</code> fails (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/413">#413</a>)</li> <li>Fallback for <code class="notranslate">ENAMETOOLONG</code> when evaluating esm (<a href="https://bounce.depfu.com/github.com/unjs/jiti/pull/429">#429</a>)</li> </ul> <h3 dir="auto">📦 Build</h3> <ul dir="auto"> <li>Upgrade rspack to v2 (<a href="https://bounce.depfu.com/github.com/unjs/jiti/commit/55194fb">55194fb</a>)</li> <li>Experimental rolldown config (<a href="https://bounce.depfu.com/github.com/unjs/jiti/commit/8c0243f">8c0243f</a>)</li> </ul> <h3 dir="auto">✅ Tests</h3> <ul dir="auto"> <li>Ignore jsx test for bun/cjs (<a href="https://bounce.depfu.com/github.com/unjs/jiti/commit/3a744ca">3a744ca</a>)</li> </ul> <h3 dir="auto">❤️ Contributors</h3> <ul dir="auto"> <li>Pooya Parsa (<a href="https://bounce.depfu.com/github.com/pi0">@pi0</a>)</li> <li>Kricsleo (<a href="https://bounce.depfu.com/github.com/kricsleo">@kricsleo</a>)</li> <li>Espen Hovlandsdal (<a href="https://bounce.depfu.com/github.com/rexxars">@rexxars</a>)</li> <li>Rintaro Itokawa (<a href="https://bounce.depfu.com/github.com/re-taro">@re-taro</a>)</li> <li>Matteo Collina (<a href="https://bounce.depfu.com/github.com/mcollina">@mcollina</a>)</li> <li>Mario Zechner (<a href="https://bounce.depfu.com/github.com/badlogic">@badlogic</a>)</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/jiti/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/unjs/jiti/compare/aedcdee7fed09dfd1cb7945daff64a6e41004f09...fd3bb289b75ed207edfb686d671ed50144f7e90f">See the full diff on Github</a>. The new version differs by 29 commits:</p> <ul> <li><a href="https://github.com/unjs/jiti/commit/fd3bb289b75ed207edfb686d671ed50144f7e90f"><code>chore(release): v2.7.0</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/27fe3f2a496b712674061c767f21ceaf34d39d83"><code>chore: update release script</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/4fcd2f23aa31d2e1ece4b307350b8c1d72a26870"><code>fix: fallback for `ENAMETOOLONG` when evaluating esm (#429)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/8c0243f14e65193fceb023b81aed5c9a820ee2cb"><code>build: experimental rolldown config</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/55194fbb97b56af50ae1c19735ee3b06110b3903"><code>build: upgrade rspack</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/0abda72c11fa31654ae17f255f9a854e4b706018"><code>ci: update node test matrix</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/8c7822ef2ff03669c31de2fedfcf6676970f5b2a"><code>chore: update tsconfig</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/08fc868c928d65fb615800e51b0ec1ac78f83a69"><code>chore: update deps</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/5d552e3bebf9ffcd3fb9f176364fce7b4e35134d"><code>feat: add `jiti/static` export (#430)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/ae790b0214512857e40e8b3078b63a7d65f7f2c9"><code>feat: support virtual modules option (#428)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/a3e705dbdcda999c85a481448b9fa471bb88661b"><code>fix(require): fallback to transpilation when `tryNative` fails (#413)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/4deba1628391ca636f698515457f4f59619d637e"><code>chore: update agents.md</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/f85b0e523d4f5f82f08c90765b63a077abd7bebe"><code>lint</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/3ce242653f50f0987ffc596706c264b755daf527"><code>feat: support opt-in `tsconfigPaths` (#427)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/c49c54e42e0863fffe25164b50983aebe635a4d2"><code>chore: init agents.md</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/b66bd233c21644c12a2341022a68b2263d2f1ed9"><code>feat: add explicit resource management (using/await using) support (#422)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/a467d31ffccd833947c18e925007c5bba910e0d6"><code>perf(interopDefault): add caching to reduce proxy overhead by ~2x (#421)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/fe264b49f1d89a8a8f30facc82fc182210f52186"><code>fix(ci): skip `--coverage` flag for node 18</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/058d91a338fb3062064db745c9b2cc2335773138"><code>chore: lint</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/650bc48a760e7aabefdbad79ad6a9f79f23578df"><code>chore: add missing prettier dep</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/e28b5e9645b0502dd88dfb17e9a422740faa59e1"><code>chore(deps): update autofix-ci/action digest to 7a166d7 (#424)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/31096aa9e2d689a0b33e26a24304a9f5e8e38da9"><code>chore(deps): update actions/checkout action to v6 (#419)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/498e8d73a46e1624285662a9c43e1f05a534a34a"><code>chore: update deps</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/9ee314fd0f5cb68d3c9db2987c5ffd91e250b93f"><code>test: update</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/3a744ca27125e1332179692b0ef14b9da4097a4e"><code>test: ignore jsx test for bun/cjs</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/e88ac44079e3839791c01f12342be385c87ba993"><code>chore: update deps</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/4045c7a2a2fc49566124f32e1c4597f995f1e22f"><code>chore: fix lint issues</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/39e86de57c1c866ff4568c17eb625afb325fbdec"><code>chore(deps): update actions/setup-node action to v6 (#411)</code></a></li> <li><a href="https://github.com/unjs/jiti/commit/ddb4683d374ec18e396ab42f180ca21c7147b17b"><code>fix(require): passthrough resolve options (#412)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
e0489ba984 | 4.3.0 (#20023) | ||
|
|
3dfd3953ac |
Update enhanced-resolve 5.20.1 → 5.21.0 (minor) (#19998)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ enhanced-resolve (5.20.1 → 5.21.0) · [Repo](https://github.com/webpack/enhanced-resolve) · [Changelog](https://github.com/webpack/enhanced-resolve/blob/main/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/webpack/enhanced-resolve/releases/tag/v5.21.0">5.21.0</a></h4> <blockquote><h3 dir="auto">Minor Changes</h3> <ul dir="auto"> <li> <p dir="auto">Added promise API and support to resolve without <code class="notranslate">context</code> and <code class="notranslate">resolveContext</code>. (by <a href="https://bounce.depfu.com/github.com/alexander-akait">@alexander-akait</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/520">#520</a>)</p> </li> <li> <p dir="auto">Add <code class="notranslate">extensionAliasForExports</code> option. When <code class="notranslate">true</code>, <code class="notranslate">extensionAlias</code> also applies to paths resolved through the <code class="notranslate">package.json</code> <code class="notranslate">exports</code> field. Off by default to match Node.js; opt in for full TypeScript-resolver parity with packages that ship <code class="notranslate">.ts</code> sources alongside the compiled <code class="notranslate">.js</code> they declare in <code class="notranslate">exports</code>. (by <a href="https://bounce.depfu.com/github.com/alexander-akait">@alexander-akait</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/554">#554</a>)</p> </li> </ul> <h3 dir="auto">Patch Changes</h3> <ul dir="auto"> <li> <p dir="auto">Properly handle DOS device paths (<code class="notranslate">\\?\…</code> and <code class="notranslate">\\.\…</code>). (by <a href="https://bounce.depfu.com/github.com/alexander-akait">@alexander-akait</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/551">#551</a>)</p> </li> <li> <p dir="auto">Prevent fallback to parent node_modules when the <code class="notranslate">exports</code> field target file is not found. (by <a href="https://bounce.depfu.com/github.com/xiaoxiaojx">@xiaoxiaojx</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/495">#495</a>)</p> </li> <li> <p dir="auto">Imports field spec deviation: non-relative targets (e.g. <code class="notranslate">"#a": "#b"</code>) no longer re-enter imports resolution, aligning with the Node.js ESM spec where <code class="notranslate">PACKAGE_IMPORTS_RESOLVE</code> does not recursively resolve <code class="notranslate">#</code> specifiers. (by <a href="https://bounce.depfu.com/github.com/xiaoxiaojx">@xiaoxiaojx</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/503">#503</a>)</p> <p dir="auto">Previously <code class="notranslate">{ "#a": "#b", "#b": "./the.js" }</code> would chain-resolve <code class="notranslate">#a</code> to <code class="notranslate">./the.js</code>; now it correctly fails, matching Node.js behavior.</p> </li> <li> <p dir="auto">Move <code class="notranslate">cachedJoin</code>/<code class="notranslate">cachedDirname</code>/<code class="notranslate">createCachedBasename</code> caches from module-level globals to per-Resolver instances. This prevents unbounded memory growth in long-running processes — when a Resolver is garbage collected, its join/dirname/basename caches are released with it. (by <a href="https://bounce.depfu.com/github.com/xiaoxiaojx">@xiaoxiaojx</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/507">#507</a>)</p> </li> <li> <p dir="auto">Fixed when <code class="notranslate">tsconfig: true</code> is used (default config file) and no <code class="notranslate">tsconfig.json</code> exists. (by <a href="https://bounce.depfu.com/github.com/xiaoxiaojx">@xiaoxiaojx</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/502">#502</a>)</p> </li> <li> <p dir="auto">Apply the <code class="notranslate">extensionAlias</code> option to the <code class="notranslate">imports</code> field to be align with typescript resolution. (by <a href="https://bounce.depfu.com/github.com/alexander-akait">@alexander-akait</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/549">#549</a>)</p> </li> <li> <p dir="auto">Improved performance of the many plugins. (by <a href="https://bounce.depfu.com/github.com/alexander-akait">@alexander-akait</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/529">#529</a>)</p> </li> <li> <p dir="auto">Replace the <code class="notranslate">Set<string></code>-based resolver stack with a singly-linked <code class="notranslate">StackEntry</code> class that exposes a Set-compatible API. (by <a href="https://bounce.depfu.com/github.com/xiaoxiaojx">@xiaoxiaojx</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/526">#526</a>)</p> <p dir="auto">Each <code class="notranslate">doResolve</code> call now prepends a single linked-list node instead of cloning the entire Set, making stack push O(1) in time and memory. Recursion detection walks the linked list (O(n)), but because the stack is typically shallow this is much cheaper than cloning a Set per call.</p> </li> <li> <p dir="auto">Cache the result of <code class="notranslate">stripJsonComments</code> + <code class="notranslate">JSON.parse</code> in <code class="notranslate">readJson</code> using a <code class="notranslate">WeakMap</code> keyed by the raw file buffer. This avoids redundant comment-stripping and JSON parsing on every resolve call that reads tsconfig.json files (via <code class="notranslate">stripComments: true</code>), improving TsconfigPathsPlugin warm performance by ~20-35% depending on the depth of the <code class="notranslate">extends</code> chain. (by <a href="https://bounce.depfu.com/github.com/xiaoxiaojx">@xiaoxiaojx</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/524">#524</a>)</p> </li> <li> <p dir="auto">Avoid OOM in CachedInputFileSystem when duration is Infinity. (by <a href="https://bounce.depfu.com/github.com/alexander-akait">@alexander-akait</a> in <a href="https://bounce.depfu.com/github.com/webpack/enhanced-resolve/pull/527">#527</a>)</p> </li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/enhanced-resolve/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/webpack/enhanced-resolve/compare/ebc67d38969e8abe6789a51968380fa721fea778...35035ca158f1c8ada86fcf1653f319cbce669200">See the full diff on Github</a>. The new version differs by more commits than we can show here.</p> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
736d28b4be |
[@tailwindcss/upgrade] Don’t migrate inline style properties (#19918)
Prevent the upgrade tool from rewriting CSS properties inside inline `style` attributes. This fixes cases like `style="flex-grow: 1"` being changed to `style="grow: 1"` and adds regression tests. --------- Co-authored-by: Robin Malfait <[email protected]> |
||
|
|
af1861bc01 |
Bump dependencies (#19957)
This PR bumps dependencies in all the packages, typically just bumping to the latest patch release. Closes: #19936 Closes: #19917 Closes: #19899 Closes: #19897 Closes: #19845 Closes: #19832 Closes: #19967 Closes: #19968 ## Test plan 1. All tests still pass 2. All integration tests still pass [ci-all] to verify Linux, Windows and macOS |
||
|
|
83801a1acf | 4.2.4 (#19948) | ||
|
|
c3012b452c | 4.2.3 (#19944) | ||
|
|
70cab6add6 |
Make upgrade tooling more stable (#19846)
This PR is an attempt to make the upgrade tooling more stable. ### TL;DR 1. When migrating from Tailwind CSS v3 → Tailwind CSS v4, only migrate files listed in the `config.content` instead of relying on v4's auto content detection feature 2. Skip writing files that have not been changed 3. Write changed files in a safe way: first write to a temporary file, then rename the file atomically 4. Never migrate files that are git ignored, even if they are listed in the `config.content` file 5. Always ignore `.env` and `.env.*` files when scanning for files. Most people will have this in their `.gitignore` file, but if not, then this is a fallback mechanism. --- Looking at the #18972 issue, it looks like some people are running into weird situations where some of the contents is just gone. I have never been able to reproduce this on my own devices and in my own projects unfortunately. But there is definitely _something_ happening that's not right that people are running into. Therefore, this PR is an attempt to fix what I think _might_ be wrong, but I'm not 100% sure if these fixes are enough, or if something else is still happening here. This builds on top of the #19779 PR which has some small fixes, but is incomplete to make this work. ### What's happening Looking at some of the comments, it looks like a few things are happening such as: 1. The upgrade tool is emptying out my files — it looks like these are only happening if you ctrl+c while the process is taking a while. It could be that a lot of files are being checked and therefore the tooling looks like its stuck. 6. The upgrade tool is looking at files it shouldn't look at — in Tailwind CSS v4 we have this concept of the auto-content detection. This means that we will look at any plain text file that is not git ignored. ### Fixes #### Emptying out files The files being emptied looks like it's because how `fs.writeFile` behaves by default. It opens the file handle with the `w` flag, which will first truncate the file before writing the new contents. This is not a single atomic operation, so a killed process in the middle will cause invalid state. When we migrate your template files, everything is happening in promises to migrate things at the same time. When a lot of files are being scanned, truncating might have happened already before we write the new content. Since we migrate a bunch of files in parallel, a ctrl+c could cause data loss in multiple files. To mitigate this, I switched to an alternative way of writing files. 1. First, we do some quick checks where if the contents didn't change we just bail out immediately. Files that don't include Tailwind CSS classes won't change, and therefore we don't need to override these files with the same contents. 2. When the migrated contents is empty, we bail out as well. I'm 100% sure that this is not the spot where the "emptying out" happens, I still believe it happens in the `writeFile` itself, but added it just in case. 7. Next, I introduced a safe write, where we first write to a temporary file in the same folder. We could write it to `/tmp`, but then we can't guarantee that we are on the same file system. If we ctrl+c at this stage, then the worst case scenario is that you have additional temporary files in your project, but your original files are still there. Once that file was written, we will use the atomic `fs.rename`. This should be atomic as long as we are on the same file system, so either the rename didn't happen yet, or it completed. I added an integration test for this, but I had to change the `writeFile` implementation slightly. In the test, we will truncate the file first, after that we will write the new contents. This is so that we have enough time to kill the current process and allows us to verify that we didn't clear out the file. Again, this is a hacky way of testing this, just because I can't reproduce this issue myself, let alone reproduce it reliable in a CI environment. Note: we are also using `realpath` to make sure that we are updating the real file. Otherwise, if we were dealing with a symlinked file, we would override the symlink with a "hard" copy instead. #### Touching files that should not be touched During the migration, we rely on the Tailwind CSS v4 auto detection logic which means that it will scan any plain text file that is not git ignored. Therefore changes to php files could happen because in theory they could contain Tailwind CSS classes. To solve this, when migrating from Tailwind CSS v3 to Tailwind CSS v4, we will _only_ take the sources into account that were listed in the `config.content` array. Since this was a requirement in Tailwind CSS v3, it should be safe to rely on this array. Additionally, this will make sure that we are dealing with way fewer files to migrate as well. On top of that, files that match the patterns in the content array that are git ignored will also be skipped. This is to prevent that we mutate files in `node_modules` for example. In one of the comments I read that `.env` files were emptied out. In most cases people will have these files gitignored but I explicitly added `.env` and `.env.*` as files to never ever touch by default when scanning. Last but not least, this also updates the output a little bit of the upgrade tool in case we skip content files (because of git ignore) and if we changed a file. <img width="1122" height="1376" alt="image" src="https://github.com/user-attachments/assets/318fdbbf-e319-4c7e-9648-ee9283842624" /> - "Git ignored folder, skipping: `./node_modules`": this is because the content array looks like this while the `node_modules` are being ignored: <img width="1090" height="398" alt="image" src="https://github.com/user-attachments/assets/7d694720-5671-47ec-bb2e-f24c5f2c4248" /> - "Migrated `./resources/views/vendor/filament-panels/components/logo.blade.php`": this is because **I** made a change to showcase this feature. Fixes: #18972 Closes: #19779 ### Test plan 1. Existing tests still pass 1. Added a dedicated integration test to ensure that we only take `config.content` into account when migrating from Tailwind CSS v3 to Tailwind CSS v4 projects. 1. Added a dedicated integration test to make sure that files listed in `config.content` that are also git ignored, will still be skipped. 1. Added a dedicated integration test to ensure that when `writeFile` is cancelled mid-write that our old files are still present. 1. Added a dedicated integration test to ensure that we ignore `.env` and `.env.*` files even if you didn't git ignore them. [ci-all] To verify on Windows --------- Co-authored-by: Sami <[email protected]> |
||
|
|
c6baf159d7 | 4.2.2 (#19821) | ||
|
|
d5b4cd389d |
fix: remove unused braces dependencies (#19797)
Removes unused braces and @types/braces from @tailwindcss/upgrade package.json as reported in issue #19794 --------- Co-authored-by: CG1AI <[email protected]> Co-authored-by: Robin Malfait <[email protected]> |
||
|
|
9b578ed948 |
Cleanup inconsistencies related to (regex) escapes (#19804)
This PR does some generic cleanup to the codebase. I'm playing with oxfmt and oxlint and noticed some unnecessary escapes. Might add these dependencies to the project later (and rolldown for building). But baby steps for now. ## Test plan 1. All tests should still pass |
||
|
|
9b3911ebd4 | 4.2.1 (#19714) | ||
|
|
b56832751b |
4.2.0 (#19695)
Co-authored-by: Adam Wathan <[email protected]> |
||
|
|
ee63f38af5 |
Update enhanced-resolve 5.18.4 → 5.19.0 (minor) (#19658)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ enhanced-resolve (5.18.4 → 5.19.0) · [Repo](https://github.com/webpack/enhanced-resolve) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/webpack/enhanced-resolve/releases/tag/v5.19.0">5.19.0</a></h4> <blockquote><h3 dir="auto">Features</h3> <ul dir="auto"> <li>Added TsconfigPathsPlugin (replacement for <code class="notranslate">tsconfig-paths-webpack-plugin</code>) .</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/enhanced-resolve/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/webpack/enhanced-resolve/compare/e8a6ac9fdd88d579e20f4c487d6081d8e7b3093f...24ba2335540a77c9b019d66d28f995324866a718">See the full diff on Github</a>. The new version differs by 4 commits:</p> <ul> <li><a href="https://github.com/webpack/enhanced-resolve/commit/24ba2335540a77c9b019d66d28f995324866a718"><code>chore(release): 5.19.0</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/10dc3bc8b8734ab644d91abd979bc8ee4ad64532"><code>chore: update eslint config webpack (#471)</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/0d6c6c0fd9a156843d5d8e0cafa71450c1ee9e0a"><code>feat: added TsconfigPathsPlugin (replacement for tsconfig-paths-webpack-plugin) (#463)</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/958aa8921909f2a2662ae09f239a0f96b9b32c2d"><code>chore: migrate to npm from yarn (#469)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
476e8f961a |
Update semver 7.7.3 → 7.7.4 (patch) (#19667)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ semver (7.7.3 → 7.7.4) · [Repo](https://github.com/npm/node-semver) · [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/npm/node-semver/releases/tag/v7.7.4">7.7.4</a></h4> <blockquote><h2 dir="auto"> <a href="https://bounce.depfu.com/github.com/npm/node-semver/compare/v7.7.3...v7.7.4">7.7.4</a> (2026-01-16)</h2> <h3 dir="auto">Bug Fixes</h3> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/npm/node-semver/commit/a29faa5f3309a01c8e5aeb965fb5c02c4c4e80e2"><code class="notranslate">a29faa5</code></a> <a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/835">#835</a> cli: pass options to semver.valid() for loose version validation (<a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/835">#835</a>) (<a href="https://bounce.depfu.com/github.com/mldangelo">@mldangelo</a>)</li> </ul> <h3 dir="auto">Documentation</h3> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/npm/node-semver/commit/1d28d5e82de16163daf721a7c76fff93e0d333ab"><code class="notranslate">1d28d5e</code></a> <a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/836">#836</a> fix typos and update -n CLI option documentation (<a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/836">#836</a>) (<a href="https://bounce.depfu.com/github.com/mldangelo">@mldangelo</a>)</li> </ul> <h3 dir="auto">Dependencies</h3> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/npm/node-semver/commit/120968b76760cb0db85a72bde2adedd0e9628793"><code class="notranslate">120968b</code></a> <a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/840">#840</a> <code class="notranslate">@npmcli/[email protected].0</code> (<a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/840">#840</a>)</li> </ul> <h3 dir="auto">Chores</h3> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/npm/node-semver/commit/44d7130c60cedd3703048aa671bb1d659b79ab07"><code class="notranslate">44d7130</code></a> <a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/824">#824</a> bump @npmcli/eslint-config from 5.1.0 to 6.0.0 (<a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/824">#824</a>) (<a href="https://bounce.depfu.com/github.com/dependabot">@dependabot</a>[bot])</li> <li> <a href="https://bounce.depfu.com/github.com/npm/node-semver/commit/70735767b68a1775eb67ac816b183b4a422101f4"><code class="notranslate">7073576</code></a> <a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/820">#820</a> reorder parameters in invalid-versions.js test (<a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/820">#820</a>) (<a href="https://bounce.depfu.com/github.com/reggi">@reggi</a>)</li> <li> <a href="https://bounce.depfu.com/github.com/npm/node-semver/commit/5816d4cfd6d85169527a2bc22fbd5bf4c64f34e3"><code class="notranslate">5816d4c</code></a> <a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/829">#829</a> bump @npmcli/template-oss from 4.28.0 to 4.28.1 (<a href="https://bounce.depfu.com/github.com/npm/node-semver/pull/829">#829</a>) (<a href="https://bounce.depfu.com/github.com/dependabot">@dependabot</a>[bot], <a href="https://bounce.depfu.com/github.com/npm-cli-bot">@npm-cli-bot</a>)</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/semver/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/npm/node-semver/compare/a25789b09b1192fa8414c35f2cd679ae2e1d5192...5993c2e42bdf17c5f03e6360da51bc707fcee460">See the full diff on Github</a>. The new version differs by 10 commits:</p> <ul> <li><a href="https://github.com/npm/node-semver/commit/5993c2e42bdf17c5f03e6360da51bc707fcee460"><code>chore: release 7.7.4 (#839)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/120968b76760cb0db85a72bde2adedd0e9628793"><code>deps: @npmcli/[email protected].0 (#840)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/a29faa5f3309a01c8e5aeb965fb5c02c4c4e80e2"><code>fix(cli): pass options to semver.valid() for loose version validation (#835)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/1d28d5e82de16163daf721a7c76fff93e0d333ab"><code>docs: fix typos and update -n CLI option documentation (#836)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/5816d4cfd6d85169527a2bc22fbd5bf4c64f34e3"><code>chore: bump @npmcli/template-oss from 4.28.0 to 4.28.1 (#829)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/ab9e28a582f524e8d40157f3d2b75fcc764d0765"><code>chore: bump @npmcli/template-oss from 4.27.1 to 4.28.0 (#827)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/44d7130c60cedd3703048aa671bb1d659b79ab07"><code>chore: bump @npmcli/eslint-config from 5.1.0 to 6.0.0 (#824)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/70735767b68a1775eb67ac816b183b4a422101f4"><code>chore: reorder parameters in invalid-versions.js test (#820)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/16a35f5df4bb142d781229a09158c4e9970c1f5a"><code>chore: bump @npmcli/template-oss from 4.26.0 to 4.27.1 (#823)</code></a></li> <li><a href="https://github.com/npm/node-semver/commit/3a3459da45389bd024ac907cbc21ca5a24beaa05"><code>chore: bump @npmcli/template-oss from 4.25.1 to 4.26.0 (#818)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
32b424ab3c |
docs: update package README CI badge to main (#19692)
## Summary Update the GitHub Actions CI status badge URLs in `packages/*/README.md` to track `branch=main` instead of `branch=next`. This matches the root README, keeps the badges consistent across the repo, and ensures the displayed CI status reflects the default branch. ## Test plan Docs-only change. Verified the updated badge URLs in the modified `packages/*/README.md` files use `ci.yml?branch=main`. |
||
|
|
f596734cfc |
Fix Tailwind CSS package README GitHub links (#19644)
<!-- 👋 Hey, thanks for your interest in contributing to Tailwind! **Please ask first before starting work on any significant new features.** It's never a fun experience to have your pull request declined after investing a lot of time and effort into a new feature. To avoid this from happening, we request that contributors create a discussion to first discuss any significant new features. For more info, check out the contributing guide: https://github.com/tailwindcss/tailwindcss/blob/main/.github/CONTRIBUTING.md --> ## Summary These package READMEs referenced the wrong GitHub org (tailwindcss/tailwindcss) and outdated branches (master/next) for common project links. Update them to point at tailwindlabs/tailwindcss on main for releases, license, discussions, and contributing docs. <!-- Provide a summary of the issue and the changes you're making. How does your change solve the problem? --> ## Test plan Docs-only change: No test required. <!-- Explain how you tested your changes. Include the exact commands that you used to verify the change works and include screenshots/screen recordings of the update behavior in the browser if applicable. --> |
||
|
|
c9ad92a0a6 |
Bump dependencies (#19608)
This PR bumps a bunch of dependencies. This also moves a few dependencies that we use in multiple packages to the pnpm catalog. Closes: #19603, #19604, #19576, #19575, #19573, #19565, #19547, #19546, #19545, #19609, #19581, #19620, #19619 - #19603 - #19604 - #19576 - #19575 - #19573 - #19565 - #19547 - #19546 - #19545 - #19609 - #19581 - https://github.com/tailwindlabs/tailwindcss/pull/19620 - #19620 - #19619 ## Test Plan All tests in CI should still pass. [ci-all] |
||
|
|
f5f15845fd | Fix typo in comment (#19493) | ||
|
|
665dfabe1f |
Update dedent 1.7.0 → 1.7.1 (patch) (#19484)
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ dedent (1.7.0 → 1.7.1) · [Repo](https://github.com/dmnd/dedent) · [Changelog](https://github.com/dmnd/dedent/blob/main/CHANGELOG.md) ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
46bd8f1a8f |
Update enhanced-resolve 5.18.3 → 5.18.4 (patch) (#19462)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ enhanced-resolve (5.18.3 → 5.18.4) · [Repo](https://github.com/webpack/enhanced-resolve) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/webpack/enhanced-resolve/releases/tag/v5.18.4">5.18.4</a></h4> <blockquote><h3 dir="auto">Fixes</h3> <ul dir="auto"> <li>Allow subpath imports that start with <code class="notranslate">#/</code> </li> <li>Handle <code class="notranslate">file:</code> schema</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/enhanced-resolve/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/webpack/enhanced-resolve/compare/52b61d0f0318318a6e5b3e8c905c887824f9303a...e8a6ac9fdd88d579e20f4c487d6081d8e7b3093f">See the full diff on Github</a>. The new version differs by 6 commits:</p> <ul> <li><a href="https://github.com/webpack/enhanced-resolve/commit/e8a6ac9fdd88d579e20f4c487d6081d8e7b3093f"><code>chore(release): 5.18.4</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/b953768580163f410c3893870f34c3e88c11ada6"><code>fix: support `file:` schema (#467)</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/6ff935b23610868febd0bba7082607ee9085dbe2"><code>fix: allow subpath imports that start with `#/` (#468)</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/79e2961c600527dee81c8ad0fb804529b1d36757"><code>fix(AliasPlugin): correct wildcard replacement in multi-target aliases (#465)</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/b8af8130f0c0a4284861893e18dc12c8af319ca2"><code>fix: fix always-false condition (#464)</code></a></li> <li><a href="https://github.com/webpack/enhanced-resolve/commit/f1bc1c2b0b9d72df7b1eddc099266a65368332f6"><code>fix: note the conditions under which the request couldn't be found (#460)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
4055eeacb5 | Release v4.1.18 (#19431) | ||
|
|
fc650645fe |
Update postcss-selector-parser 7.1.0 → 7.1.1 (patch) (#19408)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ postcss-selector-parser (7.1.0 → 7.1.1) · [Repo](https://github.com/postcss/postcss-selector-parser) · [Changelog](https://github.com/postcss/postcss-selector-parser/blob/master/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/postcss/postcss-selector-parser/releases/tag/v7.1.1">7.1.1</a></h4> <blockquote><h1 dir="auto">7.1.1</h1> <ul dir="auto"> <li>perf: replace startsWith with strict equality (<a href="https://bounce.depfu.com/github.com/postcss/postcss-selector-parser/pull/308">#308</a>)</li> <li>fix(types): add walkUniversal declaration (<a href="https://bounce.depfu.com/github.com/postcss/postcss-selector-parser/pull/311">#311</a>)</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/postcss-selector-parser/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/postcss/postcss-selector-parser/compare/ea6cd9324b4be90a4c529c3602deefbc4a2d7a82...cf6637ed6a2dbc9d24bc3a1d04ec7ac4629dd856">See the full diff on Github</a>. The new version differs by 6 commits:</p> <ul> <li><a href="https://github.com/postcss/postcss-selector-parser/commit/cf6637ed6a2dbc9d24bc3a1d04ec7ac4629dd856"><code>chore(release): 7.1.1</code></a></li> <li><a href="https://github.com/postcss/postcss-selector-parser/commit/54cef58801b32f9c4101cea5b8c7bc0432238466"><code>fix(types): add `walkUniversal` declaration (#311)</code></a></li> <li><a href="https://github.com/postcss/postcss-selector-parser/commit/3da25fecba8110ccda23b69de3b00dde5bd1cd5b"><code>perf: replace startsWith with strict equality (#308)</code></a></li> <li><a href="https://github.com/postcss/postcss-selector-parser/commit/b647f7c70fefa3bdf118229705002b5a886bda34"><code>ci: test on Node.js 24 (#307)</code></a></li> <li><a href="https://github.com/postcss/postcss-selector-parser/commit/337129d1e3174d131717113c2ad131325b72d24e"><code>chore: replace abandoned pkg coveralls with coveralls-next</code></a></li> <li><a href="https://github.com/postcss/postcss-selector-parser/commit/6343f29e08c6fa9c1d2610fb72bf851b1aeffe69"><code>ci: test on Node.js 22 (#301)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
17f211005f |
Improve compatibility with special default values in JS configs (#19348)
Fixes #19345 In v3 the `ringColor.DEFAULT` option was used as the default color for ring utilities (when it was defined). This currently gets translated as `--ring-color` but that doesn't work this way in v4. Instead it should translate to `--default-ring-color` and *not* `--ring-color`. I've also tweaked the upgrade tool to handle this properly as well. |
||
|
|
7659bc90c5 |
Revert "Update globby 15.0.0 → 16.0.0 (major) (#19357)"
This reverts commit
|
||
|
|
7de57584f9 |
Update globby 15.0.0 → 16.0.0 (major) (#19357)
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ globby (15.0.0 → 16.0.0) · [Repo](https://github.com/sindresorhus/globby) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/sindresorhus/globby/releases/tag/v16.0.0">16.0.0</a></h4> <blockquote><h3 dir="auto">Breaking</h3> <ul dir="auto"> <li>Respect parent .gitignore files when <code class="notranslate">gitignore</code> option is enabled <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/b9a9a84c76064378b5a9fca3769efb890ab42bc4"><tt>b9a9a84</tt></a> <ul dir="auto"> <li>When <code class="notranslate">{gitignore: true}</code>, Globby now searches for .gitignore files up to the Git repo root (if detected). This matches Git's actual behavior where parent .gitignore patterns apply to subdirectories. Previously, only .gitignore files within the glob search path were considered. This change could break existing code that relied on the previous, more limited behavior.</li> </ul> </li> </ul> <h3 dir="auto">Improvements</h3> <ul dir="auto"> <li>Support negation-only patterns <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/1273541cca2824bdeff1afc3d1e7995e7f5d04e6"><tt>1273541</tt></a> </li> <li>Respect custom fs implementation from options <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/c2eb2725204be092fe013d6a3f2920b30ac1cc3c"><tt>c2eb272</tt></a> </li> <li>Add some more options to <code class="notranslate">isGitIgnored</code> functions <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/e794ff905affec6dd20b25ede00fd7e3264edbb3"><tt>e794ff9</tt></a> </li> <li>Improve error message for invalid <code class="notranslate">cwd</code> option <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/7535e6d74c9170c188c819bbd55834750c0b9f1d"><tt>7535e6d</tt></a> </li> </ul> <h3 dir="auto">Fixes</h3> <ul dir="auto"> <li>Fix <code class="notranslate">{gitignore: true}</code> performance issue <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/fcb07c390733ec90d939e73ce9d869c696730a02"><tt>fcb07c3</tt></a> </li> <li>Fix bundler compatibility <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/e6c72c9ff8ad41d095032e6cc6e72c29d2339bde"><tt>e6c72c9</tt></a> </li> <li>Fix parent directory patterns with <code class="notranslate">gitignore</code> option <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/11dd2dfae37aaa966a568e10837d973d461b9ead"><tt>11dd2df</tt></a> </li> <li>Fix ignore patterns with parent directory references <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/a58d117b0e37a740096112f1dc133e400e18d835"><tt>a58d117</tt></a> </li> <li>Fix types for <code class="notranslate">stats</code> option <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/c10f600c61941becda43f959eca64d4417e0ed31"><tt>c10f600</tt></a> </li> </ul> <hr> <p dir="auto"><a href="https://bounce.depfu.com/github.com/sindresorhus/globby/compare/v15.0.0...v16.0.0"><tt>v15.0.0...v16.0.0</tt></a></p></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/globby/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/sindresorhus/globby/compare/b65747ec179b2541b0f2269ee5ac539ccc124504...cdbb6a2e661cb6137fdf959700a755393f8ac23f">See the full diff on Github</a>. The new version differs by 22 commits:</p> <ul> <li><a href="https://github.com/sindresorhus/globby/commit/cdbb6a2e661cb6137fdf959700a755393f8ac23f"><code>16.0.0</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/e6c72c9ff8ad41d095032e6cc6e72c29d2339bde"><code>Fix bundler compatibility</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/b9a9a84c76064378b5a9fca3769efb890ab42bc4"><code>Respect parent .gitignore files when `gitignore` option is enabled</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/db9cb722a04cd52edde4725851426c4d1e7d3f53"><code>Add test for `suppressErrors` option with file patterns</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/69e0ee7bbe75cd9b7174607ee6ef0582ce2c49a8"><code>Add test for ignore option with trailing slashes</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/11dd2dfae37aaa966a568e10837d973d461b9ead"><code>Fix parent directory patterns with `gitignore` option</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/e4d09180fb5b856575c7addbcbfdda93823bc34a"><code>Add tests for special characters in directory names</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/f92613260e99e6a61376b79354a3dd3a65ee2ab1"><code>Improve path check in gitignore logic</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/7535e6d74c9170c188c819bbd55834750c0b9f1d"><code>Improve error message for invalid `cwd` option</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/c10f600c61941becda43f959eca64d4417e0ed31"><code>Fix types for `stats` option</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/a58d117b0e37a740096112f1dc133e400e18d835"><code>Fix ignore patterns with parent directory references</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/40022f39278ae7748800090af377d3036164fb42"><code>Improve Windows path documentation</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/1273541cca2824bdeff1afc3d1e7995e7f5d04e6"><code>Support negation-only patterns</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/c2eb2725204be092fe013d6a3f2920b30ac1cc3c"><code>Respect custom fs implementation from options</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/aa694e08474a581ea84df70e06a45aa7c0f4bc6e"><code>Improve docs for `convertPathToPattern`</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/306a82ddc7b0c68ee32d9105b6550d414b5a51dc"><code>Add test for .npmignore in subdirectories</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/9370b3574ec0866361b8418fc37162a7a0a181f1"><code>Clarify `gitignore` priority in documentation</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/c743dad53b1607701c61681c0e5445f4144b90df"><code>Add test for nested gitignore with negation</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/e794ff905affec6dd20b25ede00fd7e3264edbb3"><code>Add some more options to isGitIgnored functions</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/fcb07c390733ec90d939e73ce9d869c696730a02"><code>Fix `{gitignore: true}` performance issue</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/2dee4320b602b05ee03f891b156de40cc4039d62"><code>Add tests for some fast-glob limitations</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/6da24d3e2be13dd4bf77d1d37489af442a0aa221"><code>Add test for gitignore patterns starting with `./` or `../`</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
92eabdef9a |
Bump Vitest to v4 (#19216)
This PR bumps Vitest from v2 to v4. As far as I know we don't use any Vitest specific features in our tests, but had to upgrade the `vitest.workspace.ts` file to a `vitest.config.ts` file instead. The only features we use are the typical `describe`, `it`, `test`, and `expect` functions. The only other part we use is `vi.spyOn` and `vi.fn` but those didn't change in API either. The test shards were removed to prevent errors. Not all suites have enough files / tests to be broken up into 3 parts so Vitest now errors when that happens. ### Test plan 1. All tests should pass in CI. 2. All integration tests should pass in CI. --------- Co-authored-by: Jordan Pittman <[email protected]> |
||
|
|
4ccd9379c4 |
Handle future and experimental config keys during upgrade (#19344)
Fixes #19342 |
||
|
|
df82141adb |
bump turbo (#19179)
The Bun build issue was caused by Turborepo passing through `USERPROFILE` from the env. Probably need to file a bug with Bun: ``` Works: env: USERPROFILE: undefined CWD: `D:\a\tailwindcss\tailwindcss\packages\@tailwindcss-standalone` Fails: env: USERPROFILE: "C:\Users\runneradmin" CWD: `D:\a\tailwindcss\tailwindcss\packages\@tailwindcss-standalone` ``` |
||
|
|
d204802ae6 | Release v4.1.17 (#19272) | ||
|
|
07b0c21c3e | Release 4.1.16 (#19185) | ||
|
|
4c04075629 |
Improve memory usage during canonicalization (#19171)
This PR drastically improves the memory usage when performing canonicalization if you swap out the underlying DesignSystem often. This will be most noticeable in Intellisense. The big issue we had is that we used module scoped Map objects where we cache data based on the DesignSystem. If you then create new design systems (often), then the cache would just keep growing and growing. This PR solves that by essentially storing all the caches on the Design System itself. This way, when you throw away a Design System, all the caches go with it. Another approach would've been to use a WeakMap, but then we would have to make sure that no strong references to the DesignSystem exist anywhere else, otherwise we would still have the same memory issues. Note: make sure to go commit by commit and use `?w=1` to ignore whitespace changes. ## Test plan 1. All existing tests pass Not super sure how to test this as part of the test suite without making it slow But I also don't think that's super necessary either. Here is an experiment I did where I introduce 5 design systems: <img width="1326" height="274" alt="image" src="https://github.com/user-attachments/assets/817025e3-0f5b-44be-949b-54ed08f5b3fb" /> On the current `main` branch, this looks like: <img width="619" height="69" alt="image" src="https://github.com/user-attachments/assets/588ae99b-c978-4c01-bfd1-5cc0725723a8" /> In this PR, the memory usage looks like: <img width="512" height="56" alt="image" src="https://github.com/user-attachments/assets/0052ad21-7b99-4edf-8a14-8ccef52362db" /> The memory usage is stable, but to actually prove that we can still track multiple design systems, let's track them all in a `Set` so garbage collection cannot get rid of the unused design system objects: <img width="847" height="230" alt="image" src="https://github.com/user-attachments/assets/5f044927-3d53-4c15-8145-78eb2b4d6d54" /> Now we're sort of back to the current situation on `main`: <img width="507" height="53" alt="image" src="https://github.com/user-attachments/assets/868c0238-8646-41ce-8151-e0ef6dd17d64" /> |
||
|
|
b6034d42fa | Release 4.1.15 (#19159) | ||
|
|
3d4fdf691b |
Generalize the walk implementation (#19126)
This PR generalizes the `walk` implementations we have. What's important
here is that we currently have multiple `walk` implementations, one for
the AST, one for the `SelectorParser`, one for the `ValueParser`.
Sometimes, we also need to go up the tree in a depth-first manner. For
that, we have `walkDepth` implementations.
The funny thing is, all these implementations are very very similar,
even the kinds of trees are very similar. They are just objects with
`nodes: []` as children.
So this PR introduces a generic `walk` function that can work on all of
these trees.
There are also some situations where you need to go down and back up the
tree. For this reason, we added an `enter` and `exit` phase:
```ts
walk(ast, {
enter(node, ctx) {},
exit(node, ctx) {},
})
```
This means that you don't need to `walk(ast)` and later `walkDepth(ast)`
in case you wanted to do something _after_ visiting all nodes.
The API of these walk functions also slightly changed to fix some
problems we've had before. One is the `replaceWith` function. You could
technically call it multiple times, but that doesn't make sense so
instead you always have to return an explicit `WalkAction`. The
possibilities are:
```ts
// The ones we already had
WalkAction.Continue // Continue walking as normal, the default behavior
WalkAction.Skip // Skip walking the `nodes` of the current node
WalkAction.Stop // Stop the entire walk
// The new ones
WalkAction.Replace(newNode) // Replace the current node, and continue walking the new node(s)
WalkAction.ReplaceSkip(newNode) // Replace the current node, but don't walk the new node(s)
WalkAction.ReplaceStop(newNode) // Replace the current node, but stop the entire walk
```
To make sure that we can walk in both directions, and to make sure we
have proper control over when to walk which nodes, the `walk` function
is implemented in an iterative manner using a stack instead of
recursion.
This also means that a `WalkAction.Stop` or `WalkAction.ReplaceStop`
will immediately stop the walk, without unwinding the entire call stack.
Some notes:
- The CSS AST does have `context` nodes, for this we can build up the
context lazily when we need it. I added a `cssContext(ctx)` that gives
you an enhanced context including the `context` object that you can read
information from.
- The second argument of the `walk` function can still be a normal
function, which is equivalent to `{ enter: fn }`.
Let's also take a look at some numbers. With this new implementation,
each `walk` is roughly ~1.3-1.5x faster than before. If you look at the
memory usage (especially in Bun) we go from `~2.2GB` peak memory usage,
to `~300mb` peak memory usage.
Some benchmarks on small and big trees (M1 Max):
<img width="2062" height="1438" alt="image"
src="https://github.com/user-attachments/assets/5ec8c22a-9de8-4e08-869a-18c0d30eb7e8"
/>
<img width="2062" height="1246" alt="image"
src="https://github.com/user-attachments/assets/e89d4b8e-29ca-4aee-8fd2-b7c043d3bbf4"
/>
We also ran some benchmarks on @thecrypticace's M3 Max:
<img width="1598" height="1452" alt="image"
src="https://github.com/user-attachments/assets/3b06b6fe-2497-4f24-a428-1a0e2af3896a"
/>
In node the memory difference isn't that big, but the performance itself
is still better:
<img width="2034" height="1586" alt="image"
src="https://github.com/user-attachments/assets/ef28ae14-b53e-4912-9621-531f3b02898f"
/>
In summary:
1. Single `walk` implementation for multiple use cases
2. Support for `enter` and `exit` phases
3. New `WalkAction` possibilities for better control
4. Overall better performance
5. ... and lower memory usage
## Test plan
1. All tests still pass (but had to adjust some of the APIs if `walk`
was used inside tests).
2. Added new tests for the `walk` implementation
3. Ran local benchmarks to verify the performance improvements
|
||
|
|
3a2eece281 | Update semver to version 7.7.3 | ||
|
|
4e47ce4880 | Canonicalize dimensions (#19101) | ||
|
|
2367e6494b |
Canonicalization constant folding and handling zeros (#19095)
The main goal of this PR was to support canonicalization of zero like values. We essentially want to canonicalize `-mt-0` as `mt-0`, but also `mt-[0px]`, `mt-[0rem]`, and other length-like units to just `mt-0`. To do this, we had to handle 2 things: 1. We introduced some more constant folding, including making `0px` and `0rem` fold to `0`. We only do this for length units. We also normalize `-0`, `+0`, `-0.0` and so on to `0`. 2. While pre-computing utilities in our lookup table, we make sure that we prefer `mt-0` over `-mt-0` if both result in the same signature. Moved some of the constant folding logic into its own function and added a bunch of separate tests for it. ## Test plan Added more unit tests where we normalize different zero-like values to `0`. Running the canonicalization logic: ```js designSystem.canonicalizeCandidates([ '-m-0', '-m-[-0px]', '-m-[-0rem]', '-m-[0px]', '-m-[0rem]', 'm-0', 'm-[-0px]', 'm-[-0rem]', 'm-[0px]', 'm-[0rem]', 'm-[calc(var(--spacing)*0)]', 'm-[--spacing(0)]', 'm-[--spacing(0.0)]', 'm-[+0]', 'm-[-0]', '-m-[-0]', '-m-[+0]', ]) // → ['m-0'] ``` --------- Co-authored-by: Jordan Pittman <[email protected]> |
||
|
|
4137348b5e |
Fix resolving colors via theme(…) in compat mode with nested objects (#19097)
This PR fixes an issue when loading (nested) colors from a config file
and later referencing it via the `theme(…)` function in CSS.
Given a config like this:
```js
module.exports = {
theme: {
colors: {
foo: 'var(--foo-foo)',
'foo-bar': 'var(--foo-foo-bar)',
},
},
}
```
We internally map this into the design system. The issue here is that
the `foo` and `foo-bar` are overlapping and it behaves more like this:
```js
{
foo: {
DEFAULT: 'var(--foo-foo)',
bar: 'var(--foo-foo-bar)'
},
}
```
So while we can easily resolve `colors.foo-bar`, the `colors.foo` would
result in the object with a `DEFAULT` key. This PR solves that by using
the `DEFAULT` key if we end up with an object that has it.
If you end up resolving an object (`theme(colors)`) then the behavior is
unchanged.
## Test plan
1. Added a test based on the config in the issue (which failed before
this fix).
2. Also simplified the test case after identifying the problem (with the
`DEFAULT` key).
Fixes: #19091
|
||
|
|
6ae141c9d1 |
Improve performance of cloning AST nodes (#19067)
This PR improves the performance of when we need to clone some AST
nodes. We have a few places where we clone `Candidate`, `Variant` and
CSS `AST` nodes.
Right now we use `structuredClone`, which works, but it is a generic
solution. However, we do know the exact structure of these AST nodes, so
we can write specialized clone functions that are much faster.
## Test plan
1. All the tests still pass with this change
2. The performance is better:
```
cloneCandidate - src/candidate.bench.ts > Candidate cloning
1.72x faster than cloneCandidate (spread)
74.03x faster than structuredClone
cloneAstNode() - src/ast.bench.ts > Cloning AST nodes
1.15x faster than cloneAstNode (with spread)
33.54x faster than structuredClone()
```
Ready for review, but should be merged after #19059
|
||
|
|
51d09f6176 |
Introduce canonicalizeCandidates on the internal Design System (#19059)
This PR introduces a new `canonicalizeCandidates` function on the internal Design System. The big motivation to moving this to the core `tailwindcss` package is that we can use this in various places: - The Raycast extension - The VS Code extension / language server - 3rd party tools that use the Tailwind CSS design system APIs > This PR looks very big, but **I think it's best to go over the changes commit by commit**. Basically all of these steps already existed in the upgrade tool, but are now moved to our core `tailwindcss` package. Here is a list of all the changes: - Added a new `canonicalizeCandidates` function to the design system - Moved various migration steps to the core package. I inlined them in the same file and because of that I noticed a specific pattern (more on this later). - Moved `printCandidate` tests to the `tailwindcss` package - Setup tests for `canonicalizeCandidates` based on the existing tests in the upgrade tool. I noticed that all the migrations followed a specific pattern: 1. Parse the raw candidate into a `Candidate[]` AST 2. In a loop, try to migrate the `Candidate` to a new `Candidate` (this often handled both the `Candidate` and its `Variant[]`) 3. If something changed, print the new `Candidate` back to a string, and pass it to the next migration step. While this makes sense in isolation, we are doing a lot of repeated work by parsing, modifying, and printing the candidate multiple times. This let me to introduce the `big refactor` commit. This changes the steps to: 1. Up front, parse the raw candidate into a `Candidate[]` _once_. 2. Strip the variants and the important marker from the candidate. This means that each migration step only has to deal with the base `utility` and not care about the variants or the important marker. We can re-attach these afterwards. 3. Instead of a `rawCandidate: string`, each migration step receives an actual `Candidate` object (or a `Variant` object). 4. I also split up the migration steps for the `Candidate` and the `Variant[]`. All of this means that there is a lot less work that needs to be done. We can also cache results between migrations. So `[@media_print]:flex` and `[@media_print]:block` will result in `print:flex` and `print:block` respectively, but the `[@media_print]` part is only migrated once across both candidates. One migration step relied on the `postcss-selector-parser` package to parse selectors and attribute selectors. I didn't want to introduce a package just for this, so instead used our own `SelectorParser` in the migration and wrote a small `AttributeSelectorParser` that can parse the attribute selector into a little data structure we can work with instead. If we want, we can split this PR up into smaller pieces, but since the biggest chunk is moving existing code around, I think it's fairly doable to review as long as you go commit by commit. --- With this new API, we can turn: ``` [ 'bg-red-500', 'hover:bg-red-500', '[@media_print]:bg-red-500', 'hover:[@media_print]:bg-red-500', 'bg-red-500/100', 'hover:bg-red-500/100', '[@media_print]:bg-red-500/100', 'hover:[@media_print]:bg-red-500/100', 'bg-[var(--color-red-500)]', 'hover:bg-[var(--color-red-500)]', '[@media_print]:bg-[var(--color-red-500)]', 'hover:[@media_print]:bg-[var(--color-red-500)]', 'bg-[var(--color-red-500)]/100', 'hover:bg-[var(--color-red-500)]/100', '[@media_print]:bg-[var(--color-red-500)]/100', 'hover:[@media_print]:bg-[var(--color-red-500)]/100', 'bg-(--color-red-500)', 'hover:bg-(--color-red-500)', '[@media_print]:bg-(--color-red-500)', 'hover:[@media_print]:bg-(--color-red-500)', 'bg-(--color-red-500)/100', 'hover:bg-(--color-red-500)/100', '[@media_print]:bg-(--color-red-500)/100', 'hover:[@media_print]:bg-(--color-red-500)/100', 'bg-[color:var(--color-red-500)]', 'hover:bg-[color:var(--color-red-500)]', '[@media_print]:bg-[color:var(--color-red-500)]', 'hover:[@media_print]:bg-[color:var(--color-red-500)]', 'bg-[color:var(--color-red-500)]/100', 'hover:bg-[color:var(--color-red-500)]/100', '[@media_print]:bg-[color:var(--color-red-500)]/100', 'hover:[@media_print]:bg-[color:var(--color-red-500)]/100', 'bg-(color:--color-red-500)', 'hover:bg-(color:--color-red-500)', '[@media_print]:bg-(color:--color-red-500)', 'hover:[@media_print]:bg-(color:--color-red-500)', 'bg-(color:--color-red-500)/100', 'hover:bg-(color:--color-red-500)/100', '[@media_print]:bg-(color:--color-red-500)/100', 'hover:[@media_print]:bg-(color:--color-red-500)/100', '[background-color:var(--color-red-500)]', 'hover:[background-color:var(--color-red-500)]', '[@media_print]:[background-color:var(--color-red-500)]', 'hover:[@media_print]:[background-color:var(--color-red-500)]', '[background-color:var(--color-red-500)]/100', 'hover:[background-color:var(--color-red-500)]/100', '[@media_print]:[background-color:var(--color-red-500)]/100', 'hover:[@media_print]:[background-color:var(--color-red-500)]/100' ] ``` Into their canonicalized form: ``` [ 'bg-red-500', 'hover:bg-red-500', 'print:bg-red-500', 'hover:print:bg-red-500' ] ``` The list is also unique, so we won't end up with `bg-red-500 bg-red-500` twice. While the canonicalization itself is fairly fast, we still pay a **~1s** startup cost for some migrations (once, and cached for the entire lifetime of the design system). I would like to keep improving the performance and the kinds of migrations we do, but I think this is a good start. The cost we pay is for: 1. Generating a full list of all possible utilities based on the `getClassList` suggestions API. 2. Generating a full list of all possible variants. The canonicalization step for this list takes **~2.9ms** on my machine. Just for fun, if you use the `getClassList` API for intellisense that generates all the suggestions and their modifiers, you get a list of **263788** classes. If you canonicalize all of these, it takes **~500ms** in total. So roughly **~1.9μs** per candidate. This new API doesn't result in a performance difference for normal Tailwind CSS builds. The other potential concern is file size of the package. The generated `tailwindcss.tgz` file changed like this: ```diff - 684652 bytes (684.65 kB) + 749169 bytes (749.17 kB) ``` So the package increased by ~65 kB which I don't think is the end of the world, but it is important for the `@tailwindcss/browser` build which we don't want to grow unnecessarily. For this reason we remove some of the code for the design system conditionally such that you don't pay this cost in an environment where you will never need this API. The `@tailwindcss/browser` build looks like this: ```shell `dist/index.global.js 255.14 KB` (main) `dist/index.global.js 272.61 KB` (before this change) `dist/index.global.js 252.83 KB` (after this change, even smaller than on `main`) ``` |
||
|
|
61ebaee72b |
Update globby 14.1.0 → 15.0.0 (major) (#19056)
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ globby (14.1.0 → 15.0.0) · [Repo](https://github.com/sindresorhus/globby) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/sindresorhus/globby/releases/tag/v15.0.0">15.0.0</a></h4> <blockquote><h3 dir="auto">Breaking</h3> <ul dir="auto"> <li>Require Node.js 20 <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/4ae42c8bbd84676f219e37573a986b59c2c3877b"><tt>4ae42c8</tt></a> </li> </ul> <h3 dir="auto">Fixes</h3> <ul dir="auto"> <li>Fix <code class="notranslate">expandDirectories</code> not working with globstar patterns <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/98d691ad73b3b6aca77d4f5706a04799d0e39790"><tt>98d691a</tt></a> </li> <li>Fix relative paths with gitignore option <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/b4d78d80398f6793a0a2d241525f5ed00c74a6b7"><tt>b4d78d8</tt></a> </li> <li>Fix gitignore patterns in subdirectories not applying recursively <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/2cb6088a0a4c45b2687c8c5c181fcd12f7dc2c63"><tt>2cb6088</tt></a> </li> <li>Fix TypeScript types for <code class="notranslate">globbyStream</code> to correctly yield strings <a href="https://bounce.depfu.com/github.com/sindresorhus/globby/commit/1c7f3ed116f8c62b69378cb084a3b9922d507722"><tt>1c7f3ed</tt></a> </li> </ul> <hr> <p dir="auto"><a href="https://bounce.depfu.com/github.com/sindresorhus/globby/compare/v14.1.0...v15.0.0"><tt>v14.1.0...v15.0.0</tt></a></p></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/globby/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/sindresorhus/globby/compare/60d7de54476f9ba9734c1b6923fba39d6589de5f...b65747ec179b2541b0f2269ee5ac539ccc124504">See the full diff on Github</a>. The new version differs by 7 commits:</p> <ul> <li><a href="https://github.com/sindresorhus/globby/commit/b65747ec179b2541b0f2269ee5ac539ccc124504"><code>15.0.0</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/4ae42c8bbd84676f219e37573a986b59c2c3877b"><code>Require Node.js 20</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/98d691ad73b3b6aca77d4f5706a04799d0e39790"><code>Fix `expandDirectories` not working with globstar patterns</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/b4d78d80398f6793a0a2d241525f5ed00c74a6b7"><code>Fix relative paths with gitignore option</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/2cb6088a0a4c45b2687c8c5c181fcd12f7dc2c63"><code>Fix gitignore patterns in subdirectories not applying recursively</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/0a4df0eeeded8cdbfaae0db2612cfd446e26ed53"><code>Document performance implications of `gitignore` option</code></a></li> <li><a href="https://github.com/sindresorhus/globby/commit/1c7f3ed116f8c62b69378cb084a3b9922d507722"><code>Fix TypeScript types for `globbyStream` to correctly yield strings</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> |
||
|
|
98d96020bc |
Prepare v4.1.14 release (#19037)
Co-authored-by: Robin Malfait <[email protected]> |
||
|
|
b0feff98ec |
Ensure first class inside className in React is migrated (#19031)
### 1. Handling React className migration The PR fixes an issue when migrating React components to tailwind v4 with the migration tool, that the first class after `className="` is ignored. For example, when migrating ```JSX <div className="shadow"></div> ``` `shadow` will not be migrated to `shadow-sm` . This is because in `is-safe-migration.ts`, it tests the line before candidate with regex `/(?<!:?class)=['"]$/`. This basically skips the migration for anything like `foo="shadow"`, with only exception for Vue (eg. `class="shadow"`). The PR changes the regex from ```regex /(?<!:?class)=['"]$/ ```` to ```regex /(?<!:?class|className)=['"]$/ ``` which essentially adds a new exception specifically for React's `className="shadow"` case. ### 2. Removing redundant rules Besides, I found that several other rules in `CONDITIONAL_TEMPLATE_SYNTAX` being redundant since they are already covered by the rule above, so I removed them. If we prefer the previous explicit approach, I can revert it. ## Test plan <!-- Explain how you tested your changes. Include the exact commands that you used to verify the change works and include screenshots/screen recordings of the update behavior in the browser if applicable. --> Tests added for both the Vue and React classes to prevent false negative cases. --------- Co-authored-by: Jordan Pittman <[email protected]> |