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

repl: deprecate repl.builtinModules #57508

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dario-piotrowicz
Copy link
Contributor

Fixes #57504

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Mar 16, 2025
@dario-piotrowicz dario-piotrowicz force-pushed the dario/57504/deprecate-repl-builtinmodules branch 6 times, most recently from 8473799 to 39271fa Compare March 16, 2025 22:44
@dario-piotrowicz dario-piotrowicz force-pushed the dario/57504/deprecate-repl-builtinmodules branch from 39271fa to f38edf8 Compare March 16, 2025 22:45
Copy link
Member

@juanarbol juanarbol left a comment

Choose a reason for hiding this comment

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

Amazing, thanks! If CI is happy, I'm happy as well.

@aduh95 aduh95 added the semver-major PRs that contain breaking changes and should be released in the next major version. label Mar 16, 2025
@aduh95
Copy link
Contributor

aduh95 commented Mar 16, 2025

Can you please open a PR that first doc-deprecates the API? Hum actually, I'm not sure whether --pending-deprecation changes would be semver-major, so that might be fine EDIT2: just checked, we have precedents for landing as semver-patch pending deprecations

@aduh95 aduh95 removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Mar 16, 2025
dario-piotrowicz and others added 2 commits March 16, 2025 23:29
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@dario-piotrowicz

This comment was marked as outdated.

dario-piotrowicz and others added 2 commits March 17, 2025 00:03
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 17, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 17, 2025
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.22%. Comparing base (0cfc471) to head (37cfc74).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #57508   +/-   ##
=======================================
  Coverage   90.21%   90.22%           
=======================================
  Files         629      629           
  Lines      184845   184853    +8     
  Branches    36206    36211    +5     
=======================================
+ Hits       166766   166786   +20     
+ Misses      11024    11023    -1     
+ Partials     7055     7044   -11     
Files with missing lines Coverage Δ
lib/repl.js 94.92% <100.00%> (+0.02%) ⬆️

... and 39 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

I would actually like to keep this around and just fix the issue. The reason is that we expose underscored modules in Module one and those should never be used.

The current issue with the repl exposed one is that it filters node: prefixed ones out. That should not be the case.

We can also update the documentation to say "all besides underscored'.

@aduh95
Copy link
Contributor

aduh95 commented Mar 17, 2025

I would actually like to keep this around

Any particular reason for that? Do you have a use-case in mind?

@BridgeAR
Copy link
Member

@aduh95

I tried to provide the reason in my comment above: we include e.g., _http_common. These should not be used and showing them in the REPL does not make any sense from a usability standpoint (you mostly care about regular modules).
They are just exposed due to legacy reasons.

@dario-piotrowicz
Copy link
Contributor Author

@BridgeAR Sorry for asking something probably pretty stupid 😓

But I don't have the full context here, could you clarify what the underscore modules are and what they are there for?

Also, when you said that they shouldn't be used do you mean in the REPL? or in general? why? and if it is the latter, why are they in module.builtinModules in the first place? (could they be removed from there?)

@anonrig
Copy link
Member

anonrig commented Mar 18, 2025

I would actually like to keep this around and just fix the issue. The reason is that we expose underscored modules in Module one and those should never be used.

The current issue with the repl exposed one is that it filters node: prefixed ones out. That should not be the case.

We can also update the documentation to say "all besides underscored'.

I didn't understand your reasoning behind this. Would you mind explaining more? @BridgeAR

  • require('module').builtinModules shouldn't return modules that start with _
  • require('repl').builtinModules shouldn't exist at all since it is almost same as module builtinModules.

My understanding is, we can deprecate repl builtinModules, and also in another PR remove the modules in module.builtinModules that starts with _ (which will be a semver-major PR, I suppose).

Any concerns with this path forward @BridgeAR?

@BridgeAR
Copy link
Member

BridgeAR commented Mar 18, 2025

@anonrig
If we are able to remove modules from require('module').builtinModules that start with _, then I am all for removing the repl one as well! I am just not certain if that's possible and I would like to start with that before we remove the repl one.

@dario-piotrowicz
Copy link
Contributor Author

I'm giving removing the underscore modules from require('module').builtinModules a shot here: #57540 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repl.builtinModules doesn't contain all node.js builtin modules
9 participants