node-fetch/fetch-blob

Support Node.js v12

jaydenseric opened this issue · 4 comments

Currently, only Node.js v14+ is supported:

fetch-blob/package.json

Lines 28 to 30 in 4747497

"engines": {
"node": ">=14.0.0"
},

I didn't realize this when I tried to update to the latest version and ran into problems with optional chaining:

Many packages at the moment, including all of mine, support Node.js ^12.20 || >= 14.13. E.g:

https://github.com/jaydenseric/apollo-upload-client/blob/e19deb9f1fc950f35a2f652c02135408bbe2a38a/package.json#L43-L45

This range supports most of the important Node.js ESM and package exports field features.

Until Node.js v12 is EOL we'll be stuck on the last fetch-blob version to support it; would you consider expanding the current level of support to accept Node.js ^12.20 || >= 14.13?

We made the decision to ditch commonjs for ESM. Guess we wasn't so thoughtful of selecting the right node versions. We have a PR in node fetch that changed the engine to "node": "^12.20.0 || ^14.13.1 || >=16.0.0"

Maybe should select the same range since that is all version that support ESM

Willing to make PR and change package.json to those version?

^12.20.0 || ^14.13.1 || >=16.0.0 is still too high, and would result in us having to semver major change our ^12.20 || >= 14.13 ranges in any packages consuming fetch-blob.

  • 12.20.0 is fine.
  • 14.13.1 should be 14.13.0. The only reason you would specify the later patch version is if you use the node: namespace for builtin modules (which you currently are not).
  • To my knowledge, there is no functional reason to skip v15.

That's fine

then maybe this can work?
^12.20.0 || >14.13.0

You forgot the = in the >=, it should be: ^12.20 || >= 14.13 (or ^12.20.0 || >= 14.13.0 is the same thing if you prefer that style).