Skip to content

Commit d12cc7d

Browse files
authored
Fix bug with implicit configuration for nested imports (#2658)
Actually fixes #2641
1 parent 340bfd2 commit d12cc7d

File tree

9 files changed

+37
-20
lines changed

9 files changed

+37
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.97.2
2+
3+
* Additional fixes for implicit configuration when nested imports are involved.
4+
15
## 1.97.1
26

37
* Fix a bug with the new CSS-style `if()` syntax where values would be evaluated

lib/src/async_environment.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ final class AsyncEnvironment {
223223
{},
224224
_importedModules,
225225
null,
226-
null,
226+
_nestedForwardedModules,
227227
[],
228228
_variables.toList(),
229229
_variableNodes.toList(),
@@ -834,13 +834,15 @@ final class AsyncEnvironment {
834834
/// environment.
835835
Configuration toImplicitConfiguration() {
836836
var configuration = <String, ConfiguredValue>{};
837-
for (var module in _importedModules.keys) {
838-
for (var (name, value) in module.variables.pairs) {
839-
configuration[name] =
840-
ConfiguredValue.implicit(value, module.variableNodes[name]!);
841-
}
842-
}
843837
for (var i = 0; i < _variables.length; i++) {
838+
var modules =
839+
i == 0 ? _importedModules.keys : _nestedForwardedModules?[i - 1];
840+
for (var module in modules ?? const <Module>[]) {
841+
for (var (name, value) in module.variables.pairs) {
842+
configuration[name] =
843+
ConfiguredValue.implicit(value, module.variableNodes[name]!);
844+
}
845+
}
844846
var values = _variables[i];
845847
var nodes = _variableNodes[i];
846848
for (var (name, value) in values.pairs) {

lib/src/deprecation.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enum Deprecation {
1515
// DO NOT EDIT. This section was generated from the language repo.
1616
// See tool/grind/generate_deprecations.dart for details.
1717
//
18-
// Checksum: 81dd840fe9e83020c1fd88a91e46f49b16190c76
18+
// Checksum: 6fc524360d067b73c243c666e27a9a9ea7e08841
1919

2020
/// Deprecation for passing a string directly to meta.call().
2121
callString('call-string',
@@ -88,6 +88,7 @@ enum Deprecation {
8888
/// Deprecation for function and mixin names beginning with --.
8989
cssFunctionMixin('css-function-mixin',
9090
deprecatedIn: '1.76.0',
91+
obsoleteIn: '1.94.0',
9192
description: 'Function and mixin names beginning with --.'),
9293

9394
/// Deprecation for declarations after or between nested rules.

lib/src/environment.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_environment.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 608af187f35a7483a87d8a54e97793e776ba215c
8+
// Checksum: 1a3e8a246997bac547c2c15e5c191aac2132cc5b
99
//
1010
// ignore_for_file: unused_import
1111

@@ -230,7 +230,7 @@ final class Environment {
230230
{},
231231
_importedModules,
232232
null,
233-
null,
233+
_nestedForwardedModules,
234234
[],
235235
_variables.toList(),
236236
_variableNodes.toList(),
@@ -842,13 +842,15 @@ final class Environment {
842842
/// environment.
843843
Configuration toImplicitConfiguration() {
844844
var configuration = <String, ConfiguredValue>{};
845-
for (var module in _importedModules.keys) {
846-
for (var (name, value) in module.variables.pairs) {
847-
configuration[name] =
848-
ConfiguredValue.implicit(value, module.variableNodes[name]!);
849-
}
850-
}
851845
for (var i = 0; i < _variables.length; i++) {
846+
var modules =
847+
i == 0 ? _importedModules.keys : _nestedForwardedModules?[i - 1];
848+
for (var module in modules ?? const <Module<Callable>>[]) {
849+
for (var (name, value) in module.variables.pairs) {
850+
configuration[name] =
851+
ConfiguredValue.implicit(value, module.variableNodes[name]!);
852+
}
853+
}
852854
var values = _variables[i];
853855
var nodes = _variableNodes[i];
854856
for (var (name, value) in values.pairs) {

pkg/sass-parser/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.41
2+
3+
* No user-visible changes.
4+
15
## 0.4.40
26

37
* No user-visible changes.

pkg/sass-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-parser",
3-
"version": "0.4.40",
3+
"version": "0.4.41",
44
"description": "A PostCSS-compatible wrapper of the official Sass parser",
55
"repository": "sass/dart-sass",
66
"author": "Google Inc.",

pkg/sass_api/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 17.3.2
2+
3+
* No user-visible changes.
4+
15
## 17.3.1
26

37
* No user-visible changes.

pkg/sass_api/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: sass_api
22
# Note: Every time we add a new Sass AST node, we need to bump the *major*
33
# version because it's a breaking change for anyone who's implementing the
44
# visitor interface(s).
5-
version: 17.3.1
5+
version: 17.3.2
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

99
environment:
1010
sdk: ">=3.6.0 <4.0.0"
1111

1212
dependencies:
13-
sass: 1.97.1
13+
sass: 1.97.2
1414

1515
dev_dependencies:
1616
dartdoc: ">=8.0.14 <10.0.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.97.1
2+
version: 1.97.2
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)