Skip to content

update minimum version of node from 4.0.0 to 6.10.3#9537

Merged
lannka merged 1 commit intomasterfrom
lannka-node-6.10
May 25, 2017
Merged

update minimum version of node from 4.0.0 to 6.10.3#9537
lannka merged 1 commit intomasterfrom
lannka-node-6.10

Conversation

@lannka
Copy link
Copy Markdown
Contributor

@lannka lannka commented May 24, 2017

According http://node.green/ node has good support of ES6 since 6.10.3LTS (except the ES6 modules :-().

Updating the minimum version of node allows us to use ES6 features to simplify our gulp and server code.

According http://node.green/ node has good support of ES6 since 6.10.3LTS (except the ES6 modules :-().

Updating the minimum version of node allows us to use ES6 features to simplify our gulp and server code.
Copy link
Copy Markdown
Contributor

@dvoytenko dvoytenko left a comment

Choose a reason for hiding this comment

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

LGTM

@cramforce
Copy link
Copy Markdown
Member

Please ping slack when this is merged.

@lannka lannka merged commit e363fae into master May 25, 2017
@erwinmombay
Copy link
Copy Markdown
Member

i believe @jridgewell said we should keep on supporting node 4+

@lannka lannka deleted the lannka-node-6.10 branch May 25, 2017 17:28
@jridgewell
Copy link
Copy Markdown
Contributor

We should revert this. Most ES6 features are supported in Node v4, you just need to put "use strict" at the top of the file.

jridgewell added a commit that referenced this pull request May 25, 2017
jridgewell added a commit to jridgewell/amphtml that referenced this pull request May 25, 2017
…ct#9537)"

This reverts commit e363fae.

Most ES6 features are supported in Node v4, you just need to put `"use
strict"` at the top of the file.
@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

@jridgewell what's the benefit of keeping on an old version?

@jridgewell
Copy link
Copy Markdown
Contributor

People use it.

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

For a healthier open source environment, we should advocate new versions. If I were the node team, I don't want to maintain old versions forever just because some people are using it. And most likely those people are just lack of a motivation to spend little time for an in-place upgrade.

@jridgewell
Copy link
Copy Markdown
Contributor

If I were the node team, I don't want to maintain old versions forever just because some people are using it

It's in LTS for another year. After that, we drop it.

And most likely those people are just lack of a motivation to spend little time for an in-place upgrade

Or they're using the version that matches their prod environment.

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

I still believe 6.x has better support on ES6. And I don't see a real reason here to revert back.

@jridgewell
Copy link
Copy Markdown
Contributor

I still believe 6.x has better support on ES6

I'm not arguing that. v4 has the majority features.

And I don't see a real reason here to revert back.

This shit. We're an open source project actively working to get new people to sign up. Any barrier to that (like build steps that fail for no reason) makes the project worse.

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

This shit. We're an open source project actively working to get new people to sign up. Any barrier to that (like build steps that fail for no reason) makes the project worse.

Isn't that a good example why we want 6.x? So "let" will be well supported.

@jridgewell
Copy link
Copy Markdown
Contributor

jridgewell commented May 25, 2017

You just need to put "use strict" at the top of the file.

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

You just need to put "use strict" at the top of the file.

As you said, that IS a "barrier" (a build steps failed for no reason).

So this PR fixed that problem, it will either build successfully (if your node is installed within a year), or failed with a meaningful error message asking you to upgrade your 2 years old node binary.

@jridgewell
Copy link
Copy Markdown
Contributor

There's a very big difference between "my freshly installed clone fails to build" and "my PR fails to build". One turns the contributor off completely, the other can be caught during review.

@cramforce
Copy link
Copy Markdown
Member

Lets revert. I agree with @jridgewell. We write so little code that runs in node that a little inconvenience is fine.

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

@cramforce I hated to switch between ES6 and ES5 in the same repo. My IDE just can't get the linter right. I remember once @erwinmombay also hoped we can have ES6 compatible gulp code so we can share code between the two (forgot the exact details).

Meanwhile, we will be definitely writing more code in node once we invest more into integration tests.

@cramforce
Copy link
Copy Markdown
Member

Did you try the "use strict"?

@jridgewell
Copy link
Copy Markdown
Contributor

We can still write in ES6:

ES6 features that are enabled by default including block scoping, classes, typed arrays (Node's Buffer is now backed by Uint8Array), generators, Promises, Symbols, template strings, collections (Map, Set, etc.) and, arrow functions - https://nodejs.org/en/blog/release/v4.0.0/

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 25, 2017

There's a very big difference between "my freshly installed clone fails to build" and "my PR fails to build". One turns the contributor off completely, the other can be caught during review.

To close this conversation,

I wanted to point out that our node code is right now using arrow functions without the "use strict". Which means your "freshly installed clone fails" if you're on old node.

This PR at least fixed that by giving a right error message. I don't have an older version in any of my machines now, if @jridgewell is sure about "use strict" will do the job, please add it in your revert PR and tested under old version.

@jridgewell
Copy link
Copy Markdown
Contributor

"use strict" is only necessary to use let or const, everything else mentioned above is fine.

@lannka
Copy link
Copy Markdown
Contributor Author

lannka commented May 26, 2017

OK #9578 this is all i want.

jridgewell added a commit that referenced this pull request May 26, 2017
…9560)

This reverts commit e363fae.

Most ES6 features are supported in Node v4, you just need to put `"use
strict"` at the top of the file.
petekip pushed a commit to petekip/amphtml that referenced this pull request Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants