Skip to content

Commit

Permalink
Deprecate the feature-exists function
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed May 6, 2024
1 parent 264b2d5 commit 9dcfe47
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.77.0

* The `meta.feature-exists` function is now deprecated. This deprecation is
named `feature-exists`.

## 1.76.0

* Throw errors for misplaced statements in keyframe blocks.
Expand Down
4 changes: 4 additions & 0 deletions lib/src/deprecation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ enum Deprecation {
deprecatedIn: '1.76.0',
description: 'Function and mixin names beginning with --.'),

featureExists('feature-exists',
deprecatedIn: '1.77.0',
description: 'Using the meta.feature-exists() function.'),

@Deprecated('This deprecation name was never actually used.')
calcInterp('calc-interp', deprecatedIn: null),

Expand Down
6 changes: 6 additions & 0 deletions lib/src/functions/meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import 'package:collection/collection.dart';

import '../ast/sass/statement/mixin_rule.dart';
import '../callable.dart';
import '../deprecation.dart';
import '../evaluation_context.dart';
import '../util/map.dart';
import '../value.dart';

Expand All @@ -26,6 +28,10 @@ final global = UnmodifiableListView([
// evaluator, because they need access to context that's only available at
// runtime.
_function("feature-exists", r"$feature", (arguments) {
warnForDeprecation(
"The feature-exists() function is deprecated.\n"
"More info: https://sass-lang.com/d/feature-exists",
Deprecation.featureExists);
var feature = arguments[0].assertString("feature");
return SassBoolean(_features.contains(feature.text));
}),
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 10.4.0

* No user-visible changes.

## 10.3.0

* No user-visible changes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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: 10.3.0
version: 10.4.0-dev
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
sass: 1.76.0
sass: 1.77.0

dev_dependencies:
dartdoc: ^6.0.0
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.76.0
version: 1.77.0-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit 9dcfe47

Please sign in to comment.