Node 6 has reached its official end-of-life date as of 30th April 2019.
Today Gatsby _mostly_ supports Node 6. However as some of Gatsby's dependencies have upgraded, they've dropped Node 6 support. This means that e.g. gatsby new won't work when running Node 6, but an existing site will continue to build fine (for now).
Increasingly we are having to make decisions about dependencies that have (rightly) stopped supporting Node 6.
We should create a policy on how Gatsby intends to handle supporting Node versions, then implement that policy for Gatsby's Node 6 support.
Related reading:
Gatsby should support any Node version who's status is _Current Release_, _Active LTS_, or _Maintenance LTS_. I think that's not too controversial.
What do we do once a supported version reaches _End of Life_ status?
Stop actively supporting that version of Node?
Explicitly drop support for that version of Node
babel-preset-gatsby to target only newer Node versions, resulting in less code being shipped. Release a major version of Gatsby and related plugins that drops support for that version?
Something else?
Time passes, Node versions increment and fade away, Gatsby must adapt.
Edit: updated to show we've gone with option 2. See comments for to-dos.
Gatsby's telemetry data indicates that around 0.75% of people are currently using Node 6 with their Gatsby project.
We could do something like this https://github.com/verdaccio/verdaccio/pull/968/files
@m-allanson I think that's a worthwhile thing to do. We do that similarly in gatsby-cli, but it's not quite as robust or nice as verdaccio's solution. https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-cli/src/index.js#L18
I also think engines would work pretty well here? At least, in theory 🤞
problems problems:
We'd want very good docs for upgrading people's node version — e.g. we detect what OS they're on, how they installed it (homebrew, download, etc.) etc. Otherwise we'll just lose a lot of people.
Our Node 6 support is starting to block other PRs. We're going to go with option two - release a minor version of Gatsby that checks for the version of Node you’re running and exits with an error message if you’re using Node 6.
Something like - “Your version of Node 6.x.x has reached end of life, please update to Node 8 or downgrade to gatsby 2.x.x to continue. See gatsby.dev/node-js-versions”)
PR #14785 adds a first set of documentation on when Gatsby will drop support for a given Node version, and how to upgrade from Node 6.
We'd want very good docs for upgrading people's node version
The new upgrade guide covers upgrading using homebrew (as recommended in tutorial part 0), tools like nvm and n and downloading the installer from nodejs.org.
We could potentially update the docs with instructions on how to use babel-node if we're seeing further problems from people upgrading.
Next steps:
Follow ups (for a new issue?):
Edit: @m-allanson edited this todo list ☝️
In thinking more about this--our main reservation in a major release is primarily in (pre-maturely) releasing Gatsby v3.0.0 and not being able to group more meaningful breaking changes (e.g. webpack, API changes, etc.).
This is a fair reason. However, to make strides towards reducing even less churn, I propose the following:
Doing this will let people pin Gatsby to a certain version (prior to 2.1.0) and then keep their _current_ versions of packages within the version range that supported Node 6, which again mitigates churn.
Thoughts?
I'd say no. Major releases are bad because very few update. We don't want to harm everyone on v8+ by opting them out of improvements. Also the logic is inconsistent. People on v6 are just as broken with major releases for plugins. If they really want to stay put, they can pin everything.
Most helpful comment
I'd say no. Major releases are bad because very few update. We don't want to harm everyone on v8+ by opting them out of improvements. Also the logic is inconsistent. People on v6 are just as broken with major releases for plugins. If they really want to stay put, they can pin everything.