GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Revert "buffer: runtime deprecation of calling Buffer without new" by addaleax · Pull Request #9529 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Nov 9, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind, mafintosh, watson, yoshuawuyts, spelunk, and JLHwung reacted with thumbs up emoji sindresorhus and vkurchatkin reacted with thumbs down emoji ChALkeR, seishun, mathieumg, and SEAPUNK reacted with confused emoji
All reactions
  • 👍 6 reactions
  • 👎 2 reactions
  • 😕 4 reactions
@nodejs-github-bot nodejs-github-bot added the buffer Issues and PRs related to the buffer subsystem. label Nov 9, 2016
@addaleax addaleax added dont-land-on-v4.x labels Nov 9, 2016
@ChALkeR

ChALkeR commented Nov 9, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

No hard feeling on this if we hard-deprecate it again soon together with new Buffer (where possible), but wouldn't it be too much distruption if we deprecate it in 7.0, undeprecate it in 7.x, then deprecate it again in 8.0? How are we going to message that? Upd: this is -0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax
addaleax force-pushed the revert-8169 branch from bcbbbaa to d934669 Compare November 9, 2016 18:14
@addaleax

addaleax commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

@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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

It's a sign of weakness to step back from the deprecation now

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.

v7 is a "unstable" release line for a reason.

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. :)

Jessidhia and pkoretic reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Nov 9, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github

sam-github commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

@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 new everywhere makes the API more sucky... its no coincidence the node API (and most nice to use js APIs, AFAICT), try to make the new an implementation detail of a constructor.

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.

addaleax, silverwind, watson, YurySolovyov, and mreinstein reacted with thumbs up emoji
All reactions
  • 👍 5 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

its no coincidence the node API (and most nice to use js APIs, AFAICT), try to make the new an implementation detail of a constructor.

+1, I'm also annoyed when a dependency forces the new onto me. It can also lead to bugs when one does not know about the precedence of the new operator, e.g. new Thing().prop vs (new Thing()).prop, so if the new was the only reason for this change, I'd be in favor of reverting.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Nov 9, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Trott and watson reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seishun

seishun commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

+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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax
addaleax force-pushed the revert-8169 branch from d934669 to 714533c Compare November 9, 2016 20:47
@addaleax

addaleax commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

@seishun I’ve update the commit message/PR content with bits of your comment, does that seem good to you?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind
silverwind approved these changes Nov 9, 2016
View reviewed changes
MylesBorins
MylesBorins approved these changes Nov 9, 2016
View reviewed changes
sam-github
sam-github approved these changes Nov 9, 2016
View reviewed changes
@seishun

seishun commented Nov 9, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@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"?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax
Revert "buffer: runtime deprecation of calling Buffer without new"
755ebdf
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.
@addaleax
addaleax force-pushed the revert-8169 branch from 714533c to 755ebdf Compare November 9, 2016 21:02
@addaleax

addaleax commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

@seishun Yeah that sounds better to me, too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax mentioned this pull request Nov 9, 2016
buffer: discuss future direction of Buffer constructor API #9531
Closed
seishun
seishun approved these changes Nov 9, 2016
View reviewed changes
evanlucas
evanlucas approved these changes Nov 9, 2016
View reviewed changes
targos
targos approved these changes Nov 9, 2016
View reviewed changes
Trott
Trott approved these changes Nov 9, 2016
View reviewed changes

@Trott Trott left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ChALkeR

ChALkeR commented Nov 11, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Unless we are 100% that we want to actually do a runtime deprecation of Buffer without new in v8

I'm pretty sure that the right course of action for 8.0 would be to runtime-deprecate Buffer(arg), both with and without new, for security reasons.

I would ask to give this revert/discussion time at least before the end of the next CTC meeting before landing it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Nov 16, 2016

Copy link
Copy Markdown
Member Author

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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott mentioned this pull request Nov 16, 2016
Node.js Foundation Core Technical Committee (CTC) Meeting 2016-11-16 nodejs/CTC#33
Closed
@ChALkeR

ChALkeR commented Nov 16, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

My only question about this PR is this: if we (hopefully) decide to land full Buffer(arg) deprecation in 8.0 and do that, would we think that landing this PR was a good step, looking back from where we would be?

If yes — I have no objections. If no — we should have a resolution on the large issue (Buffer(arg)) deprecations first.

/cc @nodejs/ctc

Upd: in fact, tagging as ctc-agenda because of this.

curiousdannii reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ChALkeR ChALkeR added the ctc-agenda label Nov 16, 2016
@bnoordhuis

bnoordhuis commented Nov 16, 2016

Copy link
Copy Markdown
Member

In the last meeting we were converging on clean break > piecemeal deprecation, IIRC?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott mentioned this pull request Nov 21, 2016
Node.js Foundation Core Technical Committee (CTC) Meeting 2016-11-23 nodejs/CTC#35
Closed
@addaleax

addaleax commented Nov 21, 2016

Copy link
Copy Markdown
Member Author

My only question about this PR is this: if we (hopefully) decide to land full Buffer(arg) deprecation in 8.0 and do that, would we think that landing this PR was a good step, looking back from where we would be?

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Nov 21, 2016

Copy link
Copy Markdown
Member

For absolute clarity: When @ChALkeR and @addaleax refer to "full Buffer(args) deprecation"/"full runtime deprecation", does that mean removal? Or does that mean returning to the runtime deprecation situation we have now? I've been assuming it meant removal. But I make a lot of bad assumptions...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Nov 21, 2016

Copy link
Copy Markdown
Member Author

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”.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ChALkeR

ChALkeR commented Nov 21, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@Trott A single runtime deprecation when Buffer(arg… is used the first time, with or without new, if --no-deprecation flag was not set.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Nov 21, 2016

Copy link
Copy Markdown
Member

Ah! That answers a whole lot of questions I had. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas evanlucas mentioned this pull request Nov 23, 2016
Call for vote on reverting runtime deprecation of using Buffer without new on v7 nodejs/CTC#36
Closed
@ChALkeR

ChALkeR commented Nov 27, 2016

Copy link
Copy Markdown
Member

Per nodejs/CTC#36, the CTC decision is to revert, so this should probably be landed before the next 7.x patch release.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott removed the ctc-agenda label Nov 28, 2016
@Trott

Trott commented Nov 28, 2016

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

Going to go ahead and land now. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

Actually, running CI first to be safe: https://ci.nodejs.org/job/node-test-pull-request/5007/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

Landed in 4fffe32. Thanks!

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas evanlucas closed this Nov 28, 2016
evanlucas pushed a commit that referenced this pull request Nov 28, 2016
@addaleax @evanlucas
Revert "buffer: runtime deprecation of calling Buffer without new"
4fffe32
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]>
@addaleax
addaleax deleted the revert-8169 branch November 29, 2016 10:24
addaleax added a commit that referenced this pull request Dec 5, 2016
@addaleax
Revert "buffer: runtime deprecation of calling Buffer without new"
e0e62d1
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]>
@Fishrock123 Fishrock123 mentioned this pull request Dec 5, 2016
v7.2.1 proposal #10127
Merged
2 tasks done
Fishrock123 added a commit that referenced this pull request Dec 6, 2016
@Fishrock123
2016-12-06, Version 7.2.1 (Current)
8ab8363
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
@JLHwung JLHwung mentioned this pull request Dec 7, 2016
Use buffer-alloc-unsafe to create emptyBuffer brianc/node-postgres#1154
Closed
imyller added a commit to imyller/meta-nodejs that referenced this pull request Dec 7, 2016
@imyller
2016-12-06, Version 7.2.1 (Current)
cc842d4
    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]>
@joehand joehand mentioned this pull request Dec 19, 2016
Deprecation warming dat-ecosystem/dat#583
Closed
@jsinmotion jsinmotion mentioned this pull request Dec 20, 2016
'DeprecationWarning' for the use of 'Buffer without new' dbashford/textract#104
Closed
@SheetJSDev SheetJSDev mentioned this pull request Dec 31, 2016
DeprecationWarning in node.js v7.0.0 SheetJS/sheetjs#493
Closed
macedigital added a commit to macedigital/gulp-sri-hash that referenced this pull request Mar 13, 2017
@macedigital
test: prefer Buffer constructor over hacks to get back to 100% test c…
ab00140
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Trott Trott Trott approved these changes
+6 more reviewers
@sam-github sam-github sam-github approved these changes
@silverwind silverwind silverwind approved these changes
@MylesBorins MylesBorins MylesBorins approved these changes
@evanlucas evanlucas evanlucas approved these changes
@seishun seishun seishun approved these changes
@targos targos targos approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

buffer Issues and PRs related to the buffer subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@addaleax @ChALkeR @silverwind @sam-github @MylesBorins @seishun @bnoordhuis @Trott @evanlucas @targos @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.