Skip to content

Commit 64287e4

Browse files
committed
module: runtime deprecate trailing slash patterns
PR-URL: #40117 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3101c09 commit 64287e4

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2820,13 +2820,16 @@ and `'mgf1HashAlgorithm'`.
28202820
### DEP0155: Trailing slashes in pattern specifier resolutions
28212821
<!-- YAML
28222822
changes:
2823+
- version: REPLACEME
2824+
pr-url: https://github.com/nodejs/node/pull/40117
2825+
description: Runtime deprecation.
28232826
- version: REPLACEME
28242827
pr-url: https://github.com/nodejs/node/pull/40039
28252828
description: Documentation-only deprecation
28262829
with `--pending-deprecation` support.
28272830
-->
28282831

2829-
Type: Documentation-only (supports [`--pending-deprecation`][])
2832+
Type: Runtime
28302833

28312834
The remapping of specifiers ending in `"/"` like `import 'pkg/x/'` is deprecated
28322835
for package `"exports"` and `"imports"` pattern resolutions.

lib/internal/modules/esm/resolve.js

-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const { sep, relative, resolve } = require('path');
3939
const preserveSymlinks = getOptionValue('--preserve-symlinks');
4040
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
4141
const typeFlag = getOptionValue('--input-type');
42-
const pendingDeprecation = getOptionValue('--pending-deprecation');
4342
const { URL, pathToFileURL, fileURLToPath } = require('internal/url');
4443
const {
4544
ERR_INPUT_TYPE_NOT_ALLOWED,
@@ -107,7 +106,6 @@ function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
107106
}
108107

109108
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, isExports, base) {
110-
if (!pendingDeprecation) return;
111109
const pjsonPath = fileURLToPath(pjsonUrl);
112110
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
113111
return;

test/es-module/test-esm-exports-deprecations.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --pending-deprecation
21
import { mustCall } from '../common/index.mjs';
32
import assert from 'assert';
43

test/es-module/test-esm-local-deprecations.mjs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Flags: --pending-deprecation
2-
31
import '../common/index.mjs';
42
import assert from 'assert';
53
import fixtures from '../common/fixtures.js';

0 commit comments

Comments
 (0)