@@ -251,14 +251,10 @@ changes:
251
251
description: Switch from Import Assertions to Import Attributes.
252
252
-->
253
253
254
- > Stability: 1.1 - Active development
255
-
256
- > This feature was previously named "Import assertions", and using the ` assert `
257
- > keyword instead of ` with ` . Any uses in code of the prior ` assert ` keyword
258
- > should be updated to use ` with ` instead.
254
+ > Stability: 2 - Stable
259
255
260
- The [ Import Attributes proposal ] [ ] adds an inline syntax for module import
261
- statements to pass on more information alongside the module specifier.
256
+ [ Import attributes ] [ Import Attributes MDN ] are an inline syntax for module
257
+ import statements to pass on more information alongside the module specifier.
262
258
263
259
``` js
264
260
import fooData from ' ./foo.json' with { type : 'json ' };
@@ -267,13 +263,15 @@ const { default: barData } =
267
263
await import (' ./bar.json' , { with: { type: ' json' } });
268
264
```
269
265
270
- Node.js supports the following ` type ` values , for which the attribute is
271
- mandatory :
266
+ Node.js only supports the ` type ` attribute , for which it supports the following
267
+ values :
272
268
273
269
| Attribute ` type ` | Needed for |
274
270
| ---------------- | ---------------- |
275
271
| ` 'json' ` | [ JSON modules] [ ] |
276
272
273
+ The ` type: 'json' ` attribute is mandatory when importing JSON modules.
274
+
277
275
## Builtin modules
278
276
279
277
[ Core modules] [ ] provide named exports of their public API. A
@@ -552,7 +550,7 @@ separate cache.
552
550
553
551
## JSON modules
554
552
555
- > Stability: 1 - Experimental
553
+ > Stability: 2 - Stable
556
554
557
555
JSON files can be referenced by `import`:
558
556
@@ -1090,7 +1088,7 @@ success!
1090
1088
[Dynamic ` import ()` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import
1091
1089
[ES Module Integration Proposal for WebAssembly]: https://github.com/webassembly/esm-integration
1092
1090
[Import Attributes]: #import-attributes
1093
- [Import Attributes proposal ]: https://github.com/tc39/proposal- import-attributes
1091
+ [Import Attributes MDN ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/ import/with
1094
1092
[JSON modules]: #json-modules
1095
1093
[Module customization hooks]: module.md#customization-hooks
1096
1094
[Node.js Module Resolution And Loading Algorithm]: #resolution-algorithm-specification
0 commit comments