Commit a193be3
esm: use import attributes instead of import assertions
The old import assertions proposal has been
renamed to "import attributes" with the follwing major changes:
1. The keyword is now `with` instead of `assert`.
2. Unknown assertions cause an error rather than being ignored,
This commit updates the documentation to encourage folks to use the new
syntax, and add aliases for module customization hooks.
PR-URL: #50140
Backport-PR-URL: #51136
Fixes: #50134
Refs: v8/v8@159c82c
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>1 parent c13969e commit a193be3Copy full SHA for a193be3
File tree
Expand file treeCollapse file tree
18 files changed
+68
-62
lines changedOpen diff view settings
Filter options
- doc/api
- src
- test
- es-module
- fixtures/es-modules
- parallel
Expand file treeCollapse file tree
18 files changed
+68
-62
lines changedOpen diff view settings
Collapse file
+1-4Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
| 47 | + |
51 | 48 | |
52 | 49 | |
53 | 50 | |
|
Collapse file
+11-9Lines changed: 11 additions & 9 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
7 | 7 | |
8 | 8 | |
9 | 9 | |
| 10 | + |
| 11 | + |
| 12 | + |
10 | 13 | |
11 | 14 | |
12 | 15 | |
| ||
202 | 205 | |
203 | 206 | |
204 | 207 | |
205 | | - |
| 208 | + |
206 | 209 | |
207 | 210 | |
208 | 211 | |
| ||
243 | 246 | |
244 | 247 | |
245 | 248 | |
246 | | - |
| 249 | + |
247 | 250 | |
248 | 251 | |
249 | 252 | |
250 | 253 | |
251 | 254 | |
252 | 255 | |
253 | 256 | |
254 | | - |
255 | | - |
256 | | - |
| 257 | + |
| 258 | + |
257 | 259 | |
258 | 260 | |
259 | 261 | |
260 | 262 | |
261 | 263 | |
262 | | - |
| 264 | + |
263 | 265 | |
264 | 266 | |
265 | | - |
| 267 | + |
266 | 268 | |
267 | 269 | |
268 | 270 | |
| ||
555 | 557 | |
556 | 558 | |
557 | 559 | |
558 | | - |
| 560 | + |
559 | 561 | |
560 | 562 | |
561 | | - |
| 563 | + |
562 | 564 | |
563 | 565 | |
564 | 566 | |
|
Collapse file
+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
745 | 745 | |
746 | 746 | |
747 | 747 | |
| 748 | + |
| 749 | + |
| 750 | + |
| 751 | + |
| 752 | + |
| 753 | + |
| 754 | + |
748 | 755 | |
749 | 756 | |
750 | 757 | |
|
Collapse file
test/es-module/test-esm-assertionless-json-import.js
Copy file name to clipboardExpand all lines: test/es-module/test-esm-assertionless-json-import.js+5-5Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
12 | | - |
| 12 | + |
13 | 13 | |
14 | 14 | |
15 | 15 | |
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | | - |
| 27 | + |
28 | 28 | |
29 | 29 | |
30 | 30 | |
| ||
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | | - |
| 42 | + |
43 | 43 | |
44 | 44 | |
45 | 45 | |
| ||
54 | 54 | |
55 | 55 | |
56 | 56 | |
57 | | - |
| 57 | + |
58 | 58 | |
59 | 59 | |
60 | 60 | |
| ||
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | | - |
| 72 | + |
73 | 73 | |
74 | 74 | |
75 | 75 | |
|
Collapse file
test/es-module/test-esm-data-urls.js
Copy file name to clipboardExpand all lines: test/es-module/test-esm-data-urls.js+5-5Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | | - |
| 63 | + |
64 | 64 | |
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | 68 | |
69 | 69 | |
70 | | - |
| 70 | + |
71 | 71 | |
72 | 72 | |
73 | 73 | |
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | | - |
| 77 | + |
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | 82 | |
83 | 83 | |
84 | 84 | |
85 | | - |
| 85 | + |
86 | 86 | |
87 | 87 | |
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | 91 | |
92 | | - |
| 92 | + |
93 | 93 | |
94 | 94 | |
95 | 95 | |
|
Collapse file
test/es-module/test-esm-dynamic-import-attribute.js
Copy file name to clipboardExpand all lines: test/es-module/test-esm-dynamic-import-attribute.js+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
8 | | - |
| 8 | + |
9 | 9 | |
10 | 10 | |
11 | 11 | |
| ||
16 | 16 | |
17 | 17 | |
18 | 18 | |
19 | | - |
| 19 | + |
20 | 20 | |
21 | 21 | |
22 | 22 | |
| ||
25 | 25 | |
26 | 26 | |
27 | 27 | |
28 | | - |
| 28 | + |
29 | 29 | |
30 | 30 | |
31 | 31 | |
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
| 39 | + |
40 | 40 | |
41 | 41 | |
42 | 42 | |
|
Collapse file
test/es-module/test-esm-dynamic-import-attribute.mjs
Copy file name to clipboardExpand all lines: test/es-module/test-esm-dynamic-import-attribute.mjs+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | | - |
| 6 | + |
7 | 7 | |
8 | 8 | |
9 | 9 | |
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | | - |
| 17 | + |
18 | 18 | |
19 | 19 | |
20 | 20 | |
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
| 26 | + |
27 | 27 | |
28 | 28 | |
29 | 29 | |
| ||
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | | - |
| 37 | + |
38 | 38 | |
39 | 39 | |
40 | 40 | |
|
Collapse file
test/es-module/test-esm-import-attributes-1.mjs
Copy file name to clipboard+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
| 4 | + |
5 | 5 | |
6 | 6 | |
Collapse file
test/es-module/test-esm-import-attributes-2.mjs
Copy file name to clipboardExpand all lines: test/es-module/test-esm-import-attributes-2.mjs+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
| 4 | + |
5 | 5 | |
6 | | - |
| 6 | + |
7 | 7 | |
8 | 8 | |
9 | 9 | |
|
Collapse file
test/es-module/test-esm-import-attributes-3.mjs
Copy file name to clipboardExpand all lines: test/es-module/test-esm-import-attributes-3.mjs+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
| 4 | + |
5 | 5 | |
6 | | - |
| 6 | + |
7 | 7 | |
8 | 8 | |
9 | 9 | |
|
0 commit comments