File tree 4 files changed +24
-2
lines changed
4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 170
170
171
171
### JS API
172
172
173
+ * While the legacy API has been deprecated since we released the modern API, we
174
+ now emit warnings when the legacy API is used to make sure users are aware
175
+ that it will be removed in Dart Sass 2.0.0. In the meantime, you can silence
176
+ these warnings by passing ` legacy-js-api ` in ` silenceDeprecations ` when using
177
+ the legacy API.
178
+
173
179
* Modify ` SassColor ` to accept a new ` space ` option, with support for all the
174
180
new color spaces defined in Color Level 4.
175
181
Original file line number Diff line number Diff line change @@ -159,6 +159,12 @@ Future<CompileResult> _compileStylesheet(
159
159
bool quietDeps,
160
160
bool sourceMap,
161
161
bool charset) async {
162
+ if (nodeImporter != null ) {
163
+ logger? .warnForDeprecation (
164
+ Deprecation .legacyJsApi,
165
+ 'The legacy JS API is deprecated and will be removed in '
166
+ 'Dart Sass 2.0.0.' );
167
+ }
162
168
var evaluateResult = await evaluateAsync (stylesheet,
163
169
importCache: importCache,
164
170
nodeImporter: nodeImporter,
Original file line number Diff line number Diff line change 5
5
// DO NOT EDIT. This file was generated from async_compile.dart.
6
6
// See tool/grind/synchronize.dart for details.
7
7
//
8
- // Checksum: 4d72aeb3c39a2e607d1889755e07b7e489eddfa6
8
+ // Checksum: 4141eec2214ef480b6fdf07e5090202cdea3eb89
9
9
//
10
10
// ignore_for_file: unused_import
11
11
@@ -168,6 +168,12 @@ CompileResult _compileStylesheet(
168
168
bool quietDeps,
169
169
bool sourceMap,
170
170
bool charset) {
171
+ if (nodeImporter != null ) {
172
+ logger? .warnForDeprecation (
173
+ Deprecation .legacyJsApi,
174
+ 'The legacy JS API is deprecated and will be removed in '
175
+ 'Dart Sass 2.0.0.' );
176
+ }
171
177
var evaluateResult = evaluate (stylesheet,
172
178
importCache: importCache,
173
179
nodeImporter: nodeImporter,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ enum Deprecation {
15
15
// DO NOT EDIT. This section was generated from the language repo.
16
16
// See tool/grind/generate_deprecations.dart for details.
17
17
//
18
- // Checksum: 5470e7252641d3eaa7093b072b52e423c3b77375
18
+ // Checksum: 0243e0f7ee85127d6e1bda5c08e363509959e758
19
19
20
20
/// Deprecation for passing a string directly to meta.call().
21
21
callString ('call-string' ,
@@ -109,6 +109,10 @@ enum Deprecation {
109
109
deprecatedIn: '1.79.0' ,
110
110
description: 'Using global color functions instead of sass:color.' ),
111
111
112
+ /// Deprecation for legacy JS API.
113
+ legacyJsApi ('legacy-js-api' ,
114
+ deprecatedIn: '1.79.0' , description: 'Legacy JS API.' ),
115
+
112
116
/// Deprecation for @import rules.
113
117
import.future ('import' , description: '@import rules.' ),
114
118
You can’t perform that action at this time.
0 commit comments