Skip to content

repl: runtime deprecate inputStream, outputStream and _builtinLibs - #54750

Closed
avivkeller wants to merge 1 commit into
nodejs:mainfrom
avivkeller:repl-runtime-dep
Closed

repl: runtime deprecate inputStream, outputStream and _builtinLibs#54750
avivkeller wants to merge 1 commit into
nodejs:mainfrom
avivkeller:repl-runtime-dep

Conversation

@avivkeller

Copy link
Copy Markdown
Member

These features have been doc-only deprecated for years (since v14!), so maybe they should finally be runtime deprecated?

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Sep 3, 2024
@avivkelleravivkeller added the deprecations Issues and PRs related to deprecations. label Sep 3, 2024
@avivkelleravivkeller changed the title repl: runtime deprecate 04141 and 04142repl: runtime deprecate 0141 and 0142Sep 3, 2024
@richardlaurichardlau added the semver-major PRs that contain breaking changes and should be released in the next major version. label Sep 3, 2024
@codecov

codecovBot commented Sep 3, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.62%. Comparing base (5949e16) to head (f5f2f29).
Report is 273 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #54750 +/- ##
==========================================
+ Coverage 87.60% 87.62% +0.01% 
==========================================
Files 650 650 Lines 182829 182934 +105 Branches 35379 35383 +4 ==========================================
+ Hits 160173 160292 +119 + Misses 15928 15910 -18 - Partials 6728 6732 +4 
Files with missing linesCoverage Δ
lib/repl.js94.45% <100.00%> (+0.33%)⬆️

... and 42 files with indirect coverage changes

@aduh95aduh95 changed the title repl: runtime deprecate 0141 and 0142repl: runtime deprecate inputStream, outputStream and _builtinLibsSep 5, 2024
@aduh95

Copy link
Copy Markdown
Contributor

Can you make the commit message clearer? e.g. repl: runtime deprecate `inputStream`, `outputStream` and `_builtinLibs` . Also, what is the rational for deprecating those?

@avivkeller

avivkeller commented Sep 5, 2024

Copy link
Copy Markdown
MemberAuthor

Also, what is the rational for deprecating those?

These properties have been pending deprecation for years, so I believe it's finally time to runtime deprecate them. IMO things shouldn't be pending deprecation for as long as these were.

@aduh95

Copy link
Copy Markdown
Contributor

These properties have been pending deprecation for years

Why are there deprecated in the first place?

IMO things shouldn't be pending deprecation for as long as these were.

Deprecations can stay at the same stage forever – I don't know about this one, but it is not a valid argument for runtime deprecate something.

No API can change to End-of-Life without going through a Runtime Deprecation
cycle. There is no rule that deprecated code must progress to End-of-Life.
Documentation-Only and Runtime Deprecations can remain in place for an unlimited
duration.

@avivkeller

Copy link
Copy Markdown
MemberAuthor

Deprecations can stay at the same stage forever – I don't know about this one, but it is not a valid argument for runtime deprecate something.

Apologies. A better argument for this is that these features have been replaced. inputStream has been replaced with input, and the same for output. _builtinLibs isn't best-practice (IIRC). I believe that runtime deprecating these features will encourage users to use the newer, better, replacements.

@aduh95

Copy link
Copy Markdown
Contributor

A better argument for this is that these features have been replaced.

It is a much better argument, but I'm not sure it's true. Looking at #33294, those already existed when the deprecation was decided.

I believe that runtime deprecating these features will encourage users to use the newer, better, replacements.

I don't know if the replacements are better, IIUC it's perfectly equivalent. It will for sure create some friction for our users forcing them to either update the code to use the non-deprecated alias (which may or may not be code that they maintain), or disable/ignore the warnings. As Anna said in #33294 (review), shouldn't we prefer to keep the alias around forever?

Comment threadtest/parallel/test-repl-tab-complete-import.js Outdated
Comment threadtest/parallel/test-repl-tab-complete.js Outdated
Comment threadtest/parallel/test-repl-options.js Outdated
@avivkeller

Copy link
Copy Markdown
MemberAuthor

Ping @nodejs/tsc per the plan for v23

@mcollinamcollina 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.

lgtm

@aduh95

Copy link
Copy Markdown
Contributor

I'm still not convinced we should runtime deprecate this as I said in #54750 (comment).

@avivkeller

Copy link
Copy Markdown
MemberAuthor

I'm still not convinced we should runtime deprecate this as I said in #54750 (comment).

It will for sure create some friction for our users forcing them to either update the code to use the non-deprecated alias

Isn't that the point of deprecations? To encourage users to upgrade to the better maintained code? Runtime deprecating this will encourage users to move to code that is currently supported.

Maybe a few versions ago it would be a concern for friction for users, but these have been runtime deprecated for (IMO) long enough that if the users haven't upgraded to non-deprecated features, it's okay to present them with a warning.

@avivkelleravivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 20, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 20, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95

Copy link
Copy Markdown
Contributor

if the users haven't upgraded to non-deprecated features, it's okay to present them with a warning.

Why though? It seems to be adding friction for.. the sake of it?

@avivkeller

avivkeller commented Sep 20, 2024

Copy link
Copy Markdown
MemberAuthor

Why though? It seems to be adding friction for.. the sake of it?

I wouldn’t say it’s just for the "sake" of it. It’s about tying up loose ends. These deprecations are meant to nudge users toward upgrading, and I think it's time to start issuing warnings for this feature. I don’t see it causing much friction—users should have been aware of this since it was documented as deprecated in v14.

If they choose not to upgrade, they can stick with V22, but that’s their loss, in my opinion. It’s crucial to keep the codebase current, and by gradually phasing out deprecated features, we encourage users to do the same.


I've added author ready, as there are enough TSC approvals for this to land in the next semver (and a CI run). @aduh95 are you blocking?

@avivkelleravivkeller added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 20, 2024

@aduh95aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Each deprecation should be its own PR. Also this shouldn't land without a CITGM run (and probably shouldn't land at all until there's a rational for it).

@aduh95aduh95 removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 23, 2024
@avivkelleravivkeller added the needs-citgm PRs that need a CITGM CI run. label Sep 23, 2024
@avivkeller

Copy link
Copy Markdown
MemberAuthor

Each deprecation should be its own PR.

Got it. I currently have a lot of open PRs, and I'm trying to narrow my focus down to where it's really needed, so I'm closing this until a time where I can find a good rationale to not waste reviewers time

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

Labels

deprecationsIssues and PRs related to deprecations.needs-ciPRs that need a full CI run.needs-citgmPRs that need a CITGM CI run.replIssues and PRs related to the REPL subsystem.semver-majorPRs 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

@avivkeller@aduh95@nodejs-github-bot@mcollina@jasnell@marco-ippolito@richardlau