@tailwindcss/jit
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -12,2 +12,9 @@ # Changelog | ||
## [0.1.7] - 2021-03-22 | ||
### Fixed | ||
- Clone nodes to prevent bugs related to rule cache mutation ([#141](https://github.com/tailwindlabs/tailwindcss-jit/pull/141)) | ||
## [0.1.6] - 2021-03-22 | ||
@@ -67,3 +74,4 @@ | ||
[unreleased]: https://github.com/tailwindlabs/tailwindcss-jit/compare/v0.1.6...HEAD | ||
[unreleased]: https://github.com/tailwindlabs/tailwindcss-jit/compare/v0.1.7...HEAD | ||
[0.1.7]: https://github.com/tailwindlabs/tailwindcss-jit/compare/v0.1.6...v0.1.7 | ||
[0.1.6]: https://github.com/tailwindlabs/tailwindcss-jit/compare/v0.1.5...v0.1.6 | ||
@@ -70,0 +78,0 @@ [0.1.5]: https://github.com/tailwindlabs/tailwindcss-jit/compare/v0.1.4...v0.1.5 |
{ | ||
"name": "@tailwindcss/jit", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -5,3 +5,3 @@ const fs = require('fs') | ||
const { generateRules } = require('./generateRules') | ||
const { bigSign } = require('./utils') | ||
const { bigSign, cloneNodes } = require('./utils') | ||
@@ -183,3 +183,3 @@ let env = sharedState.env | ||
if (layerNodes.base) { | ||
layerNodes.base.before([...baseNodes]) | ||
layerNodes.base.before(cloneNodes([...baseNodes])) | ||
layerNodes.base.remove() | ||
@@ -189,3 +189,3 @@ } | ||
if (layerNodes.components) { | ||
layerNodes.components.before([...componentNodes]) | ||
layerNodes.components.before(cloneNodes([...componentNodes])) | ||
layerNodes.components.remove() | ||
@@ -195,3 +195,3 @@ } | ||
if (layerNodes.utilities) { | ||
layerNodes.utilities.before([...utilityNodes]) | ||
layerNodes.utilities.before(cloneNodes([...utilityNodes])) | ||
layerNodes.utilities.remove() | ||
@@ -201,6 +201,6 @@ } | ||
if (layerNodes.screens) { | ||
layerNodes.screens.before([...screenNodes]) | ||
layerNodes.screens.before(cloneNodes([...screenNodes])) | ||
layerNodes.screens.remove() | ||
} else { | ||
root.append([...screenNodes]) | ||
root.append(cloneNodes([...screenNodes])) | ||
} | ||
@@ -207,0 +207,0 @@ |
@@ -87,2 +87,14 @@ const postcss = require('postcss') | ||
/** | ||
* Clone generated and/or cached nodes to ensure no future | ||
* postcss plugins can mutate the rules and mess up our cache | ||
* | ||
* NOTE: Only clone the nodes you pass to root.append() | ||
* | ||
* @param {import('postcss').Node[]} nodes | ||
* */ | ||
function cloneNodes(nodes) { | ||
return nodes.map((node) => node.clone()) | ||
} | ||
module.exports = { | ||
@@ -95,2 +107,3 @@ toPostCssNode, | ||
nameClass, | ||
cloneNodes, | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244761
7013