From 41f5e1fc5f98fbdcb21e44181003b407df87874c Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 27 Oct 2025 09:16:55 -0700 Subject: [PATCH] Stop holding onto stack traces for every CSS declaration Closes #2663 --- CHANGELOG.md | 4 ++++ lib/src/ast/css/declaration.dart | 7 ------- lib/src/ast/css/modifiable/declaration.dart | 3 --- lib/src/visitor/async_evaluate.dart | 1 - lib/src/visitor/evaluate.dart | 3 +-- pkg/sass-parser/CHANGELOG.md | 4 ++++ pkg/sass-parser/package.json | 2 +- pkg/sass_api/CHANGELOG.md | 4 ++++ pkg/sass_api/pubspec.yaml | 4 ++-- pubspec.yaml | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68f510e21..fa81ef2f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.93.3 + +* Fix a performance regression that was introduced in 1.92.0. + ## 1.93.2 * No user-visible changes. diff --git a/lib/src/ast/css/declaration.dart b/lib/src/ast/css/declaration.dart index 1c7f4cfa3..4d5e906cd 100644 --- a/lib/src/ast/css/declaration.dart +++ b/lib/src/ast/css/declaration.dart @@ -3,7 +3,6 @@ // https://opensource.org/licenses/MIT. import 'package:source_span/source_span.dart'; -import 'package:stack_trace/stack_trace.dart'; import '../../value.dart'; import 'node.dart'; @@ -17,12 +16,6 @@ abstract interface class CssDeclaration implements CssNode { /// The value of this declaration. CssValue get value; - /// The stack trace indicating where this node was created. - /// - /// This is used to emit interleaved declaration warnings, and is only set if - /// [interleavedRules] isn't empty. - Trace? get trace; - /// The span for [value] that should be emitted to the source map. /// /// When the declaration's expression is just a variable, this is the span diff --git a/lib/src/ast/css/modifiable/declaration.dart b/lib/src/ast/css/modifiable/declaration.dart index 90660b279..e5b0945e1 100644 --- a/lib/src/ast/css/modifiable/declaration.dart +++ b/lib/src/ast/css/modifiable/declaration.dart @@ -3,7 +3,6 @@ // https://opensource.org/licenses/MIT. import 'package:source_span/source_span.dart'; -import 'package:stack_trace/stack_trace.dart'; import '../../../value.dart'; import '../../../visitor/interface/modifiable_css.dart'; @@ -17,7 +16,6 @@ final class ModifiableCssDeclaration extends ModifiableCssNode final CssValue name; final CssValue value; final bool parsedAsCustomProperty; - final Trace? trace; final FileSpan valueSpanForMap; final FileSpan span; @@ -29,7 +27,6 @@ final class ModifiableCssDeclaration extends ModifiableCssNode this.value, this.span, { required this.parsedAsCustomProperty, - this.trace, FileSpan? valueSpanForMap, }) : valueSpanForMap = valueSpanForMap ?? value.span { if (parsedAsCustomProperty) { diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index 1041ffff7..4c28c8eaf 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -1371,7 +1371,6 @@ final class _EvaluateVisitor CssValue(value, expression.span), node.span, parsedAsCustomProperty: node.isCustomProperty, - trace: _stackTrace(node.span), valueSpanForMap: _sourceMap ? node.value.andThen(_expressionNode)?.span : null, ), diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index 82802e74f..d9ec596bf 100644 --- a/lib/src/visitor/evaluate.dart +++ b/lib/src/visitor/evaluate.dart @@ -5,7 +5,7 @@ // DO NOT EDIT. This file was generated from async_evaluate.dart. // See tool/grind/synchronize.dart for details. // -// Checksum: b79ed685f78b8d5356795eb2d1112f830abaf58e +// Checksum: 02a6149a29eca1d21306e9582a6b7df86f4cd2f2 // // ignore_for_file: unused_import @@ -1379,7 +1379,6 @@ final class _EvaluateVisitor CssValue(value, expression.span), node.span, parsedAsCustomProperty: node.isCustomProperty, - trace: _stackTrace(node.span), valueSpanForMap: _sourceMap ? node.value.andThen(_expressionNode)?.span : null, ), diff --git a/pkg/sass-parser/CHANGELOG.md b/pkg/sass-parser/CHANGELOG.md index f3661143a..fad954c13 100644 --- a/pkg/sass-parser/CHANGELOG.md +++ b/pkg/sass-parser/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.32 + +* No user-visible changes. + ## 0.4.31 * No user-visible changes. diff --git a/pkg/sass-parser/package.json b/pkg/sass-parser/package.json index 561931527..2512d3950 100644 --- a/pkg/sass-parser/package.json +++ b/pkg/sass-parser/package.json @@ -1,6 +1,6 @@ { "name": "sass-parser", - "version": "0.4.31", + "version": "0.4.32", "description": "A PostCSS-compatible wrapper of the official Sass parser", "repository": "sass/sass", "author": "Google Inc.", diff --git a/pkg/sass_api/CHANGELOG.md b/pkg/sass_api/CHANGELOG.md index b5626bbe6..9de3d228b 100644 --- a/pkg/sass_api/CHANGELOG.md +++ b/pkg/sass_api/CHANGELOG.md @@ -1,3 +1,7 @@ +## 15.12.3 + +* No user-visible changes. + ## 15.12.2 * No user-visible changes. diff --git a/pkg/sass_api/pubspec.yaml b/pkg/sass_api/pubspec.yaml index 1e4eda01a..c35464512 100644 --- a/pkg/sass_api/pubspec.yaml +++ b/pkg/sass_api/pubspec.yaml @@ -2,7 +2,7 @@ name: sass_api # Note: Every time we add a new Sass AST node, we need to bump the *major* # version because it's a breaking change for anyone who's implementing the # visitor interface(s). -version: 15.12.2 +version: 15.12.3 description: Additional APIs for Dart Sass. homepage: https://github.com/sass/dart-sass @@ -10,7 +10,7 @@ environment: sdk: ">=3.6.0 <4.0.0" dependencies: - sass: 1.93.2 + sass: 1.93.3 dev_dependencies: dartdoc: ^8.0.14 diff --git a/pubspec.yaml b/pubspec.yaml index d90577e21..817c3fc4e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.93.2 +version: 1.93.3 description: A Sass implementation in Dart. homepage: https://github.com/sass/dart-sass