Skip to content

Commit f01d79f

Browse files
committed
Add a comment to explain performance optimization
1 parent 5ade923 commit f01d79f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/processTailwindFeatures.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ export default function(getConfig) {
2323
substituteResponsiveAtRules(config),
2424
substituteScreenAtRules(config),
2525
substituteClassApplyAtRules(config, processedPlugins.utilities),
26+
27+
// This quick plugin is necessary to avoid a serious performance
28+
// hit due to nodes created by postcss-js having an empty `raws`
29+
// value, and PostCSS not providing a default `raws.semicolon`
30+
// value. This turns determining what value to use there into an
31+
// O(n) operation instead of an O(1) operation.
32+
//
33+
// The latest version of PostCSS 7.x has this patched internally,
34+
// but patching from userland until we upgrade from v6 to v7.
2635
function(root) {
2736
root.rawCache = {
2837
colon: ': ',

0 commit comments

Comments
 (0)