Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Node.js v12 #98

Closed
jaydenseric opened this issue Jun 11, 2021 · 4 comments
Closed

Support Node.js v12 #98

jaydenseric opened this issue Jun 11, 2021 · 4 comments

Comments

@jaydenseric
Copy link

jaydenseric commented Jun 11, 2021

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?

jaydenseric added a commit to jaydenseric/apollo-upload-client that referenced this issue Jun 11, 2021
`fetch-blob` v3 doesn’t support Node.js v12, see: node-fetch/fetch-blob#98 .
@jimmywarting
Copy link
Contributor

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?

@jaydenseric
Copy link
Author

^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.

@jimmywarting
Copy link
Contributor

That's fine

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

@jaydenseric
Copy link
Author

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).

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

No branches or pull requests

2 participants