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

Docs: Default es6 features should clarify type of Spread operator #653

Closed
batjko opened this issue Apr 16, 2016 · 11 comments
Closed

Docs: Default es6 features should clarify type of Spread operator #653

batjko opened this issue Apr 16, 2016 · 11 comments
Labels
good first issue Issues for newcomers

Comments

@batjko
Copy link

batjko commented Apr 16, 2016

Hi guys,

When I read through this list of features shipped by default:
https://nodejs.org/en/docs/es6/#which-features-ship-with-node-js-by-default-no-runtime-flag-required
... I thought it great that the Spread operator is now supported without any flags.

So I went and tried the spread operator on an object and was promptly met with an Unexpected token ... error, despite having node v5.10 installed.

I then had to be educated by StackOverflow that it is only the Array spread operator that is supported, but not the Object spread operator.

I think this should be clarified on the page.

Many thanks.

@batjko batjko changed the title Default es6 features should clarify type of Spread operator Docs: Default es6 features should clarify type of Spread operator Apr 16, 2016
@phillipj phillipj added the good first issue Issues for newcomers label Apr 17, 2016
@lpinca
Copy link
Member

lpinca commented Apr 18, 2016

I've filed a pr for this, but I think the issue is invalid. The feature is not part of ES2015.

@batjko
Copy link
Author

batjko commented Apr 18, 2016

The issue isn't about whether object spread operators are included in ES2015 or not.
It's about the phrase "Spread Operator" being ambiguous for anybody who doesn't know off the top of their head what is or isn't part of any given standard.

When I look at a list of supported features in my version of node, I don't care if it is in ES2015 or ES2017. I just want to know if I should be able to use it or not.

Thanks for the PR, @lpinca.

@fhemberger
Copy link
Contributor

@lpinca There is an open issue to rename that page to "ES6 and beyond", so it's still okay.

@lpinca
Copy link
Member

lpinca commented Apr 18, 2016

Ok.

@stevemao
Copy link
Contributor

Closing as #661 is closed

@batjko
Copy link
Author

batjko commented Apr 20, 2016

I don't understand why the related PR was getting rejected. I don't see why adding a little note to clarify that object spread operators are not supported, is so controversial that it must not be pointed out to readers seeking information about it.

@stevemao
Copy link
Contributor

Reason already stated in the PR.

@MylesBorins
Copy link
Contributor

@batjko the reason is that v5 will be end of life once v6 is released next week, which has better support for the spread operator. If we added the change we would have to revert it next week

@lpinca
Copy link
Member

lpinca commented Apr 20, 2016

Actually the note was generic enough to not include the fact that spread operator did not work on destructuring assignments. Destructuring in not available in node 5 anyway.

The reason is that spread operator documentation already makes it clear that it only works on array literals, function calls and destructuring so the note is redundant imho.

@lpinca
Copy link
Member

lpinca commented Apr 20, 2016

Also as @fhemberger stated above, there is an ongoing work to create an "ES6 and beyond" page that should replace the current "ES6 in Node.js" page.
That seems a better place to put notes about future features of the language.

@batjko
Copy link
Author

batjko commented Apr 20, 2016

Ah, Another thing I wasn't aware of, @thealphanerd . That of course makes total sense to me.

I suppose my concern was simply that the generic phrasing simply assumes that everyone keeps closely up-to-date with all features and at which stage of their discussion / implementation they are at any given point.

A lot of people just don't have the time to do that, so clarity is always preferable to "you should have read these other documents".

But either way, it's going to be brought up-to-date with v6 anyway, so it's all good.
Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants