Make `cloneCss() clone modules that transitively contain CSS (#1824)

Previously we were only cloning modules that directly contained CSS,
but this created a problem where extensions could be added to their
*shared* extension store across `load-css()` boundaries and thereby
applied to upstream CSS.

Closes #3322
This commit is contained in:
Natalie Weizenbaum 2022-11-03 16:11:36 -07:00 committed by GitHub
parent 44d6bb6ac7
commit 00c351746e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -51,6 +51,10 @@
* Properly mark the warning for passing numbers with units to `random()` as a
deprecation warning.
* Fix a bug where `@extend` could behave unpredicatably when used along with
`meta.load-css()` and shared modules that contained no CSS themselves but
loaded CSS from other modules.
### Dart API
* Emit a deprecation warning when passing a `sassIndex` with units to

View File

@ -1014,7 +1014,7 @@ class _EnvironmentModule implements Module {
}
Module cloneCss() {
if (css.children.isEmpty) return this;
if (!transitivelyContainsCss) return this;
var newCssAndExtensionStore = cloneCssStylesheet(css, extensionStore);
return _EnvironmentModule._(

View File

@ -5,7 +5,7 @@
// DO NOT EDIT. This file was generated from async_environment.dart.
// See tool/grind/synchronize.dart for details.
//
// Checksum: 88f81b417129a74e4eb776d518c8e019dbf2ec36
// Checksum: 38c688423116df1e489aa6eafc16de1bf9bc2bf5
//
// ignore_for_file: unused_import
@ -1022,7 +1022,7 @@ class _EnvironmentModule implements Module<Callable> {
}
Module<Callable> cloneCss() {
if (css.children.isEmpty) return this;
if (!transitivelyContainsCss) return this;
var newCssAndExtensionStore = cloneCssStylesheet(css, extensionStore);
return _EnvironmentModule._(