Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

doc: Revisit ES5 / ES6 / ecma next toggle for the API or having ES6 guide/topic #101

Closed
eljefedelrodeodeljefe opened this issue Apr 18, 2016 · 17 comments

Comments

@eljefedelrodeodeljefe
Copy link
Contributor

As per discussion on nodejs/node#6203 and PR nodejs/node#4915 we should have such a feature / content on the agenda again.

Churn might be actually welcomed...

@Knighton910
Copy link

Knighton910 commented Apr 18, 2016

+1

cc @nodejs/documentation

@stevemao
Copy link
Contributor

stevemao commented Apr 18, 2016

I thought we already made a decision?

from @chrisdickinson

OK, the resolution on this from the meeting was:
We will look into changing the font / highlighting template strings differently to call them out.
We're going to look into ways to receive feedback from folks reading the docs, especially newcomers.
We'll continue to experiment with this approach in the future, but:
There are concerns about doubling the number of examples we're tracking & increasing the maintenance load for the future.

@eljefedelrodeodeljefe
Copy link
Contributor Author

Can't remember, but somewhere somewhen we rather said to discuss it again. Not sure... if this dies off quick, I am good. However we should find a good solution for problems like in the linked issue.

@stevemao
Copy link
Contributor

stevemao commented Apr 18, 2016

I think we should discuss "what's the better way of resolving it". Maybe we should fix nodejs/nodejs.org#434 ASAP (blaming myself)

@kahwee
Copy link

kahwee commented Apr 20, 2016

Once node v6 is released, we just have to deal with v5 and v6, both have ES6 enabled by default anyway. Wouldn't just displaying the docs in ES6 be sufficient?

@eljefedelrodeodeljefe
Copy link
Contributor Author

It's a matter of style and teaching rather than what we support I fear. I guess core and a lot of people (including me) are prefering Class.prototype.method syntax over es6 class. Not only that, but also we would have lots of old SO questions and tutorials out there in es5. New users won't really see the change and might be mislead or plainly don't understand what is presented.

@jasnell
Copy link
Member

jasnell commented Apr 20, 2016

slight correction, once v6 is out it will be v4 and v6, there shouldn't be any reason to keep v5 docs up.

@kahwee
Copy link

kahwee commented Apr 20, 2016

@eljefedelrodeodeljefe Are you intending this to be for v4 as well? Or just v6.

@eljefedelrodeodeljefe
Copy link
Contributor Author

Well the idea would be to track ECMA not node versioning. Obviously going forward we would have to wait node / v8 to catch up to certain features before we can employ them in examples. But the gist would be: the community decides on a certain style for a major version of ECMAScript (es6: let, const, no classes; es7: class, async/await) and this then will be in there forever. Until, say, ES5 is so out of date that everyone wants to get rid of it.

If there should be any reason to track specific node versions then we should follow the LTS and HEAD tracks. As jasnell describes it v5 then would be obsolete, v4 would need to stay in.

If the tracking logic is unclear and/or there are other ideas we should discuss this further...

@kahwee
Copy link

kahwee commented Apr 21, 2016

Most beginner users probably don't care about ECMAScript 5, 6 or 7, they just want to know the recommended practice in nodejs v4 or v6 without using additional command-line options. Introducing too many concepts may confuse them instead of help them.

Even if we split things by ES5, ES6 and ES7, we still face varying amount of implementation of ES6 in the V8 engine as seen here.

As for whether we should use class or function, I think we can put it to a vote on that. Personally, I don't use class in my ES6 code either. I want to see terse functions using => but I don't expect ES6 to start throwing class as me just simply because it's part of the ES6 specification.

@stevemao
Copy link
Contributor

I think this should be closed because of
nodejs/nodejs.org#671 (comment)

@eljefedelrodeodeljefe
Copy link
Contributor Author

@stevemao they touch different topics. This here would touch every inline example in the API.

@stevemao
Copy link
Contributor

I understand. But do you think this should be centralised on one page?
The reason why there is a centralised page talking about es next is because we don't want to mention it repeatedly in different examples.
Even though API and the rest of the website are two different projects, the idea is similar so we should point people to the same page (node.green)?

@chrisdickinson
Copy link
Contributor

If we're moving examples universally to ES6, that is probably OK. With regards to a split ES5/ES6 example solution, I think the prior resolution holds — that's too much work to maintain, roughly doubling the number of examples.

@a0viedo
Copy link
Member

a0viedo commented Apr 28, 2016

I'm in favor of moving examples to ES6 👍

@estliberitas
Copy link
Contributor

estliberitas commented Apr 28, 2016

+1 to ES6-only examples - less work for us. More and more newcomers see examples in ES6 in different sites. Though, this way we'd force people to learn it in some way. Depends on how people see it - annoying or informative. I think, this way we help them to adjust to ES6 standard.

@Trott
Copy link
Member

Trott commented Mar 13, 2018

Closing as this repository is dormant and likely to be archived soon. If this is still an issue, feel free to open it as an issue on the main node repository.

@Trott Trott closed this as completed Mar 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants