Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: runtime deprecate trailing slash patterns #40117

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2816,14 +2816,18 @@ and `'mgf1HashAlgorithm'`.

### DEP0155: Trailing slashes in pattern specifier resolutions
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/40017
guybedford marked this conversation as resolved.
Show resolved Hide resolved
description: Runtime deprecation.
changes:
guybedford marked this conversation as resolved.
Show resolved Hide resolved
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/40039
description: Documentation-only deprecation
with `--pending-deprecation` support.
-->

Type: Documentation-only (supports [`--pending-deprecation`][])
Type: Runtime

The remapping of specifiers ending in `"/"` like `import 'pkg/x/'` is deprecated
for package `"exports"` and `"imports"` pattern resolutions.
Expand Down
2 changes: 0 additions & 2 deletions lib/internal/modules/esm/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const { sep, relative, resolve } = require('path');
const preserveSymlinks = getOptionValue('--preserve-symlinks');
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
const typeFlag = getOptionValue('--input-type');
const pendingDeprecation = getOptionValue('--pending-deprecation');
const { URL, pathToFileURL, fileURLToPath } = require('internal/url');
const {
ERR_INPUT_TYPE_NOT_ALLOWED,
Expand Down Expand Up @@ -108,7 +107,6 @@ function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
}

function emitTrailingSlashPatternDeprecation(match, pjsonUrl, isExports, base) {
if (!pendingDeprecation) return;
const pjsonPath = fileURLToPath(pjsonUrl);
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
return;
Expand Down
1 change: 0 additions & 1 deletion test/es-module/test-esm-exports-deprecations.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --pending-deprecation
import { mustCall } from '../common/index.mjs';
import assert from 'assert';

Expand Down
2 changes: 0 additions & 2 deletions test/es-module/test-esm-local-deprecations.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Flags: --pending-deprecation

import '../common/index.mjs';
import assert from 'assert';
import fixtures from '../common/fixtures.js';
Expand Down