Commit 9863d27
module: only emit require(esm) warning under --trace-require-module
require(esm) is relatively stable now and the experimental warning
has run its course - it's now more troublesome than useful.
This patch changes it to no longer emit a warning unless
`--trace-require-module` is explicitly used. The flag supports
two modes:
- `--trace-require-module=all`: emit warnings for all usages
- `--trace-require-module=no-node-modules`: emit warnings for
usages that do not come from a `node_modules` folder.
PR-URL: #56194
Fixes: #55417
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>1 parent 8325fa5 commit 9863d27Copy full SHA for 9863d27
File tree
Expand file treeCollapse file tree
11 files changed
+80
-48
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/modules/cjs
- src
- test/es-module
Expand file treeCollapse file tree
11 files changed
+80
-48
lines changedOpen diff view settings
Collapse file
+13Lines changed: 13 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2613 | 2613 | |
2614 | 2614 | |
2615 | 2615 | |
| 2616 | + |
| 2617 | + |
| 2618 | + |
| 2619 | + |
| 2620 | + |
| 2621 | + |
| 2622 | + |
| 2623 | + |
| 2624 | + |
| 2625 | + |
| 2626 | + |
| 2627 | + |
2616 | 2628 | |
2617 | 2629 | |
2618 | 2630 | |
| ||
3123 | 3135 | |
3124 | 3136 | |
3125 | 3137 | |
| 3138 | + |
3126 | 3139 | |
3127 | 3140 | |
3128 | 3141 | |
|
Collapse file
+8-3Lines changed: 8 additions & 3 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
175 | 175 | |
176 | 176 | |
177 | 177 | |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
178 | 183 | |
179 | 184 | |
180 | 185 | |
| ||
315 | 320 | |
316 | 321 | |
317 | 322 | |
318 | | - |
319 | | - |
320 | | - |
| 323 | + |
| 324 | + |
321 | 325 | |
322 | 326 | |
323 | 327 | |
| ||
1267 | 1271 | |
1268 | 1272 | |
1269 | 1273 | |
| 1274 | + |
1270 | 1275 | |
1271 | 1276 | |
1272 | 1277 | |
|
Collapse file
lib/internal/modules/cjs/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js+17-12Lines changed: 17 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1499 | 1499 | |
1500 | 1500 | |
1501 | 1501 | |
1502 | | - |
| 1502 | + |
1503 | 1503 | |
1504 | 1504 | |
1505 | 1505 | |
| ||
1520 | 1520 | |
1521 | 1521 | |
1522 | 1522 | |
1523 | | - |
| 1523 | + |
| 1524 | + |
1524 | 1525 | |
1525 | | - |
1526 | | - |
1527 | | - |
1528 | | - |
1529 | | - |
1530 | | - |
1531 | | - |
1532 | | - |
1533 | | - |
| 1526 | + |
| 1527 | + |
| 1528 | + |
| 1529 | + |
| 1530 | + |
| 1531 | + |
| 1532 | + |
| 1533 | + |
| 1534 | + |
| 1535 | + |
| 1536 | + |
| 1537 | + |
| 1538 | + |
1534 | 1539 | |
1535 | 1540 | |
1536 | 1541 | |
| ||
1556 | 1561 | |
1557 | 1562 | |
1558 | 1563 | |
1559 | | - |
| 1564 | + |
1560 | 1565 | |
1561 | 1566 | |
1562 | 1567 | |
|
Collapse file
+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
135 | 135 | |
136 | 136 | |
137 | 137 | |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
138 | 143 | |
139 | 144 | |
140 | 145 | |
| ||
770 | 775 | |
771 | 776 | |
772 | 777 | |
| 778 | + |
| 779 | + |
| 780 | + |
| 781 | + |
| 782 | + |
| 783 | + |
| 784 | + |
773 | 785 | |
774 | 786 | |
775 | 787 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
210 | 210 | |
211 | 211 | |
212 | 212 | |
| 213 | + |
213 | 214 | |
214 | 215 | |
215 | 216 | |
|
Collapse file
test/es-module/test-require-module-preload.js
Copy file name to clipboardExpand all lines: test/es-module/test-require-module-preload.js-11Lines changed: 0 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
8 | | - |
9 | | - |
10 | 8 | |
11 | 9 | |
12 | 10 | |
| ||
22 | 20 | |
23 | 21 | |
24 | 22 | |
25 | | - |
26 | | - |
27 | 23 | |
28 | 24 | |
29 | 25 | |
| ||
43 | 39 | |
44 | 40 | |
45 | 41 | |
46 | | - |
47 | | - |
48 | 42 | |
49 | 43 | |
50 | 44 | |
| ||
66 | 60 | |
67 | 61 | |
68 | 62 | |
69 | | - |
70 | | - |
71 | 63 | |
72 | 64 | |
73 | 65 | |
| ||
90 | 82 | |
91 | 83 | |
92 | 84 | |
93 | | - |
94 | | - |
95 | 85 | |
96 | 86 | |
97 | 87 | |
| ||
117 | 107 | |
118 | 108 | |
119 | 109 | |
120 | | - |
121 | 110 | |
122 | 111 | |
123 | 112 | |
|
Collapse file
test/es-module/test-require-module-warning.js
Copy file name to clipboardExpand all lines: test/es-module/test-require-module-warning.js+11-3Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | | - |
4 | | - |
5 | | - |
| 3 | + |
6 | 4 | |
7 | 5 | |
8 | 6 | |
9 | 7 | |
10 | 8 | |
11 | 9 | |
12 | 10 | |
| 11 | + |
13 | 12 | |
14 | 13 | |
15 | 14 | |
| ||
33 | 32 | |
34 | 33 | |
35 | 34 | |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
Collapse file
test/es-module/test-require-module.js
Copy file name to clipboardExpand all lines: test/es-module/test-require-module.js-10Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | 6 | |
17 | 7 | |
18 | 8 | |
|
Collapse file
test/es-module/test-require-node-modules-warning.js
Copy file name to clipboardExpand all lines: test/es-module/test-require-node-modules-warning.js+18-6Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | | - |
4 | | - |
| 3 | + |
| 4 | + |
5 | 5 | |
6 | 6 | |
7 | 7 | |
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | | - |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
18 | 21 | |
19 | 22 | |
20 | 23 | |
| ||
26 | 29 | |
27 | 30 | |
28 | 31 | |
29 | | - |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
30 | 36 | |
31 | 37 | |
32 | 38 | |
| ||
38 | 44 | |
39 | 45 | |
40 | 46 | |
41 | | - |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
42 | 51 | |
43 | 52 | |
44 | 53 | |
| ||
50 | 59 | |
51 | 60 | |
52 | 61 | |
53 | | - |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
54 | 66 | |
55 | 67 | |
56 | 68 | |
|
Collapse file
test/es-module/test-typescript-commonjs.mjs
Copy file name to clipboardExpand all lines: test/es-module/test-typescript-commonjs.mjs-1Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
116 | 116 | |
117 | 117 | |
118 | 118 | |
119 | | - |
120 | 119 | |
121 | 120 | |
122 | 121 | |
|
0 commit comments