forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance improvements + memory leak fix (tailwindlabs#3032)
* fix memory leak * add optional condition to hasAtRule * use known tree to handle `@apply` when required `@tailwind` at rules exists Otherwise we will generate the lookup tree. * only generate the missing `@tailwind` atrules when using `@apply` * update perf config to reflect 2.0 changes * update changelog * ensure lookup tree is correctly cached based on used tailwind atrules
- Loading branch information
1 parent
f12458a
commit eac11cf
Showing
7 changed files
with
125 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export function disposables() { | ||
let disposables = [] | ||
|
||
let api = { | ||
add(cb) { | ||
disposables.push(cb) | ||
|
||
return () => { | ||
let idx = disposables.indexOf(cb) | ||
if (idx !== -1) disposables.splice(idx, 1) | ||
} | ||
}, | ||
dispose() { | ||
disposables.splice(0).forEach((dispose) => dispose()) | ||
}, | ||
} | ||
|
||
return api | ||
} | ||
|
||
// A shared disposables collection | ||
export let shared = disposables() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters