Skip to content

module: runtime deprecate require.extensions#58642

Draft
marco-ippolito wants to merge 1 commit into
nodejs:mainfrom
marco-ippolito:runtime-deprecate-require-extensions
Draft

module: runtime deprecate require.extensions#58642
marco-ippolito wants to merge 1 commit into
nodejs:mainfrom
marco-ippolito:runtime-deprecate-require-extensions

Conversation

@marco-ippolito

Copy link
Copy Markdown
Member

I'm opening this as draft PR to discuss if we should do runtime deprecate require.extensions.
It has been deprecated since v0.10.6.
This might have a large impact.
It's causing some issues for type stripping nodejs/typescript#37

@nodejs-github-bot

nodejs-github-bot commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. labels Jun 9, 2025
@marco-ippolito marco-ippolito added deprecations Issues and PRs related to deprecations. semver-major PRs that contain breaking changes and should be released in the next major version. labels Jun 9, 2025
@targos

targos commented Jun 9, 2025

Copy link
Copy Markdown
Member

We should run citgm on this.

@marco-ippolito marco-ippolito added the needs-citgm PRs that need a CITGM CI run. label Jun 9, 2025
Comment thread doc/api/deprecations.md
Type: Documentation-only
Type: Runtime

The [`require.extensions`][] property is deprecated.

@legendecas legendecas Jun 9, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an alternative, like module.register or module.registerHooks, should be recommended, and be stable, before runtime deprecating this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registerHooks, not register. The latter should go away once the former is ready. And registerHooks is a more appropriate replacement for extensions as both are sync.

@marco-ippolito marco-ippolito Jun 9, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would actually need an api that returns all the registered hooks + registerHooks

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can do this before registerHooks() is stable.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecations Issues and PRs related to deprecations. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. needs-citgm PRs that need a CITGM CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants