From f01d79f76bfa5934cb6ef4bcee4c87a2b8a267f4 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 11 Jan 2019 13:07:20 -0500 Subject: [PATCH] Add a comment to explain performance optimization --- src/processTailwindFeatures.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/processTailwindFeatures.js b/src/processTailwindFeatures.js index 8b6af360d..778571a09 100644 --- a/src/processTailwindFeatures.js +++ b/src/processTailwindFeatures.js @@ -23,6 +23,15 @@ export default function(getConfig) { substituteResponsiveAtRules(config), substituteScreenAtRules(config), substituteClassApplyAtRules(config, processedPlugins.utilities), + + // This quick plugin is necessary to avoid a serious performance + // hit due to nodes created by postcss-js having an empty `raws` + // value, and PostCSS not providing a default `raws.semicolon` + // value. This turns determining what value to use there into an + // O(n) operation instead of an O(1) operation. + // + // The latest version of PostCSS 7.x has this patched internally, + // but patching from userland until we upgrade from v6 to v7. function(root) { root.rawCache = { colon: ': ',