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 REPLServer.prototype.memory #16242

Closed
wants to merge 1 commit into from
Closed

repl: deprecate REPLServer.prototype.memory #16242

wants to merge 1 commit into from

Conversation

lance
Copy link
Member

@lance lance commented Oct 16, 2017

This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

repl, doc

@lance lance self-assigned this Oct 16, 2017
@nodejs-github-bot nodejs-github-bot added the repl Issues and PRs related to the REPL subsystem. label Oct 16, 2017
@lance lance added the doc Issues and PRs related to the documentations. label Oct 16, 2017
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

Do we have any concept of ecosystem usage? Other than that, LGTM.

lib/repl.js Outdated
REPLServer.prototype.memory = function memory(cmd) {
var self = this;
REPLServer.prototype.memory = util.deprecate(
function(cmd) { _memory(this, cmd); },
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I'd use _memory directly to remove yet another wrapper.

Copy link
Member Author

@lance lance Oct 17, 2017

Choose a reason for hiding this comment

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

@lpinca If I deprecate like so

REPLServer.prototype.memory = util.deprecate(
  _memory,
  'REPLServer.memory() is deprecated',
  'DEP00XX');

then I will need to set self = this in _memory. E.g.

function _memory(cmd) {
  self = this;
  self.lines = self.lines || [];
  self.lines.level = self.lines.level || [];
  // ... etc
}

With the current implementation, all internal calls go directly to `_memory()`, bypassing the wrapper altogether. Only those calls to `REPLServer.prototype.memory()` will hit it, and the idea is for this to go away anyway.

**EDIT** Never mind all that. I'll take care of the nit.

const warn = 'REPLServer.memory() is deprecated';

common.expectWarning('DeprecationWarning', warn);
assert.ok(server.memory() === undefined);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: assert.strictEqual()?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will address this when landing.

This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.
@lance
Copy link
Member Author

lance commented Oct 17, 2017

@lance
Copy link
Member Author

lance commented Oct 17, 2017

@cjihrig there is this from @ChALkeR from over a year ago. #7619 (comment)

So it seems like ecosystem usage is small, but it's hard to know for sure. It's hard for me to understand exactly what users in the ecosystem would be using this method for. It really is an internal implementation detail.

@BridgeAR BridgeAR added the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 18, 2017
@lance
Copy link
Member Author

lance commented Oct 18, 2017

Running a second CI since lots of flakey tests failed on the first: https://ci.nodejs.org/job/node-test-pull-request/10812/

@lance
Copy link
Member Author

lance commented Oct 18, 2017

Still several unrelated failed tests in CI. I'm not going to detail them here because it's quite tedious. But I wonder if CI flakiness is this getting worse. I see this a lot lately.

Unless anyone objects, I'm going to go ahead and land this tomorrow in spite of CI failures.

lance added a commit that referenced this pull request Oct 19, 2017
This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.

PR-URL: #16242
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Jeremiah Senkpiel <[email protected]>
@lance
Copy link
Member Author

lance commented Oct 19, 2017

Landed in: 7a29f44

@lance lance closed this Oct 19, 2017
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 26, 2017
This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.

PR-URL: nodejs/node#16242
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Jeremiah Senkpiel <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
This method is only useful for the internal mechanics of the REPLServer
and does not need to be exposed in user space. It was previously not
documented, so I believe a Runtime deprecation makes sense.

PR-URL: nodejs/node#16242
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Jeremiah Senkpiel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. repl Issues and PRs related to the REPL subsystem. 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