-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Revert "buffer: runtime deprecation of calling Buffer without new" #9529
Conversation
No hard feeling on this if we hard-deprecate it again soon together with |
@ChALkeR I agree that that might be hard, but I think it is obvious that we need to come up with better messaging for this anyway. Whatever version we land a full runtime deprecation in (if we do that), we should make very clear both what we are doing and why we are doing it, in the changelog and over other channels. @sindresorhus I’d be interested in hearing where your downvote is coming from. As you probably know, a lot of the push towards reverting the runtime deprecation is coming from people maintaining a noticeable share of the ecosystem, so I think it would really be interesting to hear whatever different perspective you may have? |
I don't think we should do that. It's a sign of weakness to step back from the deprecation now, and v7 is a "unstable" release line for a reason. Better get the ecosystem in shape for v8, where it really matters. |
I am not sure what you are getting at? You can see any actual listening to criticism as a sign of weakness if you want to, and I’m not sure why Node core should value appearing “strong” in the first place.
We’re not talking about experimental features here, and imho the main difference between odd and even release lines should be the different lifespan. The “Current” release line was previously called “Stable” for a reason, too, so I wouldn’t exactly jump to calling it “unstable” now. :) |
Okay, after reading up on #8169, I think I'll remain neutral here. I initialy thought this deprection was to push people towards the new APIs for security, but that issue clearly shows other intentions. |
Well, imho the impression you had is right – no deprecation should happen for any other reason than that one, and I don’t see any other arguments in favour of deprecating that are strong enough justify it (again, that’s my personal view). |
@addaleax I am in favour of deprecating APIs that suck, security or not, carefully, with appropriate timeline, I'm just not seeing how "not being an es6 class" really means "sucks", and I think having to type The PRs mentioning es6 didn't work very hard to show what kinds of good things would be possible once Buffer is a "proper es6 class" that aren't possible now. The subtle interactions with some js array types that aren't used in the Node.js API anyhow (unlike Buffer) are also not clear. Probably this could be made compelling, but mostly ATM its just a bit mystifying. |
@sam-github Exactly, and I think our messaging turned out terrible here. As we discussed in today’s CTC meeting, we’re going to open a separate issue for more long-term focused planning, i.e. if, how, why and when to deprecate what exactly. I’ll do that, and try to provide everyone with information summing up what has happened so far, that just takes a bit of time. |
+1, I'm also annoyed when a dependency forces the |
Unless we are 100% that we want to actually do a runtime deprecation of Buffer without new in v8 I believe that this should be reverted. Even if we eventually decide to continue on the deprecation path, hopefully with the support of the community, we can add the warning back after giving individuals more time to get things in order. Alternatively if we find a way forward that does not involved deprecatio, then the warning is not going to be needed anyways. LGTM |
+0 on the revert itself, -1 on the messaging. We aren't doing this just because of the disruption, but because the justification for the hard-deprecation wasn't sufficient for it, and also because the plans to deprecate the Buffer constructor entirely in v8.0 might lead to people having to change their code twice. |
@seishun I’ve update the commit message/PR content with bits of your comment, does that seem good to you? |
@addaleax Still seems a bit off... Could it possibly be "too disruptive" while the justification is sufficient? How about something like "as the original justification for the runtime-deprecation does not appear to justify the disruption to Node’s existing ecosystem"? |
This reverts commit f2fe558 (nodejs#8169) as the original justification for the runtime-deprecation does not appear to justify the disruption to Node’s existing ecosystem. Futhermore, the possibility of deprecating the Buffer constructor entirely in v8.0 might lead to people having to change their code twice.
@seishun Yeah that sounds better to me, too. |
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.
LGTM
I'm pretty sure that the right course of action for 8.0 would be to runtime-deprecate I would ask to give this revert/discussion time at least before the end of the next CTC meeting before landing it. |
@ChALkeR If you’d like to talk about this in today’s/tomorrow’s meeting, I’d recommend announcing that in the meeting issue @ nodejs/CTC#33 (which I might very will have to miss). |
My only question about this PR is this: if we (hopefully) decide to land full If yes — I have no objections. If no — we should have a resolution on the large issue ( /cc @nodejs/ctc Upd: in fact, tagging as |
In the last meeting we were converging on clean break > piecemeal deprecation, IIRC? |
I would say so. Judging from most of what I’ve been hearing, the deprecation warning as it is right now is not having the desired effect. |
I interpreted “full Buffer(args) deprecation” as “print a deprecation warning for every call to Buffer(), with or without new and with any argument types”. |
@Trott A single runtime deprecation when |
Ah! That answers a whole lot of questions I had. Thanks. |
Per nodejs/CTC#36, the CTC decision is to revert, so this should probably be landed before the next 7.x patch release. |
Appears to be resolution on the narrow issue here so I'm going to remove the ctc-agenda label. Feel free to re-add if this is something we need to talk about at the meeting this week. |
Going to go ahead and land now. Thanks! |
Actually, running CI first to be safe: https://ci.nodejs.org/job/node-test-pull-request/5007/ |
Landed in 4fffe32. Thanks! |
This reverts commit f2fe558 (#8169) as the original justification for the runtime-deprecation does not appear to justify the disruption to Node’s existing ecosystem. Futhermore, the possibility of deprecating the Buffer constructor entirely in v8.0 might lead to people having to change their code twice. PR-URL: #9529 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Nikolai Vavilov <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Rich Trott <[email protected]>
This reverts commit f2fe558 (#8169) as the original justification for the runtime-deprecation does not appear to justify the disruption to Node’s existing ecosystem. Futhermore, the possibility of deprecating the Buffer constructor entirely in v8.0 might lead to people having to change their code twice. PR-URL: #9529 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Nikolai Vavilov <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Notable changes: * buffer: - Reverted the runtime deprecation of calling `Buffer()` without `new`. (Anna Henningsen) #9529 - Fixed `buffer.transcode()` for single-byte character encodings to `UCS2`. (Anna Henningsen) #9838 * promise: `--trace-warnings` now produces useful stacktraces for Promise warnings. (Anna Henningsen) #9525 * repl: Fixed a bug preventing correct parsing of generator functions. (Teddy Katz) #9852 * V8: Fixed a significant `instanceof` performance regression. (Franziska Hinkelmann) #9730 PR-URL: #10127
Notable changes: * buffer: - Reverted the runtime deprecation of calling `Buffer()` without `new`. (Anna Henningsen) nodejs/node#9529 - Fixed `buffer.transcode()` for single-byte character encodings to `UCS2`. (Anna Henningsen) nodejs/node#9838 * promise: `--trace-warnings` now produces useful stacktraces for Promise warnings. (Anna Henningsen) nodejs/node#9525 * repl: Fixed a bug preventing correct parsing of generator functions. (Teddy Katz) nodejs/node#9852 * V8: Fixed a significant `instanceof` performance regression. (Franziska Hinkelmann) nodejs/node#9730 Signed-off-by: Ilkka Myller <[email protected]>
…overage (#2) Revert version-check from previous commit 32604ba, and use Buffer constructor for converting HTML-formatted string. Looks like, nodejs isn't emitting a deprecation warning any more since v7.2.1 (nodejs/node#9529). Mocking/Stubbing `process.version` is not only super ugly, but also super tricky. Until 8.x is released, no further changes should be necessary.
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
buffer
Description of change
This reverts commit f2fe558 (#8169) as the original justification for the runtime-deprecation does not appear to justify the disruption to Node’s existing ecosystem. Futhermore, the possibility of deprecating the Buffer constructor entirely in v8.0 might lead to people having to change their code twice (For the record: While I opened this PR and that roadmap is one that some people have in mind, I personally don’t think the Buffer constructor should be deprecated entirely in v8.0).
/cc @nodejs/ctc