Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

[v5] Indicate the supported Node.js version in package.json #2316

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

realityking
Copy link
Contributor

@realityking realityking commented Apr 4, 2018

I based the range on what's indicated in .travis.yml but since Travis always defaults to the newest release in each series a higher minor could be selected as well.

Especially Node.js 4.5 might be a good pick since it's the first release to support Buffer.from, Buffer.alloc and Buffer.allocUnsafe.

In #2111 I found this mention in the summary:

Moving forward we'll only be actively supporting active LTS and current Node versions. In practical terms this means Node 6+.

But it's not currently reflected in the Travis config.

Relates to #2312

Copy link
Contributor

@xzyfer xzyfer left a comment

Choose a reason for hiding this comment

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

What exactly is the benefit onlf using engines?

I was under the impression it wasn't encouraged by npm anymore.

Additionally we'll be dropping Node 4 for the v5 release. For readability please use caret ranges.

^6 || ^8 || ^9 || ^10

@realityking
Copy link
Contributor Author

It's mostly machine readable documentation - npm will just print a warning, though yarn will actually error out when used on an unsupported Node.js version.

I followed your suggestion partially and changed it to ^6.9 || ^8.9 || >= 9 because

  • Node.js 6.5 actually contains a few new features around ES2015 support that v5 could then use at some point of time
  • Excluding Node.js 11 - which will be released in 1.5 years - seems like a bad idea.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 4, 2018

The version choices seem arbitrary. Our support policy will be Active LTS and Current. We don't get to choose which minor/patch we choose to support because it's convenient to us.

We either

  • support the whole range, ^6 || ^8` or,
  • support from the specific version version a release line went LTS (usually a couple months after the initial release).

I was unable to find a list of at what specific version a release went LTS. For now please keep it at ^6 || ^8. We'll cross the JS feature bridge when we come to it.

Additionally >= 9 is too broad. We'll have dropped 9 before start supporting 11. Please stick to the suggested ^9 || ^10, it's far easier for us to delete/update without thinking.

@realityking
Copy link
Contributor Author

realityking commented Apr 4, 2018

Sorry, I should've mentioned how I arrived at those minor versions.

6.9 and 8.9 are the releases where those versions transitioned into LTS. See these blog posts for reference:

As for the second point, at least for users using yarn this would mean any user using Node.js 11 could not use node-sass without you releasing a new version.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 4, 2018

Nice one, I was trying to find those blog post but missed it.

any user using Node.js 11 could not use node-sass without you releasing a new version

This is mostly true regardless because we wouldn't have the binaries ready.
We'd do a major bump when

  • 9 transitions to maintenance, and 10 going into Active LTS (to drop 9 support)
  • 10 transitions to active LTS, and 11 is released (to reduce 10 support to >= active LTS)

Users who want to live on the bleeding edge can use the --ignore-engines flag.

@realityking
Copy link
Contributor Author

Fair point about the binaries. Changed to ^6.9 || ^8.9 || ^9 || ^10

@xzyfer
Copy link
Contributor

xzyfer commented Apr 4, 2018

Looks like travis was having issues. Kicked off a rebuild.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 4, 2018

Thanks again ❤️

@xzyfer xzyfer merged commit 6dfa324 into sass:v5 Apr 4, 2018
@xzyfer xzyfer mentioned this pull request Apr 4, 2018
14 tasks
@saper
Copy link
Member

saper commented Jun 10, 2018

I wonder if we shouldn't add this to 4.x. too - even when using node 10 yarn has no way of knowing it needs to install newer version than specified

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants