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

src, buffer: add --pending-deprecation flag #11968

Closed
wants to merge 2 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Mar 21, 2017

This PR was split out of #11808 by request of the @nodejs/ctc.

This adds a new --pending-deprecation command line flag and equivalent NODE_PENDING_DEPRECATION environment variable. These are used to cause
core to emit pending DeprecationWarnings that are off by default.

A pending deprecation warning for use of Buffer() and new Buffer() is included. The pending deprecation warning is off by default and is only emitted when the new pending deprecation
flag is used.

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)

src, buffer

@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Mar 21, 2017
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. labels Mar 21, 2017
lib/buffer.js Outdated
super(arg1, arg2, arg3);
}
}
const FastBuffer = (() => class Buffer extends Uint8Array {})();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a workaround to ensure that Uint8Array inherited methods work correctly. See: #11808 (review)

Copy link
Member

Choose a reason for hiding this comment

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

Can more people please review this specific change for us to be on the safe side?
/cc @nodejs/buffer

Copy link
Member

@addaleax addaleax Mar 22, 2017

Choose a reason for hiding this comment

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

So… what this would break, afaik, is that Buffer.prototype.constructor === Buffer no longer holds true, which is a bit odd but something we might be able to just accept. Everything else, including instanceof and buf.constructor.name, should continue to work fine.

One alternative way that was brought up, and I think I might prefer that, we should be able to set FastBuffer[Symbol.species] to FastBuffer, that should keep the Uint8Array methods working, too. (Didn’t try that out, though).

Copy link
Member

Choose a reason for hiding this comment

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

I added the explicit constructor to fix a performance regression in #8754
Can we keep it or check that current V8 version doesn't have the issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

@addaleax ... setting the Symbol.species on the old version of FastBuffer has no impact, unfortunately. Still playing with it tho

Copy link
Member

Choose a reason for hiding this comment

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

@jasnell Do you have that code pushed somewhere? I mean, if it does have no effect, that would be a bug, right?

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 was hanging the Symbol.species off the wrong thing... attaching it to Buffer[Symbol.species] appears to work. Still testing tho

@ChALkeR
Copy link
Member

ChALkeR commented Mar 22, 2017

Perhaps a testcase for NODE_PENDING_DEPRECATION env variable could be added?

@silverwind
Copy link
Contributor

Both the flag and the env variable need to be documented in node.1, --help, and in cli.md.

@jasnell
Copy link
Member Author

jasnell commented Mar 22, 2017

@ChALkeR @silverwind ... done! I added a new test for both --pending-deprecation and NODE_PENDING_DEPRECATION, and added the documentation for both.

added: REPLACEME
-->

Emit pending deprecation warnings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a sentence with the purpose of a pending deprecation?

Copy link
Member

@Trott Trott Mar 23, 2017

Choose a reason for hiding this comment

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

Optional: Maybe also specify that it's specifically the runtime deprecation that's pending, and that stuff is frequently deprecated in the docs but with no runtime deprecation message. Or something. We differentiate between "runtime deprecation" and "docs deprecation" pretty much everywhere, so it seems like there ought to be some clarity when people are using this flag.

That said, I'm fine with this landing without that information. I know it's crunch time on this stuff right now. It can always be added in a subsequent pull request if it turns out that it's important to include.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to add an explanatory note.

lib/buffer.js Outdated
super(arg1, arg2, arg3);
}
}
const FastBuffer = (() => class Buffer extends Uint8Array {})();
Copy link
Member

Choose a reason for hiding this comment

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

I added the explicit constructor to fix a performance regression in #8754
Can we keep it or check that current V8 version doesn't have the issue?

@jasnell
Copy link
Member Author

jasnell commented Mar 23, 2017

@targos ...

Benchmark results for buffer-from
PR to master

improvement confidence      p.value
buffers/buffer-from.js n=1024 len=10 source="array"                   -16.42 %        *** 7.792262e-11
buffers/buffer-from.js n=1024 len=10 source="arraybuffer-middle"      -21.38 %        *** 2.168308e-06
buffers/buffer-from.js n=1024 len=10 source="arraybuffer"             -22.32 %        *** 2.294274e-09
buffers/buffer-from.js n=1024 len=10 source="buffer"                  -17.65 %        *** 1.350472e-05
buffers/buffer-from.js n=1024 len=10 source="object"                  -12.25 %        *** 1.180961e-06
buffers/buffer-from.js n=1024 len=10 source="string-base64"            -7.05 %        *** 2.333473e-04
buffers/buffer-from.js n=1024 len=10 source="string"                  -12.77 %        *** 6.414072e-04
buffers/buffer-from.js n=1024 len=10 source="uint8array"              -15.14 %        *** 1.109671e-06
buffers/buffer-from.js n=1024 len=2048 source="array"                  -1.83 %            3.509761e-01
buffers/buffer-from.js n=1024 len=2048 source="arraybuffer-middle"    -24.98 %        *** 3.233412e-11
buffers/buffer-from.js n=1024 len=2048 source="arraybuffer"           -18.99 %        *** 1.380310e-07
buffers/buffer-from.js n=1024 len=2048 source="buffer"                 -8.26 %          * 1.192811e-02
buffers/buffer-from.js n=1024 len=2048 source="object"                -13.14 %        *** 1.258989e-07
buffers/buffer-from.js n=1024 len=2048 source="string-base64"          -2.15 %          * 3.041810e-02
buffers/buffer-from.js n=1024 len=2048 source="string"                 -1.00 %            7.109994e-01
buffers/buffer-from.js n=1024 len=2048 source="uint8array"             -6.50 %          * 1.043962e-02

PR to v7-latest

improvement confidence      p.value
buffers/buffer-from.js n=1024 len=10 source="array"                    14.66 %          * 4.128284e-02
buffers/buffer-from.js n=1024 len=10 source="arraybuffer-middle"      -31.02 %        *** 1.252807e-07
buffers/buffer-from.js n=1024 len=10 source="arraybuffer"             -33.07 %        *** 2.434402e-08
buffers/buffer-from.js n=1024 len=10 source="buffer"                   11.13 %            7.116099e-02
buffers/buffer-from.js n=1024 len=10 source="object"                   27.77 %        *** 4.621124e-04
buffers/buffer-from.js n=1024 len=10 source="string-base64"           -18.06 %         ** 2.839069e-03
buffers/buffer-from.js n=1024 len=10 source="string"                  -22.87 %        *** 3.704564e-05
buffers/buffer-from.js n=1024 len=10 source="uint8array"              -10.61 %          * 2.388147e-02
buffers/buffer-from.js n=1024 len=2048 source="array"                  -2.76 %            6.038384e-01
buffers/buffer-from.js n=1024 len=2048 source="arraybuffer-middle"    -32.39 %        *** 2.247906e-08
buffers/buffer-from.js n=1024 len=2048 source="arraybuffer"           -33.12 %        *** 6.387633e-09
buffers/buffer-from.js n=1024 len=2048 source="buffer"                  8.03 %            1.359963e-01
buffers/buffer-from.js n=1024 len=2048 source="object"                 30.79 %        *** 2.044209e-04
buffers/buffer-from.js n=1024 len=2048 source="string-base64"          -2.57 %            6.409698e-01
buffers/buffer-from.js n=1024 len=2048 source="string"                 -8.51 %            8.553839e-02
buffers/buffer-from.js n=1024 len=2048 source="uint8array"            293.43 %        *** 1.781736e-22

master to v7-latest

improvement confidence      p.value
buffers/buffer-from.js n=1024 len=10 source="array"                    37.57 %        *** 1.781021e-12
buffers/buffer-from.js n=1024 len=10 source="arraybuffer-middle"      -13.65 %        *** 4.060694e-07
buffers/buffer-from.js n=1024 len=10 source="arraybuffer"             -12.98 %        *** 2.349020e-05
buffers/buffer-from.js n=1024 len=10 source="buffer"                   26.04 %        *** 4.158553e-10
buffers/buffer-from.js n=1024 len=10 source="object"                   44.97 %        *** 6.654504e-18
buffers/buffer-from.js n=1024 len=10 source="string-base64"           -10.05 %        *** 9.244411e-05
buffers/buffer-from.js n=1024 len=10 source="string"                  -18.68 %        *** 6.452878e-13
buffers/buffer-from.js n=1024 len=10 source="uint8array"                0.37 %            8.982949e-01
buffers/buffer-from.js n=1024 len=2048 source="array"                   3.59 %          * 3.594595e-02
buffers/buffer-from.js n=1024 len=2048 source="arraybuffer-middle"    -14.08 %        *** 2.082821e-04
buffers/buffer-from.js n=1024 len=2048 source="arraybuffer"           -13.67 %        *** 7.702316e-07
buffers/buffer-from.js n=1024 len=2048 source="buffer"                 11.01 %         ** 4.616398e-03
buffers/buffer-from.js n=1024 len=2048 source="object"                 42.88 %        *** 2.021887e-16
buffers/buffer-from.js n=1024 len=2048 source="string-base64"           1.39 %            5.063980e-01
buffers/buffer-from.js n=1024 len=2048 source="string"                 -5.65 %        *** 4.850306e-04
buffers/buffer-from.js n=1024 len=2048 source="uint8array"            321.70 %        *** 2.335348e-28

I'm running the buffer-creation benchmarks now

Benchmark results for buffer-creation
PR vs v7-latest
                                                                    improvement confidence      p.value
 buffers/buffer-creation.js n=1024 len=10 type="buffer()"              -37.70 %        *** 8.170936e-07
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc-fill"       -22.43 %        *** 4.234106e-04
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc"            -18.70 %         ** 2.991527e-03
 buffers/buffer-creation.js n=1024 len=10 type="fast-allocUnsafe"      -39.59 %        *** 2.983973e-09
 buffers/buffer-creation.js n=1024 len=10 type="slow-allocUnsafe"      -25.74 %        *** 5.983443e-05
 buffers/buffer-creation.js n=1024 len=10 type="slow"                  -27.11 %        *** 1.038236e-05
 buffers/buffer-creation.js n=1024 len=1024 type="buffer()"            -28.41 %        *** 2.246628e-05
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc-fill"     -10.43 %            1.321668e-01
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc"          -10.79 %            7.761290e-02
 buffers/buffer-creation.js n=1024 len=1024 type="fast-allocUnsafe"    -29.88 %        *** 2.164879e-06
 buffers/buffer-creation.js n=1024 len=1024 type="slow-allocUnsafe"    -21.92 %        *** 3.027289e-04
 buffers/buffer-creation.js n=1024 len=1024 type="slow"                -23.86 %        *** 3.208618e-04
 buffers/buffer-creation.js n=1024 len=2048 type="buffer()"            -22.88 %         ** 1.258741e-03
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc-fill"      -9.78 %            1.632281e-01
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc"          -11.73 %          * 4.364843e-02
 buffers/buffer-creation.js n=1024 len=2048 type="fast-allocUnsafe"    -22.75 %        *** 7.573624e-04
 buffers/buffer-creation.js n=1024 len=2048 type="slow-allocUnsafe"    -19.22 %         ** 6.876306e-03
 buffers/buffer-creation.js n=1024 len=2048 type="slow"                -19.85 %         ** 1.531455e-03
 buffers/buffer-creation.js n=1024 len=4096 type="buffer()"             -9.88 %            1.343226e-01
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc-fill"     -12.65 %          * 3.085357e-02
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc"           -6.36 %            2.733906e-01
 buffers/buffer-creation.js n=1024 len=4096 type="fast-allocUnsafe"    -10.92 %            1.366664e-01
 buffers/buffer-creation.js n=1024 len=4096 type="slow-allocUnsafe"    -19.47 %         ** 8.094237e-03
 buffers/buffer-creation.js n=1024 len=4096 type="slow"                -18.56 %         ** 3.257171e-03
 buffers/buffer-creation.js n=1024 len=8192 type="buffer()"            -25.61 %        *** 8.851354e-04
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc-fill"     -25.86 %        *** 3.210301e-05
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc"          -18.27 %         ** 1.576755e-03
 buffers/buffer-creation.js n=1024 len=8192 type="fast-allocUnsafe"    -24.54 %         ** 1.267306e-03
 buffers/buffer-creation.js n=1024 len=8192 type="slow-allocUnsafe"    -22.22 %         ** 2.361535e-03
 buffers/buffer-creation.js n=1024 len=8192 type="slow"                -24.95 %         ** 1.274023e-03

PR to Master
                                                                    improvement confidence      p.value
 buffers/buffer-creation.js n=1024 len=10 type="buffer()"              -23.82 %        *** 4.603310e-07
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc-fill"        -8.98 %          * 4.796022e-02
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc"             -9.66 %          * 2.705076e-02
 buffers/buffer-creation.js n=1024 len=10 type="fast-allocUnsafe"      -21.20 %        *** 1.350862e-04
 buffers/buffer-creation.js n=1024 len=10 type="slow-allocUnsafe"       -8.17 %          * 4.477244e-02
 buffers/buffer-creation.js n=1024 len=10 type="slow"                   -8.14 %            7.364837e-02
 buffers/buffer-creation.js n=1024 len=1024 type="buffer()"            -12.14 %         ** 1.536780e-03
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc-fill"      -2.95 %            4.062755e-01
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc"           -7.04 %            6.421243e-02
 buffers/buffer-creation.js n=1024 len=1024 type="fast-allocUnsafe"    -21.17 %        *** 3.190386e-04
 buffers/buffer-creation.js n=1024 len=1024 type="slow-allocUnsafe"     -5.00 %            2.486273e-01
 buffers/buffer-creation.js n=1024 len=1024 type="slow"                 -2.82 %            5.463033e-01
 buffers/buffer-creation.js n=1024 len=2048 type="buffer()"             -4.22 %            4.282637e-01
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc-fill"      -6.86 %          * 4.507429e-02
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc"           -4.34 %            3.098785e-01
 buffers/buffer-creation.js n=1024 len=2048 type="fast-allocUnsafe"    -12.63 %          * 1.633488e-02
 buffers/buffer-creation.js n=1024 len=2048 type="slow-allocUnsafe"     -0.03 %            9.952215e-01
 buffers/buffer-creation.js n=1024 len=2048 type="slow"                 -1.11 %            8.161170e-01
 buffers/buffer-creation.js n=1024 len=4096 type="buffer()"              3.13 %            5.248264e-01
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc-fill"      -5.42 %            1.418995e-01
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc"           -6.19 %            8.675164e-02
 buffers/buffer-creation.js n=1024 len=4096 type="fast-allocUnsafe"     -5.31 %            2.569296e-01
 buffers/buffer-creation.js n=1024 len=4096 type="slow-allocUnsafe"     -1.27 %            8.108671e-01
 buffers/buffer-creation.js n=1024 len=4096 type="slow"                 -0.12 %            9.768392e-01
 buffers/buffer-creation.js n=1024 len=8192 type="buffer()"             15.40 %            1.746439e-01
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc-fill"      -1.56 %            8.272071e-01
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc"           -2.94 %            7.164391e-01
 buffers/buffer-creation.js n=1024 len=8192 type="fast-allocUnsafe"      4.65 %            6.791579e-01
 buffers/buffer-creation.js n=1024 len=8192 type="slow-allocUnsafe"    -15.99 %            9.725391e-02
 buffers/buffer-creation.js n=1024 len=8192 type="slow"                -15.01 %            1.110732e-01

master to v7-latest

                                                                    improvement confidence      p.value
 buffers/buffer-creation.js n=1024 len=10 type="buffer()"              -19.82 %        *** 2.918161e-06
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc-fill"       -13.46 %        *** 2.816522e-04
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc"             -7.80 %         ** 9.382877e-03
 buffers/buffer-creation.js n=1024 len=10 type="fast-allocUnsafe"      -20.60 %        *** 2.080874e-09
 buffers/buffer-creation.js n=1024 len=10 type="slow-allocUnsafe"       -9.86 %        *** 4.085916e-04
 buffers/buffer-creation.js n=1024 len=10 type="slow"                  -11.86 %         ** 2.226668e-03
 buffers/buffer-creation.js n=1024 len=1024 type="buffer()"            -18.86 %        *** 1.114447e-06
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc-fill"     -11.83 %        *** 3.524462e-04
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc"           -9.32 %         ** 8.059771e-03
 buffers/buffer-creation.js n=1024 len=1024 type="fast-allocUnsafe"     -9.28 %         ** 1.530503e-03
 buffers/buffer-creation.js n=1024 len=1024 type="slow-allocUnsafe"     -7.37 %         ** 1.946543e-03
 buffers/buffer-creation.js n=1024 len=1024 type="slow"                 -8.66 %         ** 2.212602e-03
 buffers/buffer-creation.js n=1024 len=2048 type="buffer()"             -9.55 %         ** 1.281355e-03
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc-fill"      -8.09 %          * 1.395453e-02
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc"           -4.03 %            1.707212e-01
 buffers/buffer-creation.js n=1024 len=2048 type="fast-allocUnsafe"     -7.36 %          * 4.570890e-02
 buffers/buffer-creation.js n=1024 len=2048 type="slow-allocUnsafe"     -5.30 %            1.155574e-01
 buffers/buffer-creation.js n=1024 len=2048 type="slow"                 -7.37 %         ** 1.663168e-03
 buffers/buffer-creation.js n=1024 len=4096 type="buffer()"             -6.45 %         ** 1.664182e-03
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc-fill"      -7.76 %          * 2.186373e-02
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc"           -2.32 %            2.932382e-01
 buffers/buffer-creation.js n=1024 len=4096 type="fast-allocUnsafe"     -6.03 %         ** 4.181543e-03
 buffers/buffer-creation.js n=1024 len=4096 type="slow-allocUnsafe"     -6.37 %         ** 8.358552e-03
 buffers/buffer-creation.js n=1024 len=4096 type="slow"                 -7.15 %          * 1.098388e-02
 buffers/buffer-creation.js n=1024 len=8192 type="buffer()"            -19.75 %         ** 8.360417e-03
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc-fill"     -20.11 %        *** 1.702175e-04
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc"          -19.21 %        *** 3.986116e-04
 buffers/buffer-creation.js n=1024 len=8192 type="fast-allocUnsafe"    -26.04 %        *** 6.409609e-04
 buffers/buffer-creation.js n=1024 len=8192 type="slow-allocUnsafe"    -27.41 %        *** 6.028415e-04
 buffers/buffer-creation.js n=1024 len=8192 type="slow"                -19.57 %          * 1.026433e-02

@ChALkeR
Copy link
Member

ChALkeR commented Mar 25, 2017

For the record, a heavy +1 for me on this one, but I'm not posting an LGTM because I'm not 100% sure how exactly does the workaround on the FastBuffer line work here.

@ChALkeR ChALkeR added this to the 8.0.0 milestone Mar 25, 2017
@ChALkeR
Copy link
Member

ChALkeR commented Mar 25, 2017

We surely can get this in in time for 8.0, right? ;-)

@jasnell
Copy link
Member Author

jasnell commented Mar 25, 2017 via email

@targos
Copy link
Member

targos commented Mar 25, 2017

I'm not that happy with the FastBuffer work around either given the perf
hit.

The work around does not work if you implement constructor ?

@jasnell
Copy link
Member Author

jasnell commented Mar 25, 2017

It does! Just did that. It appears to alleviate some of the perf cost (not all but some).

@jasnell
Copy link
Member Author

jasnell commented Mar 25, 2017

I will update the PR in a minute

@jasnell
Copy link
Member Author

jasnell commented Mar 25, 2017

@ChALkeR ChALkeR added the security Issues and PRs related to security. label Mar 25, 2017
@Trott Trott added the notable-change PRs with changes that should be highlighted in changelogs. label Mar 25, 2017
@jasnell
Copy link
Member Author

jasnell commented Mar 27, 2017

@nodejs/ctc ... one final check on this before it lands. Are there any objections? Should I hold off until the CTC call on Wednesday?

@ChALkeR
Copy link
Member

ChALkeR commented Mar 27, 2017

@jasnell I'm not sure if this isn't a semver-major because of #11968 (comment).

This isn't an objection, though.

@jasnell
Copy link
Member Author

jasnell commented Mar 27, 2017

I'm ok with making it a semver-major

@ChALkeR
Copy link
Member

ChALkeR commented Mar 31, 2017

Ok, let's have a quick 🚲🏡 vote here.

Please edit this comment, adding your opinion for each of the flag names.
I know this is cumbersome, but it's still better than having everyone to post a comment.
/cc @nodejs/ctc

Empty No/Abstain fields are hidden to save space, please uncomment them on first use.

--pending-deprecation

Yes: @ChALkeR @Trott @jasnell @targos

--warn-deprecation

No: @ChALkeR @Trott @jasnell @targos

--warn-doc-deprecation

No: @ChALkeR @Trott @jasnell @targos

--flagged-deprecation

Yes: @ChALkeR
No: @targos
Abstain: @Trott @jasnell

--opt-in-deprecate or --opt-in-deprecation

Yes: @ChALkeR @Trott @jasnell

Abstain: @targos

--pending-runtime-deprecation

Yes: @ChALkeR @Trott @targos

--pending-warn-deprecation

No: @targos

--pending-warning


It's ok to propose new flag names right here below this line, using the template above:

@jasnell
Copy link
Member Author

jasnell commented Apr 5, 2017

@nodejs/ctc ... Given that this has enough votes to land using the --pending-deprecation name, I plan to land it Friday if there are no further objections

@jasnell
Copy link
Member Author

jasnell commented Apr 17, 2017

It's a bit later, but one final call for objections on landing this as --pending-deprecation.

@jasnell
Copy link
Member Author

jasnell commented Apr 19, 2017

jasnell added a commit that referenced this pull request Apr 19, 2017
Command line flag and environment variable that can be used to
indicate that pending deprecations should be emitted.

PR-URL: #11968
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell added a commit that referenced this pull request Apr 19, 2017
The pending deprecation warning is off by default.
Launch the node process with --pending-deprecation
or NODE_PENDING_DEPRECATION=1 env var set.

PR-URL: #11968
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Apr 19, 2017

Landed in a16b570 and d2d32ea

@jasnell jasnell closed this Apr 19, 2017
@Trott Trott removed the ctc-review label Apr 24, 2017
@jasnell jasnell mentioned this pull request May 11, 2017
jasnell added a commit to jasnell/node that referenced this pull request May 29, 2017
* **Async Hooks**
  * The `async_hooks` module has landed in core
    [[`4a7233c178`](nodejs@4a7233c178)]
    [nodejs#12892](nodejs#12892).

* **Buffer**
  * Using the `--pending-deprecation` flag will cause Node.js to emit a
    deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
    [[`d2d32ea5a2`](nodejs@d2d32ea5a2)]
    [nodejs#11968](nodejs#11968).
  * `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
    [[`7eb1b4658e`](nodejs@7eb1b4658e)]
    [nodejs#12141](nodejs#12141).
  * Many `Buffer` methods now accept `Uint8Array` as input
    [[`beca3244e2`](nodejs@beca3244e2)]
    [nodejs#10236](nodejs#10236).

* **Child Process**
  * Argument and kill signal validations have been improved
    [[`97a77288ce`](nodejs@97a77288ce)]
    [nodejs#12348](nodejs#12348),
    [[`d75fdd96aa`](nodejs@d75fdd96aa)]
    [nodejs#10423](nodejs#10423).
  * Child Process methods accept `Uint8Array` as input
    [[`627ecee9ed`](nodejs@627ecee9ed)]
    [nodejs#10653](nodejs#10653).

* **Console**
  * Error events emitted when using `console` methods are now supressed.
    [[`f18e08d820`](nodejs@f18e08d820)]
    [nodejs#9744](nodejs#9744).

* **Dependencies**
  * The npm client has been updated to 5.0.0
    [[`3c3b36af0f`](nodejs@3c3b36af0f)]
    [nodejs#12936](nodejs#12936).
  * V8 has been updated to 5.8 with forward ABI stability to 6.0
    [[`60d1aac8d2`](nodejs@60d1aac8d2)]
    [nodejs#12784](nodejs#12784).

* **Domains**
  * Native `Promise` instances are now `Domain` aware
    [[`84dabe8373`](nodejs@84dabe8373)]
    [nodejs#12489](nodejs#12489).

* **Errors**
  * We have started assigning static error codes to errors generated by Node.js.
    This has been done through multiple commits and is still a work in
    progress.

* **File System**
  * The utility class `fs.SyncWriteStream` has been deprecated
    [[`7a55e34ef4`](nodejs@7a55e34ef4)]
    [nodejs#10467](nodejs#10467).
  * The deprecated `fs.read()` string interface has been removed
    [[`3c2a9361ff`](nodejs@3c2a9361ff)]
    [nodejs#9683](nodejs#9683).

* **HTTP**
  * Improved support for userland implemented Agents
    [[`90403dd1d0`](nodejs@90403dd1d0)]
    [nodejs#11567](nodejs#11567).
  * Outgoing Cookie headers are concatenated into a single string
    [[`d3480776c7`](nodejs@d3480776c7)]
    [nodejs#11259](nodejs#11259).
  * The `httpResponse.writeHeader()` method has been deprecated
    [[`fb71ba4921`](nodejs@fb71ba4921)]
    [nodejs#11355](nodejs#11355).
  * New methods for accessing HTTP headers have been added to `OutgoingMessage`
    [[`3e6f1032a4`](nodejs@3e6f1032a4)]
    [nodejs#10805](nodejs#10805).

* **Lib**
  * All deprecation messages have been assigned static identifiers
    [[`5de3cf099c`](nodejs@5de3cf099c)]
    [nodejs#10116](nodejs#10116).
  * The legacy `linkedlist` module has been removed
    [[`84a23391f6`](nodejs@84a23391f6)]
    [nodejs#12113](nodejs#12113).

* **N-API**
  * Experimental support for the new N-API API has been added
    [[`56e881d0b0`](nodejs@56e881d0b0)]
    [nodejs#11975](nodejs#11975).

* **Process**
  * Process warning output can be redirected to a file using the
    `--redirect-warnings` command-line argument
    [[`03e89b3ff2`](nodejs@03e89b3ff2)]
    [nodejs#10116](nodejs#10116).
  * Process warnings may now include additional detail
    [[`dd20e68b0f`](nodejs@dd20e68b0f)]
    [nodejs#12725](nodejs#12725).

* **REPL**
  * REPL magic mode has been deprecated
    [[`3f27f02da0`](nodejs@3f27f02da0)]
    [nodejs#11599](nodejs#11599).

* **Src**
  * `NODE_MODULE_VERSION` has been updated to 57
    (nodejs@ec7cbaf266)]
    [nodejs#12995](nodejs#12995).
  * Add `--pending-deprecation` command-line argument and
    `NODE_PENDING_DEPRECATION` environment variable
    [[`a16b570f8c`](nodejs@a16b570f8c)]
    [nodejs#11968](nodejs#11968).
  * The `--debug` command-line argument has been deprecated. Note that
    using `--debug` will enable the *new* Inspector-based debug protocol
    as the legacy Debugger protocol previously used by Node.js has been
    removed. [[`010f864426`](nodejs@010f864426)]
    [nodejs#12949](nodejs#12949).
  * Throw when the `-c` and `-e` command-line arguments are used at the same
    time [[`a5f91ab230`](nodejs@a5f91ab230)]
    [nodejs#11689](nodejs#11689).
  * Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
    arguments are used at the same time.
    [[`8a7db9d4b5`](nodejs@8a7db9d4b5)]
    [nodejs#12087](nodejs#12087).

* **Stream**
  * `Stream` now supports `destroy()` and `_destroy()` APIs
    [[`b6e1d22fa6`](nodejs@b6e1d22fa6)]
    [nodejs#12925](nodejs#12925).
  * `Stream` now supports the `_final()` API
    [[`07c7f198db`](nodejs@07c7f198db)]
    [nodejs#12828](nodejs#12828).

* **TLS**
  * The `rejectUnauthorized` option now defaults to `true`
    [[`348cc80a3c`](nodejs@348cc80a3c)]
    [nodejs#5923](nodejs#5923).
  * The `tls.createSecurePair()` API now emits a runtime deprecation
    [[`a2ae08999b`](nodejs@a2ae08999b)]
    [nodejs#11349](nodejs#11349).
  * A runtime deprecation will now be emitted when `dhparam` is less than
    2048 bits [[`d523eb9c40`](nodejs@d523eb9c40)]
    [nodejs#11447](nodejs#11447).

* **URL**
  * The WHATWG URL implementation is now a fully-supported Node.js API
    [[`d080ead0f9`](nodejs@d080ead0f9)]
    [nodejs#12710](nodejs#12710).

* **Util**
  * `Symbol` keys are now displayed by default when using `util.inspect()`
    [[`5bfd13b81e`](nodejs@5bfd13b81e)]
    [nodejs#9726](nodejs#9726).
  * `toJSON` errors will be thrown when formatting `%j`
    [[`455e6f1dd8`](nodejs@455e6f1dd8)]
    [nodejs#11708](nodejs#11708).
  * Convert `inspect.styles` and `inspect.colors` to prototype-less objects
    [[`aab0d202f8`](nodejs@aab0d202f8)]
    [nodejs#11624](nodejs#11624).
  * The new `util.promisify()` API has been added
    [[`99da8e8e02`](nodejs@99da8e8e02)]
    [nodejs#12442](nodejs#12442).

* **Zlib**
  * Support `Uint8Array` in Zlib convenience methods
    [[`91383e47fd`](nodejs@91383e47fd)]
    [nodejs#12001](nodejs#12001).
  * Zlib errors now use `RangeError` and `TypeError` consistently
    [[`b514bd231e`](nodejs@b514bd231e)]
    [nodejs#11391](nodejs#11391).
jasnell added a commit that referenced this pull request May 30, 2017
* **Async Hooks**
  * The `async_hooks` module has landed in core
    [[`4a7233c178`](4a7233c178)]
    [#12892](#12892).

* **Buffer**
  * Using the `--pending-deprecation` flag will cause Node.js to emit a
    deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
    [[`d2d32ea5a2`](d2d32ea5a2)]
    [#11968](#11968).
  * `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
    [[`7eb1b4658e`](7eb1b4658e)]
    [#12141](#12141).
  * Many `Buffer` methods now accept `Uint8Array` as input
    [[`beca3244e2`](beca3244e2)]
    [#10236](#10236).

* **Child Process**
  * Argument and kill signal validations have been improved
    [[`97a77288ce`](97a77288ce)]
    [#12348](#12348),
    [[`d75fdd96aa`](d75fdd96aa)]
    [#10423](#10423).
  * Child Process methods accept `Uint8Array` as input
    [[`627ecee9ed`](627ecee9ed)]
    [#10653](#10653).

* **Console**
  * Error events emitted when using `console` methods are now supressed.
    [[`f18e08d820`](f18e08d820)]
    [#9744](#9744).

* **Dependencies**
  * The npm client has been updated to 5.0.0
    [[`3c3b36af0f`](3c3b36af0f)]
    [#12936](#12936).
  * V8 has been updated to 5.8 with forward ABI stability to 6.0
    [[`60d1aac8d2`](60d1aac8d2)]
    [#12784](#12784).

* **Domains**
  * Native `Promise` instances are now `Domain` aware
    [[`84dabe8373`](84dabe8373)]
    [#12489](#12489).

* **Errors**
  * We have started assigning static error codes to errors generated by Node.js.
    This has been done through multiple commits and is still a work in
    progress.

* **File System**
  * The utility class `fs.SyncWriteStream` has been deprecated
    [[`7a55e34ef4`](7a55e34ef4)]
    [#10467](#10467).
  * The deprecated `fs.read()` string interface has been removed
    [[`3c2a9361ff`](3c2a9361ff)]
    [#9683](#9683).

* **HTTP**
  * Improved support for userland implemented Agents
    [[`90403dd1d0`](90403dd1d0)]
    [#11567](#11567).
  * Outgoing Cookie headers are concatenated into a single string
    [[`d3480776c7`](d3480776c7)]
    [#11259](#11259).
  * The `httpResponse.writeHeader()` method has been deprecated
    [[`fb71ba4921`](fb71ba4921)]
    [#11355](#11355).
  * New methods for accessing HTTP headers have been added to `OutgoingMessage`
    [[`3e6f1032a4`](3e6f1032a4)]
    [#10805](#10805).

* **Lib**
  * All deprecation messages have been assigned static identifiers
    [[`5de3cf099c`](5de3cf099c)]
    [#10116](#10116).
  * The legacy `linkedlist` module has been removed
    [[`84a23391f6`](84a23391f6)]
    [#12113](#12113).

* **N-API**
  * Experimental support for the new N-API API has been added
    [[`56e881d0b0`](56e881d0b0)]
    [#11975](#11975).

* **Process**
  * Process warning output can be redirected to a file using the
    `--redirect-warnings` command-line argument
    [[`03e89b3ff2`](03e89b3ff2)]
    [#10116](#10116).
  * Process warnings may now include additional detail
    [[`dd20e68b0f`](dd20e68b0f)]
    [#12725](#12725).

* **REPL**
  * REPL magic mode has been deprecated
    [[`3f27f02da0`](3f27f02da0)]
    [#11599](#11599).

* **Src**
  * `NODE_MODULE_VERSION` has been updated to 57
    (ec7cbaf266)]
    [#12995](#12995).
  * Add `--pending-deprecation` command-line argument and
    `NODE_PENDING_DEPRECATION` environment variable
    [[`a16b570f8c`](a16b570f8c)]
    [#11968](#11968).
  * The `--debug` command-line argument has been deprecated. Note that
    using `--debug` will enable the *new* Inspector-based debug protocol
    as the legacy Debugger protocol previously used by Node.js has been
    removed. [[`010f864426`](010f864426)]
    [#12949](#12949).
  * Throw when the `-c` and `-e` command-line arguments are used at the same
    time [[`a5f91ab230`](a5f91ab230)]
    [#11689](#11689).
  * Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
    arguments are used at the same time.
    [[`8a7db9d4b5`](8a7db9d4b5)]
    [#12087](#12087).

* **Stream**
  * `Stream` now supports `destroy()` and `_destroy()` APIs
    [[`b6e1d22fa6`](b6e1d22fa6)]
    [#12925](#12925).
  * `Stream` now supports the `_final()` API
    [[`07c7f198db`](07c7f198db)]
    [#12828](#12828).

* **TLS**
  * The `rejectUnauthorized` option now defaults to `true`
    [[`348cc80a3c`](348cc80a3c)]
    [#5923](#5923).
  * The `tls.createSecurePair()` API now emits a runtime deprecation
    [[`a2ae08999b`](a2ae08999b)]
    [#11349](#11349).
  * A runtime deprecation will now be emitted when `dhparam` is less than
    2048 bits [[`d523eb9c40`](d523eb9c40)]
    [#11447](#11447).

* **URL**
  * The WHATWG URL implementation is now a fully-supported Node.js API
    [[`d080ead0f9`](d080ead0f9)]
    [#12710](#12710).

* **Util**
  * `Symbol` keys are now displayed by default when using `util.inspect()`
    [[`5bfd13b81e`](5bfd13b81e)]
    [#9726](#9726).
  * `toJSON` errors will be thrown when formatting `%j`
    [[`455e6f1dd8`](455e6f1dd8)]
    [#11708](#11708).
  * Convert `inspect.styles` and `inspect.colors` to prototype-less objects
    [[`aab0d202f8`](aab0d202f8)]
    [#11624](#11624).
  * The new `util.promisify()` API has been added
    [[`99da8e8e02`](99da8e8e02)]
    [#12442](#12442).

* **Zlib**
  * Support `Uint8Array` in Zlib convenience methods
    [[`91383e47fd`](91383e47fd)]
    [#12001](#12001).
  * Zlib errors now use `RangeError` and `TypeError` consistently
    [[`b514bd231e`](b514bd231e)]
    [#11391](#11391).
jasnell added a commit that referenced this pull request May 30, 2017
* **Async Hooks**
  * The `async_hooks` module has landed in core
    [[`4a7233c178`](4a7233c178)]
    [#12892](#12892).

* **Buffer**
  * Using the `--pending-deprecation` flag will cause Node.js to emit a
    deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
    [[`d2d32ea5a2`](d2d32ea5a2)]
    [#11968](#11968).
  * `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
    [[`7eb1b4658e`](7eb1b4658e)]
    [#12141](#12141).
  * Many `Buffer` methods now accept `Uint8Array` as input
    [[`beca3244e2`](beca3244e2)]
    [#10236](#10236).

* **Child Process**
  * Argument and kill signal validations have been improved
    [[`97a77288ce`](97a77288ce)]
    [#12348](#12348),
    [[`d75fdd96aa`](d75fdd96aa)]
    [#10423](#10423).
  * Child Process methods accept `Uint8Array` as input
    [[`627ecee9ed`](627ecee9ed)]
    [#10653](#10653).

* **Console**
  * Error events emitted when using `console` methods are now supressed.
    [[`f18e08d820`](f18e08d820)]
    [#9744](#9744).

* **Dependencies**
  * The npm client has been updated to 5.0.0
    [[`3c3b36af0f`](3c3b36af0f)]
    [#12936](#12936).
  * V8 has been updated to 5.8 with forward ABI stability to 6.0
    [[`60d1aac8d2`](60d1aac8d2)]
    [#12784](#12784).

* **Domains**
  * Native `Promise` instances are now `Domain` aware
    [[`84dabe8373`](84dabe8373)]
    [#12489](#12489).

* **Errors**
  * We have started assigning static error codes to errors generated by Node.js.
    This has been done through multiple commits and is still a work in
    progress.

* **File System**
  * The utility class `fs.SyncWriteStream` has been deprecated
    [[`7a55e34ef4`](7a55e34ef4)]
    [#10467](#10467).
  * The deprecated `fs.read()` string interface has been removed
    [[`3c2a9361ff`](3c2a9361ff)]
    [#9683](#9683).

* **HTTP**
  * Improved support for userland implemented Agents
    [[`90403dd1d0`](90403dd1d0)]
    [#11567](#11567).
  * Outgoing Cookie headers are concatenated into a single string
    [[`d3480776c7`](d3480776c7)]
    [#11259](#11259).
  * The `httpResponse.writeHeader()` method has been deprecated
    [[`fb71ba4921`](fb71ba4921)]
    [#11355](#11355).
  * New methods for accessing HTTP headers have been added to `OutgoingMessage`
    [[`3e6f1032a4`](3e6f1032a4)]
    [#10805](#10805).

* **Lib**
  * All deprecation messages have been assigned static identifiers
    [[`5de3cf099c`](5de3cf099c)]
    [#10116](#10116).
  * The legacy `linkedlist` module has been removed
    [[`84a23391f6`](84a23391f6)]
    [#12113](#12113).

* **N-API**
  * Experimental support for the new N-API API has been added
    [[`56e881d0b0`](56e881d0b0)]
    [#11975](#11975).

* **Process**
  * Process warning output can be redirected to a file using the
    `--redirect-warnings` command-line argument
    [[`03e89b3ff2`](03e89b3ff2)]
    [#10116](#10116).
  * Process warnings may now include additional detail
    [[`dd20e68b0f`](dd20e68b0f)]
    [#12725](#12725).

* **REPL**
  * REPL magic mode has been deprecated
    [[`3f27f02da0`](3f27f02da0)]
    [#11599](#11599).

* **Src**
  * `NODE_MODULE_VERSION` has been updated to 57
    (ec7cbaf266)]
    [#12995](#12995).
  * Add `--pending-deprecation` command-line argument and
    `NODE_PENDING_DEPRECATION` environment variable
    [[`a16b570f8c`](a16b570f8c)]
    [#11968](#11968).
  * The `--debug` command-line argument has been deprecated. Note that
    using `--debug` will enable the *new* Inspector-based debug protocol
    as the legacy Debugger protocol previously used by Node.js has been
    removed. [[`010f864426`](010f864426)]
    [#12949](#12949).
  * Throw when the `-c` and `-e` command-line arguments are used at the same
    time [[`a5f91ab230`](a5f91ab230)]
    [#11689](#11689).
  * Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
    arguments are used at the same time.
    [[`8a7db9d4b5`](8a7db9d4b5)]
    [#12087](#12087).

* **Stream**
  * `Stream` now supports `destroy()` and `_destroy()` APIs
    [[`b6e1d22fa6`](b6e1d22fa6)]
    [#12925](#12925).
  * `Stream` now supports the `_final()` API
    [[`07c7f198db`](07c7f198db)]
    [#12828](#12828).

* **TLS**
  * The `rejectUnauthorized` option now defaults to `true`
    [[`348cc80a3c`](348cc80a3c)]
    [#5923](#5923).
  * The `tls.createSecurePair()` API now emits a runtime deprecation
    [[`a2ae08999b`](a2ae08999b)]
    [#11349](#11349).
  * A runtime deprecation will now be emitted when `dhparam` is less than
    2048 bits [[`d523eb9c40`](d523eb9c40)]
    [#11447](#11447).

* **URL**
  * The WHATWG URL implementation is now a fully-supported Node.js API
    [[`d080ead0f9`](d080ead0f9)]
    [#12710](#12710).

* **Util**
  * `Symbol` keys are now displayed by default when using `util.inspect()`
    [[`5bfd13b81e`](5bfd13b81e)]
    [#9726](#9726).
  * `toJSON` errors will be thrown when formatting `%j`
    [[`455e6f1dd8`](455e6f1dd8)]
    [#11708](#11708).
  * Convert `inspect.styles` and `inspect.colors` to prototype-less objects
    [[`aab0d202f8`](aab0d202f8)]
    [#11624](#11624).
  * The new `util.promisify()` API has been added
    [[`99da8e8e02`](99da8e8e02)]
    [#12442](#12442).

* **Zlib**
  * Support `Uint8Array` in Zlib convenience methods
    [[`91383e47fd`](91383e47fd)]
    [#12001](#12001).
  * Zlib errors now use `RangeError` and `TypeError` consistently
    [[`b514bd231e`](b514bd231e)]
    [#11391](#11391).
@ChALkeR ChALkeR mentioned this pull request Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. notable-change PRs with changes that should be highlighted in changelogs. security Issues and PRs related to security. 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.

None yet