Skip to content

Commit c281426

Browse files
committed
drop unnecessary calls
The the scenario of creating signatures for a component, we always want to respect the important flag if it is given. Therefore I think that we can drop the `designSystem.compileAstNodes(candidate, CompileAstFlags.None)` which saves us some time. Also removed the `structuredClone` call. Whenever we handle `@apply` which essentially happened the step before, we already start from a cloned node internally. This call just meant we were doing it again.
1 parent c956b08 commit c281426

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

packages/tailwindcss/src/signatures.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,12 @@ export const computeUtilitySignature = new DefaultMap<
4444
// There's separate utility caches for respect important vs not
4545
// so we want to compile them both with `@theme inline` disabled
4646
for (let candidate of designSystem.parseCandidate(utility)) {
47-
designSystem.compileAstNodes(candidate, CompileAstFlags.None)
4847
designSystem.compileAstNodes(candidate, CompileAstFlags.RespectImportant)
4948
}
5049

5150
substituteAtApply(ast, designSystem)
5251
})
5352

54-
// We will be mutating the AST, so we need to clone it first to not affect
55-
// the original AST
56-
ast = structuredClone(ast)
57-
5853
// Optimize the AST. This is needed such that any internal intermediate
5954
// nodes are gone. This will also cleanup declaration nodes with undefined
6055
// values or `--tw-sort` declarations.

0 commit comments

Comments
 (0)