Skip to content

Commit b0f1ef6

Browse files
Add feature for discouraged import assertions (#2565)
Co-authored-by: Patrick Brosset <[email protected]>
1 parent 1912448 commit b0f1ef6

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

features/css-modules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name: CSS import attributes
2-
description: 'Module `import … with { type: "css" } statements load CSS modules as constructable stylesheets. Also known as CSS module scripts and formerly known as import assertions.'
2+
description: 'Module `import … with { type: "css" } statements load CSS modules as constructable stylesheets. Also known as CSS module scripts.'
33
spec: https://html.spec.whatwg.org/multipage/webappapis.html#css-module-script

features/import-assertions.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Import assertions
2+
description: 'Module `import … assert { type: "json" }` and `import … assert { type: "css" }` JavaScript statements load JSON and CSS data.'
3+
spec: https://github.com/tc39/proposal-import-attributes/tree/abca60286360b47f9a6be25a28f489c2cb157beb
4+
discouraged:
5+
according_to:
6+
- https://github.com/tc39/proposal-import-attributes/pull/131
7+
alternatives:
8+
- css-modules
9+
- json-modules
10+
compat_features:
11+
- javascript.statements.import.import_assertions
12+
- javascript.statements.import.import_assertions.type_css
13+
- javascript.statements.import.import_assertions.type_json

features/import-assertions.yml.dist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Generated from: import-assertions.yml
2+
# Do not edit this file by hand. Edit the source file instead!
3+
4+
status:
5+
baseline: false
6+
support: {}
7+
compat_features:
8+
- javascript.statements.import.import_assertions
9+
- javascript.statements.import.import_assertions.type_css
10+
- javascript.statements.import.import_assertions.type_json

features/json-modules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: JSON import attributes
2-
description: 'Module `import … with { type: "json" }` statements load JSON data. Also known as JSON module scripts and formerly known as import assertions.'
2+
description: 'Module `import … with { type: "json" }` statements load JSON data. Also known as JSON module scripts.'
33
spec: https://html.spec.whatwg.org/multipage/webappapis.html#json-module-script
44
group: json
55
# TODO: Tag javascript.statements.import when https://github.com/web-platform-dx/web-features/issues/1173 is resolved.

scripts/specs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ const defaultAllowlist: allowlistItem[] = [
9696
[
9797
"https://immersive-web.github.io/webvr/spec/1.1/",
9898
"Allowed because this is the legacy spec that defines WebVR."
99+
],
100+
[
101+
"https://github.com/tc39/proposal-import-attributes/tree/abca60286360b47f9a6be25a28f489c2cb157beb",
102+
"Allowed because import assertions were replaced in-place by import attributes. Remove this exception when javascript.statements.import.import_assertions is dropped from BCD in June 2026."
99103
]
100104
];
101105

0 commit comments

Comments
 (0)