Merge branch 'main' of github.com:sass/sass into merge-main

This commit is contained in:
Natalie Weizenbaum 2024-09-11 14:58:13 -07:00
commit acd8ea0330
8 changed files with 139 additions and 39 deletions

View File

@ -72,7 +72,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.35.1
- uses: bufbuild/buf-setup-action@v1.40.1
with: {github_token: "${{ github.token }}"}
- name: Generate protobuf code
run: buf generate
@ -138,7 +138,7 @@ jobs:
- name: Find changed files in js-api-doc
id: changed-files
uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
with: {files: js-api-doc}
- name: Deploy

View File

@ -6,7 +6,7 @@
*/
export interface Deprecations {
// START AUTOGENERATED LIST
// Checksum: b87f31f543f52c97431cce85ef11e92b6a71cfde
// Checksum: 5470e7252641d3eaa7093b072b52e423c3b77375
/**
* Deprecation for passing a string directly to meta.call().
@ -120,6 +120,13 @@ export interface Deprecations {
*/
'mixed-decls': Deprecation<'mixed-decls'>;
/**
* Deprecation for meta.feature-exists
*
* This deprecation became active in Dart Sass 1.78.0.
*/
'feature-exists': Deprecation<'feature-exists'>;
/**
* Deprecation for certain uses of built-in sass:color functions.
*
@ -141,6 +148,13 @@ export interface Deprecations {
*/
import: Deprecation<'import'>;
/**
* Deprecation for global built-in functions that are available in sass: modules.
*
* This deprecation is not yet active, but will be soon.
*/
'global-builtin': Deprecation<'global-builtin'>;
// END AUTOGENERATED LIST
/**

View File

@ -1,3 +1,4 @@
import {DeprecationOrId, Version} from '../deprecations';
import {Logger} from '../logger';
import {LegacyImporter} from './importer';
import {LegacyFunction} from './function';
@ -483,6 +484,45 @@ export interface LegacySharedOptions<sync extends 'sync' | 'async'> {
*/
quietDeps?: boolean;
/**
* A set of deprecations to treat as fatal.
*
* If a deprecation warning of any provided type is encountered during
* compilation, the compiler will error instead.
*
* If a `Version` is provided, then all deprecations that were active in that
* compiler version will be treated as fatal.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
fatalDeprecations?: (DeprecationOrId | Version)[];
/**
* A set of future deprecations to opt into early.
*
* Future deprecations passed here will be treated as active by the compiler,
* emitting warnings as necessary.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
futureDeprecations?: DeprecationOrId[];
/**
* A set of active deprecations to ignore.
*
* If a deprecation warning of any provided type is encountered during
* compilation, the compiler will ignore it instead.
*
* **Heads up!** The deprecated functionality you're depending on will
* eventually break.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
silenceDeprecations?: DeprecationOrId[];
/**
* By default, Dart Sass will print only five instances of the same
* deprecation warning per compilation to avoid deluging users in console

View File

@ -1,33 +0,0 @@
# `@nest` Rule
Sass has special semantics for the `@nest` rule. Although this rule is primarily
intended to give the CSSOM a consistent representation for interleaved
declarations and is never required to be written explicitly, it *is* valid CSS
and Sass must ensure that its use preserves the existing CSS semantics.
## Syntax
<x><pre>
**NestRule** ::= '@nest'¹ '{' Statements '}'
</pre></x>
1: This is case-insensitive.
## Semantics
To execute a `@nest` rule `rule`:
* If there's a [current keyframe block], throw an error.
[current keyframe block]: ../style-rules.md#current-keyframe-block
* If there's a [current style rule], evaluate each child in `rule`'s
`Statement`s.
[current style rule]: ../style-rules.md#current-style-rule
* Otherwise, [evaluate `rule` as an unknown at-rule] with
`InterpolatedIdentifier` "nest", no `InterpolatedValue`, and the same
`Statements`.
[evaluate `rule` as an unknown at-rule]: ../at-rules/unknown.md

View File

@ -106,6 +106,8 @@ function-exists($name, $module: null)
This function is also available as a global function named `function-exists()`.
* Emit a deprecation warning named `feature-exists`.
* If `$name` is not a string, throw an error.
* If `$name` is not an [`<ident-token>`], return false.
@ -115,7 +117,7 @@ This function is also available as a global function named `function-exists()`.
* If `$module` is null:
* Return whether [resolving a function] named `$name` returns null.
[resolving a function]: ../modules.md#resolving-a-member
* Otherwise, if `$module` isn't a string, throw an error.
@ -213,7 +215,7 @@ This function is also available as a global function named `global-variable-exis
* Return whether [resolving a variable] named `$name`, ignoring local
scopes, returns null.
[resolving a variable]: ../modules.md#resolving-a-member
* Otherwise, if `$module` isn't a string, throw an error.

View File

@ -112,6 +112,12 @@ mixed-decls:
status: active
deprecated: 1.77.7
feature-exists:
description: meta.feature-exists
dart-sass:
status: active
deprecated: 1.78.0
color-4-api:
description: Certain uses of built-in sass:color functions.
dart-sass:
@ -128,3 +134,8 @@ import:
description: "@import rules."
dart-sass:
status: future
global-builtin:
description: "Global built-in functions that are available in sass: modules."
dart-sass:
status: future

View File

@ -29,7 +29,7 @@
### `Deprecations`
<!-- START AUTOGENERATED LIST -->
<!-- Checksum: b87f31f543f52c97431cce85ef11e92b6a71cfde -->
<!-- Checksum: 5470e7252641d3eaa7093b072b52e423c3b77375 -->
```ts
export interface Deprecations {
'call-string': Deprecation<'call-string'>;
@ -48,9 +48,11 @@ export interface Deprecations {
'fs-importer-cwd': Deprecation<'fs-importer-cwd'>;
'css-function-mixin': Deprecation<'css-function-mixin'>;
'mixed-decls': Deprecation<'mixed-decls'>;
'feature-exists': Deprecation<'feature-exists'>;
'color-4-api': Deprecation<'color-4-api'>;
'color-functions': Deprecation<'color-functions'>;
import: Deprecation<'import'>;
'global-builtin': Deprecation<'global-builtin'>;
'user-authored': Deprecation<'user-authored', 'user'>;
}
```

View File

@ -1,6 +1,7 @@
# Legacy API Options
```ts
import {DeprecationOrId, Version} from '../deprecations';
import {Logger} from '../logger';
import {LegacyImporter} from './importer';
import {LegacyFunction} from './function';
@ -26,6 +27,9 @@ import {NodePackageImporter} from '../importer';
* [`functions`](#functions)
* [`charset`](#charset)
* [`quietDeps`](#quietdeps)
* [`fatalDeprecations`](#fataldeprecations)
* [`futureDeprecations`](#futuredeprecations)
* [`silenceDeprecations`](#silencedeprecations)
* [`verbose`](#verbose)
* [`logger`](#logger)
* [`pkgImporter`](#pkgimporter)
@ -146,6 +150,66 @@ Defaults to false.
quietDeps?: boolean;
```
#### `fatalDeprecations`
A set of deprecations to treat as fatal.
If a deprecation warning of any provided type is encountered during compilation,
the compiler must error instead.
The compiler should convert any string passed here to a `Deprecation` by
indexing `deprecations`. If an invalid deprecation ID is passed here, the
compiler must emit a warning. If a version is passed here, it should be treated
equivalently to passing all active deprecations whose `deprecatedIn` version is
less than or equal to it.
The compiler must emit a warning if a future deprecation that's not also
included in `futureDeprecations` or any obsolete deprecation is included here.
If a deprecation is passed both here and to `silenceDeprecations`, a warning
must be emitted, but making the deprecation fatal must take precedence.
```ts
fatalDeprecations?: (DeprecationOrId | Version)[];
```
#### `futureDeprecations`
A set of future deprecations to opt into early.
For each future deprecation provided here, the compiler must treat that
deprecation as if it is active, emitting warnings as necessary (subject to
`fatalDeprecations` and `silenceDeprecations`).
The compiler should convert any string passed here to a `Deprecation` by
indexing `Deprecations`. If an invalid deprecation ID is passed here, the
compiler must emit a warning.
The compiler must emit a warning if a non-future deprecation is included here.
```ts
futureDeprecations?: DeprecationOrId[];
```
#### `silenceDeprecations`
A set of active deprecations to ignore.
If a deprecation warning of any provided type is encountered during compilation,
the compiler must ignore it.
The compiler should convert any string passed here to a `Deprecation` by
indexing `Deprecations`. If an invalid deprecation ID is passed here, the
compiler must emit a warning.
The compiler must emit a warning if any non-active deprecation is included here.
If a future deprecation is included both here and in `futureDeprecations`, then
silencing it takes precedence.
```ts
silenceDeprecations?: DeprecationOrId[];
```
#### `verbose`
If true, the compiler must print every single deprecation warning it encounters