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

lib,test: deprecate _linklist #3078

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@Trott
Member

Trott commented Sep 26, 2015

_linklist is undocumented but exposed. Its implementation is closely tied to timers.js. (They share ._idleNext and ._idlePrev properties on the same objects.) This PR proposes moving it to lib/internal for timer.js use and deprecates it elsewhere in the next major version.

/cc @Fishrock123

@ChALkeR

This comment has been minimized.

Member

ChALkeR commented Sep 27, 2015

Once again, for the reference: a quick grep on expression: require(._linklist.
Based on 100% of current versions of npm packages, but it could contain both false negatives and false positives.

ape-algorithm-0.0.8.tgz/linklist.js:2://var L = require('_linklist');
biojs-vis-blast-0.1.5.tgz/node/lib/timers.js:23:var L = require('_linklist');
biojs-vis-blast-0.1.5.tgz/node/test/simple/test-timers-linked-list.js:24:var L = require('_linklist');
candle-0.4.0.tgz/timers.js:23:var L = require('_linklist');
chromify-0.0.2.tgz/builtins/timers.js:23:var L = require('_linklist');
commonjs-everywhere-0.9.7.tgz/node/lib/timers.js:23:var L = require('_linklist');
flush-all-0.1.1.tgz/node-v0.13/lib/timers.js:25:var L = require('_linklist');
flush-all-0.1.1.tgz/node-v0.13/test/simple/test-timers-linked-list.js:24:var L = require('_linklist');
jsg-0.0.3.tgz/testdata/node_core_modules/timers.js:23:var L = require('_linklist');
micropromise-0.4.10.tgz/promise-bench/benchmark/lib/timers-ctx.js:23:var L = require('_linklist');
node-cjs-deps-0.2.2.tgz/nodeCjsDeps/Global.js:19:       _linklist = require('_linklist'),
node-core-lib-0.11.11.tgz/timers.js:23:var L = require('_linklist');
node-core-test-simple-0.11.11.tgz/test-timers-linked-list.js:24:var L = require('_linklist');
node-natives-0.10.25.tgz/timers.js:23:var L = require('_linklist');
perf-time-0.1.0.tgz/bench/settimeout/timers2.js:23:var L = require('_linklist');
perf-time-0.1.0.tgz/bench/settimeout/timers3.js:23:var L = require('_linklist');
perf-time-0.1.0.tgz/bench/settimeout/timers.js:23:var L = require('_linklist');
perf-timers-0.1.0.tgz/bench/settimeout/timers2.js:23:var L = require('_linklist');
perf-timers-0.1.0.tgz/bench/settimeout/timers3.js:23:var L = require('_linklist');
perf-timers-0.1.0.tgz/bench/settimeout/timers.js:23:var L = require('_linklist');
pezhu-0.0.0.tgz/Downloads/node-v0.9.11/lib/timers.js:23:var L = require('_linklist');
pezhu-0.0.0.tgz/Downloads/node-v0.9.11/test/simple/test-timers-linked-list.js:24:var L = require('_linklist');
portable-js-0.0.3.tgz/misc/io/timers.js:4:const L = require('_linklist');
portable-js-0.0.3.tgz/misc/node/timers.js:25:var L = require('_linklist');
promise-bench-0.0.2.tgz/benchmark/lib/timers-ctx.js:23:var L = require('_linklist');
wtfnode-0.2.1.tgz/index.js:28:    var L = require('_linklist');

That's actually 17 packages, but we could even file issues to each of them in advance.

@ChALkeR ChALkeR referenced this pull request Sep 27, 2015

Closed

lib: replace _linklist with ES6 Sets #2973

2 of 4 tasks complete
@@ -39,6 +38,7 @@
'lib/_http_outgoing.js',
'lib/_http_server.js',
'lib/https.js',
'lib/_linklist.js',

This comment has been minimized.

@ChALkeR

ChALkeR Sep 27, 2015

Member

Did this get moved for a reason?

This comment has been minimized.

@Trott

Trott Sep 27, 2015

Member

The list of files in lib appeared to be in alphabetical order (ignoring leading _ chars) with _linklist appearing to be one of a small number of exceptions. (_debug* is another but I left those). So I moved it to the logical-seeming place in the list. Seemed like a good idea at the time, but happy to move it back if there is any objection to it whatsoever.

@ChALkeR

View changes

node.gyp Outdated
'lib/internal/repl.js',
'lib/internal/socket_list.js',

This comment has been minimized.

@ChALkeR

ChALkeR Sep 27, 2015

Member

Did this get moved for a reason?

This comment has been minimized.

@Trott

Trott Sep 27, 2015

Member

Every other file in lib/internal' was listed in alphabetical order (ignoring leading_` chars) so I moved this one to conform. I don't feel strongly about it and am happy to move it back if need be.

@ChALkeR

This comment has been minimized.

Member

ChALkeR commented Sep 27, 2015

Please check the file test/parallel/test-timers-linked-list.js#L4 — it's using require('_linklist') too.

@Trott Trott force-pushed the Trott:deprecate-linklist branch Sep 27, 2015

@Trott

This comment has been minimized.

Member

Trott commented Sep 27, 2015

@ChALkeR Thanks. I saw that but figured there was nothing to change because deprecated functionality needs tests too. But now I've looked at test-freelist.js and I've emulated the assertion there that checks that the internal module is identical to the public deprecated module.

@Trott

This comment has been minimized.

Member

Trott commented Sep 27, 2015

@Fishrock123

This comment has been minimized.

Member

Fishrock123 commented Sep 30, 2015

+0

Unlike the others, _linklist is in no way a maintenance burden, and will almost certainly never change.

(Shouldn't it be _linkedlist though? /bikeshed/)

@Trott

This comment has been minimized.

Member

Trott commented Sep 30, 2015

@Fishrock123 Let me see if I can nudge you towards a +1 or at least a +0.25:

  • If we leave it publicly available, it means more userland modules can start using it. Which leads to...
  • ...while we may not want to change it ever, we may want it to go away. For example, if there is a linked list construct in ES 2029, and it happens to be significantly faster than _linklist, we may want to get rid of it. The more modules that depend on it, the harder it will be to get rid of.
@Trott

This comment has been minimized.

Member

Trott commented Oct 2, 2015

This isn't getting a whole lot of traction and isn't exactly a matter of life-and-death, so I'm going to go ahead and close it.

@Trott Trott closed this Oct 2, 2015

@ChALkeR

This comment has been minimized.

Member

ChALkeR commented Oct 2, 2015

@Fishrock123 This module really doesn't belong to Node.js (as a matter of being a public module instead of an internal one). It was also not intended to be public.
I would recommend killing public access to it while it is used by 17 npm packages, not waiting for that number to become 17000.

@Trott I am sure that this discussion was overlooked.
/cc @nodejs/collaborators

@mscdex

This comment has been minimized.

Contributor

mscdex commented Oct 2, 2015

I'm +1 to deprecating public access to it. The underscore prefix is/was a good visual indicator that it is/was not designed to be public anyway and shouldn't have been relied on in the first place.

@Trott Trott reopened this Oct 2, 2015

@Trott Trott force-pushed the Trott:deprecate-linklist branch 4 times, most recently Oct 3, 2015

@Trott Trott changed the title from lib: deprecate _linklist to lib,test: deprecate _linklist Oct 3, 2015

@Trott

This comment has been minimized.

Member

Trott commented Oct 3, 2015

So this gets a +0 from @Fishrock123 which I'm taking to mean roughly "I don't object to this but I don't endorse it either."

And it gets a +1 from @mscdex and some supportive comments from @ChALkeR.

Any chance either of you (or anyone else) on the +1-ish end feel good enough about this to LGTM it? If not, how do we get there?

@ChALkeR

This comment has been minimized.

Member

ChALkeR commented Oct 3, 2015

@Trott That's a +1 from me.

@ChALkeR

This comment has been minimized.

Member

ChALkeR commented Oct 3, 2015

LGTM.
/cc @rvagg for semver-major.

@Fishrock123

This comment has been minimized.

Member

Fishrock123 commented Oct 3, 2015

To be clear: things currently in node effectively belong in node.

That being said, let's axe this, but we should probably make a clone on npm for those modules to use.

On Oct 3, 2015, at 11:31 AM, Сковорода Никита Андреевич notifications@github.com wrote:

LGTM.


Reply to this email directly or view it on GitHub.

@Trott

This comment has been minimized.

Member

Trott commented Oct 3, 2015

FWIW there is already a linklist module on npm that appears to be Node core's _linklist with some extras. I haven't tried it (yet) but it's quite likely a drop-in replacement. Hasn't been touched in three years or so, but this isn't code that changes much.

@Trott

This comment has been minimized.

Member

Trott commented Oct 4, 2015

FWIW part 2, I went through the 17 modules and 11 are false positives or abandonware that's already broken. The 6 remaining modules are:

  • candle (PR submitted: AlexeyKupershtokh/node-candle#4)
  • node-cjs-deps (PR submitted: ayecue/node-cjs-deps#1)
  • wtfnode (From module README: "This module wraps and depends on private Node methods. It is in no way guaranteed to work now or ever.")
  • perf-time (benchmarks code only, hey we're not removing, just giving a deprecation warning)
  • perf-timers (benchmarks code only, hey we're not removing, just giving a deprecation warning)
  • promise-bench (benchmarks code only, hey we're not removing, just giving a deprecation warning)

Task check boxes are there to be ticked off as PRs are submitted to the projects to remove the dependency on _linklist or the issue is otherwise somehow addressed. (Only the first three actually use _linklist in the module code per se. The last three only use it in benchmark tests.)

@Trott

This comment has been minimized.

Member

Trott commented Oct 5, 2015

I think this is now good-to-go from a don't-break-the-ecosystem perspective. PRs are now in on the two modules that most legitimately-ish use _linklist. One other module is all "this module does terrible things with node internals and might break at any time" in its docs. The others just use it for benchmark code.

But most importantly, we're not removing _linklist so none of this code will truly break. It's just getting deprecated. So a warning will be logged is all. (And I'm personally fine if it's a case of "deprecated forever and never actually removed".)

@Fishrock123 Fishrock123 added this to the 5.0.0 milestone Oct 5, 2015

@Fishrock123

View changes

lib/_linklist.js Outdated
}
exports.isEmpty = isEmpty;
module.exports = require('internal/linklist');
util.printDeprecationMessage('_linklist module is deprecated.');

This comment has been minimized.

@Fishrock123

Fishrock123 Oct 5, 2015

Member

"please use a user-land alternative?"

@Fishrock123

View changes

lib/internal/linklist.js Outdated
@@ -0,0 +1,57 @@
'use strict';

This comment has been minimized.

@Fishrock123

Fishrock123 Oct 5, 2015

Member

Can you rename this to "linkedlist"? :P

@Fishrock123

This comment has been minimized.

Member

Fishrock123 commented Oct 5, 2015

LGTM otherwise for v5

@Trott Trott force-pushed the Trott:deprecate-linklist branch Oct 5, 2015

@Trott

This comment has been minimized.

Member

Trott commented Oct 5, 2015

@Trott

This comment has been minimized.

Member

Trott commented Oct 5, 2015

Some meta stuff:

  • Since this is semver-major, this needs review by @nodejs/tsc, right? (At least, that's what I'm reading in the onboarding.md gist.)
  • When this lands, it should land on master as usual, right? The semver-major tag doesn't change that, right?
@Fishrock123

This comment has been minimized.

Member

Fishrock123 commented Oct 6, 2015

  1. Yes. For this I feel it's reasonable for me to sign-off, but I'll tag it for the TSC agenda.
  2. Correct, it will land on master.
@Trott

This comment has been minimized.

Member

Trott commented Oct 8, 2015

Listening to the TSC meeting audio from yesterday, it sounds like this is OK to move forward. I'll rebase, rerun CI, and land this in master in the next few hours unless someone objects.

@Fishrock123

This comment has been minimized.

Member

Fishrock123 commented Oct 8, 2015

Cormiming this has the go-ahead from TSC. LGTM.

lib,test: deprecate _linklist
Deprecate _linklist and add test to confirm internal linklist and
public _linklist are the same.

@Trott Trott force-pushed the Trott:deprecate-linklist branch to f15c290 Oct 8, 2015

@Trott

This comment has been minimized.

Member

Trott commented Oct 8, 2015

@Trott

This comment has been minimized.

Member

Trott commented Oct 9, 2015

Landed in 47befff

@Trott Trott closed this Oct 9, 2015

Trott added a commit that referenced this pull request Oct 9, 2015

lib,test: deprecate _linklist
Deprecate _linklist and add test to confirm internal linklist and
public _linklist are the same.

PR-URL: #3078
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>

@rvagg rvagg referenced this pull request Oct 27, 2015

Merged

Release proposal: v5.0.0 #3466

rvagg added a commit to rvagg/io.js that referenced this pull request Oct 29, 2015

2015-10-29, Version 5.0.0 (Stable)
Notable changes:

* buffer: (Breaking) Removed both 'raw' and 'raws' encoding types from Buffer,
  these have been deprecated for a long time (Sakthipriyan Vairamani) nodejs#2859.
* console: (Breaking) Values reported by console.time() now have 3 decimals of
  accuracy added (Michaël Zasso) nodejs#3166.
* fs:
  - fs.readFile*(), fs.writeFile*(), and fs.appendFile*() now also accept a file
    descriptor as their first argument (Johannes Wüller) nodejs#3163.
  - (Breaking) In fs.readFile(), if an encoding is specified and the internal
    toString() fails the error is no longer thrown but is passed to the callback
    (Evan Lucas) nodejs#3485.
  - (Breaking) In fs.read() (using the fs.read(fd, length, position, encoding,
    callback) form), if the internal toString() fails the error is no longer
    thrown but is passed to the callback (Evan Lucas) nodejs#3503.
* http:
  - Fixed a bug where pipelined http requests would stall (Fedor Indutny) nodejs#3342.
  - (Breaking) When parsing HTTP, don't add duplicates of the following headers:
    Retry-After, ETag, Last-Modified, Server, Age, Expires. This is in addition
    to the following headers which already block duplicates: Content-Type,
    Content-Length, User-Agent, Referer, Host, Authorization,
    Proxy-Authorization, If-Modified-Since, If-Unmodified-Since, From, Location,
    Max-Forwards (James M Snell) nodejs#3090.
  - (Breaking) The callback argument to OutgoingMessage#setTimeout() must be a
    function or a TypeError is thrown (James M Snell) nodejs#3090.
  - (Breaking) HTTP methods and header names must now conform to the RFC 2616
    "token" rule, a list of allowed characters that excludes control characters
    and a number of separator characters. Specifically, methods and header names
    must now match /^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/ or a TypeError will be thrown
    (James M Snell) nodejs#2526.
* node:
  - (Breaking) Deprecated the _linklist module (Rich Trott) nodejs#3078.
  - (Breaking) Removed require.paths and require.registerExtension(), both had
    been previously set to throw Error when accessed
    (Sakthipriyan Vairamani) nodejs#2922.
* npm: Upgraded to version 3.3.6 from 2.14.7, see
  https://github.com/npm/npm/releases/tag/v3.3.6 for more details. This is a
  major version bump for npm and it has seen a significant amount of change.
  Please see the original npm v3.0.0 release notes for a list of major changes
  (Rebecca Turner) nodejs#3310.
* src: (Breaking) Bumped NODE_MODULE_VERSION to 47 from 46, this is necessary
  due to the V8 upgrade. Native add-ons will need to be recompiled
  (Rod Vagg) nodejs#3400.
* timers: Attempt to reuse the timer handle for setTimeout().unref(). This fixes
  a long-standing known issue where unrefed timers would perviously hold
  beforeExit open (Fedor Indutny) nodejs#3407.
* tls:
  - Added ALPN Support (Shigeki Ohtsu) nodejs#2564.
  - TLS options can now be passed in an object to createSecurePair()
    (Коренберг Марк) nodejs#2441.
  - (Breaking) The default minimum DH key size for tls.connect() is now 1024
    bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent "logjam" attacks. A new minDHSize TLS
    option can be used to override the default. (Shigeki Ohtsu) nodejs#1831.
* util:
  - (Breaking) util.p() was deprecated for years, and has now been removed
    (Wyatt Preul) nodejs#3432.
  - (Breaking) util.inherits() can now work with ES6 classes. This is considered
    a breaking change because of potential subtle side-effects caused by a
    change from directly reassigning the prototype of the constructor using
    `ctor.prototype = Object.create(superCtor.prototype, { constructor: { ... } })`
    to using `Object.setPrototypeOf(ctor.prototype, superCtor.prototype)`
    (Michaël Zasso) nodejs#3455.
* v8: (Breaking) Upgraded to 4.6.85.25 from 4.5.103.35 (Ali Ijaz Sheikh) nodejs#3351.
  - Implements the spread operator, see
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator
    for further information.
  - Implements new.target, see
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target
    for further information.
* zlib: Decompression now throws on truncated input (e.g. unexpected end of
  file) (Yuval Brik) nodejs#2595.

PR-URL: nodejs#3466

rvagg added a commit that referenced this pull request Oct 29, 2015

2015-10-29, Version 5.0.0 (Stable)
Notable changes:

* buffer: (Breaking) Removed both 'raw' and 'raws' encoding types from Buffer,
  these have been deprecated for a long time (Sakthipriyan Vairamani) #2859.
* console: (Breaking) Values reported by console.time() now have 3 decimals of
  accuracy added (Michaël Zasso) #3166.
* fs:
  - fs.readFile*(), fs.writeFile*(), and fs.appendFile*() now also accept a file
    descriptor as their first argument (Johannes Wüller) #3163.
  - (Breaking) In fs.readFile(), if an encoding is specified and the internal
    toString() fails the error is no longer thrown but is passed to the callback
    (Evan Lucas) #3485.
  - (Breaking) In fs.read() (using the fs.read(fd, length, position, encoding,
    callback) form), if the internal toString() fails the error is no longer
    thrown but is passed to the callback (Evan Lucas) #3503.
* http:
  - Fixed a bug where pipelined http requests would stall (Fedor Indutny) #3342.
  - (Breaking) When parsing HTTP, don't add duplicates of the following headers:
    Retry-After, ETag, Last-Modified, Server, Age, Expires. This is in addition
    to the following headers which already block duplicates: Content-Type,
    Content-Length, User-Agent, Referer, Host, Authorization,
    Proxy-Authorization, If-Modified-Since, If-Unmodified-Since, From, Location,
    Max-Forwards (James M Snell) #3090.
  - (Breaking) The callback argument to OutgoingMessage#setTimeout() must be a
    function or a TypeError is thrown (James M Snell) #3090.
  - (Breaking) HTTP methods and header names must now conform to the RFC 2616
    "token" rule, a list of allowed characters that excludes control characters
    and a number of separator characters. Specifically, methods and header names
    must now match /^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/ or a TypeError will be thrown
    (James M Snell) #2526.
* node:
  - (Breaking) Deprecated the _linklist module (Rich Trott) #3078.
  - (Breaking) Removed require.paths and require.registerExtension(), both had
    been previously set to throw Error when accessed
    (Sakthipriyan Vairamani) #2922.
* npm: Upgraded to version 3.3.6 from 2.14.7, see
  https://github.com/npm/npm/releases/tag/v3.3.6 for more details. This is a
  major version bump for npm and it has seen a significant amount of change.
  Please see the original npm v3.0.0 release notes for a list of major changes
  (Rebecca Turner) #3310.
* src: (Breaking) Bumped NODE_MODULE_VERSION to 47 from 46, this is necessary
  due to the V8 upgrade. Native add-ons will need to be recompiled
  (Rod Vagg) #3400.
* timers: Attempt to reuse the timer handle for setTimeout().unref(). This fixes
  a long-standing known issue where unrefed timers would perviously hold
  beforeExit open (Fedor Indutny) #3407.
* tls:
  - Added ALPN Support (Shigeki Ohtsu) #2564.
  - TLS options can now be passed in an object to createSecurePair()
    (Коренберг Марк) #2441.
  - (Breaking) The default minimum DH key size for tls.connect() is now 1024
    bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent "logjam" attacks. A new minDHSize TLS
    option can be used to override the default. (Shigeki Ohtsu) #1831.
* util:
  - (Breaking) util.p() was deprecated for years, and has now been removed
    (Wyatt Preul) #3432.
  - (Breaking) util.inherits() can now work with ES6 classes. This is considered
    a breaking change because of potential subtle side-effects caused by a
    change from directly reassigning the prototype of the constructor using
    `ctor.prototype = Object.create(superCtor.prototype, { constructor: { ... } })`
    to using `Object.setPrototypeOf(ctor.prototype, superCtor.prototype)`
    (Michaël Zasso) #3455.
* v8: (Breaking) Upgraded to 4.6.85.25 from 4.5.103.35 (Ali Ijaz Sheikh) #3351.
  - Implements the spread operator, see
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator
    for further information.
  - Implements new.target, see
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target
    for further information.
* zlib: Decompression now throws on truncated input (e.g. unexpected end of
  file) (Yuval Brik) #2595.

PR-URL: #3466

@ChALkeR ChALkeR removed the tsc-agenda label Nov 11, 2015

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