Koa: Node versions should be consistent

Created on 4 Sep 2017  路  6Comments  路  Source: koajs/koa

The engine versions, Travis versions, and recommended version from the readme should be consistent. See #935 and #1050.

Potential solutions

(mutually exclusive)

  1. Support 6 by testing it for users that may need to use it with Babel, otherwise it should not be in Node engines because it may be broken. Documentation (Readme.md and docs/api/index.md) should make it clear that 6 is required but 7.6 is recommended. 6 should be added to Travis versions.
  2. Revert #935 and the Node 6 support added in 2.0.1. Engines should be >= 7.6.0. Other versions can be left alone since using 6 would be discouraged.

Current semver version ranges

Node engines

>= 6.0.0

Recommended versions in documentation

>= 7.6.0

Travis builds

(similar to doc versions, Travis only installs the latest versions of major releases)

7 and 8

Most helpful comment

at this point i'd just like >= 10

All 6 comments

I would be in favor of solution 2, and go bit further :

Node engines
>= 7.6.0

Recommended versions in documentation
>= 8.9.0 (start of LTS). Still mention that it works for >= 7.6.0, but discourage its use due to its discontinued support and its non-adequacy for production environments.

current version ranges are ^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4

if the range is consistent anywhere, a PR is welcomed!

when node@4 is out of LTS in April 2018, we should drop support for it

Thanks for your response, was Node 4 support added? As far as I'm aware, Koa doesn't support Node <7.10.1 because it uses async/await without transpiling the syntax for compatibility with older versions.

I would recommend stopping using this syntax, compiling the npm build using Babel, or changing the current version ranges to ^7.10.1 || >= 8.1.4. What would you prefer?

If a project decides to use syntax features that are not available in older versions of Node, it is generally good practice to either drop support for those old versions entirely to reduce confusion (it's bad practice to require users to use Babel manually unless they need it for syntax in their own projects), or to use Babel to transpile the code so it still works fine on older versions. At this point, the async/await syntax is not supported in the versions of Node we say we support. If you want to support older versions of Node that don't come with this syntax we should probably start using Babel so users have the option of using Babel, instead of being forced to use it which causes confusion because not all versions of Node would require this.

@jonathanong I've been thinking about this more and realized I missed a couple details from other issues and PRs. I think we should use same version range you mentioned as long as Koa itself supports them without Babel, but either dropping 7 or adding 5 to keep our non-LTS support consistent. Then in order to ensure that Koa works on older versions of Node without Babel, we should adjust the tests so they don't use async/await at all. I would be happy to work on this last bit, do you think this is a good idea?

@jonathanong create a PR #1103 to sync node version ^7.10.1 in Readme.md with package.json/engines

at this point i'd just like >= 10

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteveCruise picture SteveCruise  路  3Comments

ElegantScripting picture ElegantScripting  路  5Comments

sibelius picture sibelius  路  3Comments

rainesinternationaldev picture rainesinternationaldev  路  5Comments

koalex picture koalex  路  3Comments