Commit d1ef6aa
authored
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
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 f447a46 commit d1ef6aaCopy full SHA for d1ef6aa
File tree
Expand file treeCollapse file tree
60 files changed
+472
-353
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- internal
- modules
- cjs
- esm
- process
- src
- test
- es-module
- fixtures
- es-module-loaders
- es-modules
- parallel
- tools
- dep_updaters
- node_modules/eslint/node_modules
- @babel
- plugin-syntax-import-assertions/lib
- plugin-syntax-import-attributes
- lib
- caniuse-lite
- data/features
- electron-to-chromium
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
60 files changed
+472
-353
lines changedOpen diff view settings
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
| 12 | + |
| 13 | + |
12 | 14 | |
13 | 15 | |
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | | - |
| 21 | + |
22 | 22 | |
23 | 23 | |
24 | 24 | |
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | | - |
| 47 | + |
48 | 48 | |
49 | 49 | |
50 | 50 | |
|
Collapse file
+14-3Lines changed: 14 additions & 3 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1759 | 1759 | |
1760 | 1760 | |
1761 | 1761 | |
1762 | | - |
| 1762 | + |
| 1763 | + |
1763 | 1764 | |
1764 | 1765 | |
1765 | 1766 | |
| ||
1771 | 1772 | |
1772 | 1773 | |
1773 | 1774 | |
1774 | | - |
| 1775 | + |
1775 | 1776 | |
1776 | 1777 | |
1777 | 1778 | |
| ||
1783 | 1784 | |
1784 | 1785 | |
1785 | 1786 | |
1786 | | - |
| 1787 | + |
| 1788 | + |
| 1789 | + |
| 1790 | + |
| 1791 | + |
| 1792 | + |
| 1793 | + |
| 1794 | + |
| 1795 | + |
| 1796 | + |
| 1797 | + |
1787 | 1798 | |
1788 | 1799 | |
1789 | 1800 | |
|
Collapse file
+26-13Lines changed: 26 additions & 13 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 | |
| ||
19 | 22 | |
20 | 23 | |
21 | 24 | |
22 | | - |
| 25 | + |
23 | 26 | |
24 | 27 | |
25 | 28 | |
| ||
203 | 206 | |
204 | 207 | |
205 | 208 | |
206 | | - |
| 209 | + |
207 | 210 | |
208 | 211 | |
209 | 212 | |
| ||
235 | 238 | |
236 | 239 | |
237 | 240 | |
238 | | - |
| 241 | + |
| 242 | + |
| 243 | + |
239 | 244 | |
240 | 245 | |
241 | 246 | |
242 | 247 | |
243 | 248 | |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
244 | 253 | |
245 | 254 | |
246 | | - |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
247 | 260 | |
248 | | - |
| 261 | + |
249 | 262 | |
250 | 263 | |
251 | 264 | |
252 | | - |
| 265 | + |
253 | 266 | |
254 | 267 | |
255 | | - |
| 268 | + |
256 | 269 | |
257 | 270 | |
258 | | - |
| 271 | + |
259 | 272 | |
260 | 273 | |
261 | | - |
| 274 | + |
262 | 275 | |
263 | 276 | |
264 | 277 | |
| ||
545 | 558 | |
546 | 559 | |
547 | 560 | |
548 | | - |
| 561 | + |
549 | 562 | |
550 | 563 | |
551 | | - |
| 564 | + |
552 | 565 | |
553 | 566 | |
554 | 567 | |
| ||
1055 | 1068 | |
1056 | 1069 | |
1057 | 1070 | |
1058 | | - |
1059 | | - |
| 1071 | + |
| 1072 | + |
1060 | 1073 | |
1061 | 1074 | |
1062 | 1075 | |
|
Collapse file
+12-7Lines changed: 12 additions & 7 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
458 | 458 | |
459 | 459 | |
460 | 460 | |
| 461 | + |
| 462 | + |
| 463 | + |
| 464 | + |
| 465 | + |
461 | 466 | |
462 | 467 | |
463 | 468 | |
| ||
477 | 482 | |
478 | 483 | |
479 | 484 | |
480 | | - |
481 | | - |
| 485 | + |
| 486 | + |
482 | 487 | |
483 | 488 | |
484 | 489 | |
| ||
489 | 494 | |
490 | 495 | |
491 | 496 | |
492 | | - |
| 497 | + |
493 | 498 | |
494 | 499 | |
495 | 500 | |
| ||
506 | 511 | |
507 | 512 | |
508 | 513 | |
509 | | - |
| 514 | + |
510 | 515 | |
511 | | - |
512 | | - |
| 516 | + |
| 517 | + |
513 | 518 | |
514 | 519 | |
515 | 520 | |
| ||
575 | 580 | |
576 | 581 | |
577 | 582 | |
578 | | - |
| 583 | + |
579 | 584 | |
580 | 585 | |
581 | 586 | |
|
Collapse file
+7-2Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1280 | 1280 | |
1281 | 1281 | |
1282 | 1282 | |
| 1283 | + |
1283 | 1284 | |
1284 | 1285 | |
| 1286 | + |
1285 | 1287 | |
1286 | | - |
| 1288 | + |
| 1289 | + |
1287 | 1290 | |
1288 | | - |
| 1291 | + |
| 1292 | + |
| 1293 | + |
1289 | 1294 | |
1290 | 1295 | |
1291 | 1296 | |
|
Collapse file
lib/internal/modules/cjs/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1258 | 1258 | |
1259 | 1259 | |
1260 | 1260 | |
1261 | | - |
| 1261 | + |
1262 | 1262 | |
1263 | 1263 | |
1264 | | - |
| 1264 | + |
1265 | 1265 | |
1266 | 1266 | |
1267 | 1267 | |
| ||
1285 | 1285 | |
1286 | 1286 | |
1287 | 1287 | |
1288 | | - |
| 1288 | + |
1289 | 1289 | |
1290 | 1290 | |
1291 | | - |
| 1291 | + |
1292 | 1292 | |
1293 | 1293 | |
1294 | 1294 | |
|
Collapse file
lib/internal/modules/esm/assert.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/assert.js+24-29Lines changed: 24 additions & 29 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
| 16 | + |
16 | 17 | |
17 | 18 | |
18 | 19 | |
19 | 20 | |
20 | 21 | |
21 | | - |
22 | | - |
23 | 22 | |
24 | | - |
25 | | - |
| 23 | + |
| 24 | + |
26 | 25 | |
27 | 26 | |
28 | 27 | |
| ||
31 | 30 | |
32 | 31 | |
33 | 32 | |
34 | | - |
| 33 | + |
35 | 34 | |
36 | 35 | |
37 | 36 | |
38 | 37 | |
39 | 38 | |
40 | | - |
| 39 | + |
41 | 40 | |
42 | 41 | |
43 | 42 | |
| ||
46 | 45 | |
47 | 46 | |
48 | 47 | |
49 | | - |
| 48 | + |
50 | 49 | |
51 | 50 | |
52 | | - |
| 51 | + |
53 | 52 | |
54 | 53 | |
55 | 54 | |
56 | 55 | |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
69 | 63 | |
| 64 | + |
70 | 65 | |
71 | 66 | |
72 | 67 | |
73 | | - |
| 68 | + |
74 | 69 | |
75 | 70 | |
76 | 71 | |
77 | 72 | |
78 | 73 | |
79 | | - |
80 | | - |
| 74 | + |
| 75 | + |
81 | 76 | |
82 | 77 | |
83 | | - |
| 78 | + |
84 | 79 | |
85 | | - |
| 80 | + |
86 | 81 | |
87 | 82 | |
88 | 83 | |
89 | 84 | |
90 | 85 | |
91 | | - |
92 | | - |
| 86 | + |
| 87 | + |
93 | 88 | |
94 | 89 | |
95 | 90 | |
96 | | - |
| 91 | + |
97 | 92 | |
98 | 93 | |
99 | 94 | |
| ||
118 | 113 | |
119 | 114 | |
120 | 115 | |
121 | | - |
| 116 | + |
122 | 117 | |
0 commit comments