-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: convert to ES2015 class #54838
Conversation
Right now, despite this change, most of the logic for the REPL remains in the |
CC @nodejs/repl |
148940f
to
67a09cf
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54838 +/- ##
========================================
Coverage 87.61% 87.62%
========================================
Files 650 651 +1
Lines 182945 183326 +381
Branches 35394 35445 +51
========================================
+ Hits 160282 160632 +350
- Misses 15918 15953 +35
+ Partials 6745 6741 -4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against this change but I think we need to take it through a deprecation cycle first given the breaking change.
Typo in the commit title |
67a09cf
to
0e79995
Compare
|
doc deprecation needs to be followed by a runtime deprecation (emit a warning) which is semver major. The runtime deprecation needs to land before refactoring and removing the constructor without |
@RedYetiDev We might want to consider landing this (possibly temporarily) with a solution similar to what some of the test-runner reporters implemented to solve this semver-major issue: Lines 34 to 42 in a65105e
Lines 52 to 60 in a65105e
This would potentially allow landing this PR without needing to wait for the entire deprecation cycle to complete, and handle the deprecation separately |
The issue with that is: const reporters = require("node:test/reporters");
(new reporters.spec()) instanceof reporters.spec // false Sidenote: This is blocked by #54869 |
Closing until the runtime deprecation is done (which won't be for a while) |
This PR modifies the REPL to use an ES5 class.
It will (hopefully) be one of many in series to refactor the REPL's code, as IMO it is currently hard to read as is. My plan is to first convert the REPL to ECMAScript classes, and then move away from using the the
domain
module. IMO keeping the internal codebase up-to-date with deprecations and additions is a great way to maintain longevity.