cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: use native fetch from node

Open jbroma opened this issue 1 year ago • 0 comments

Summary:

When using CLI with Node >= 21, there are deprecation warnings showing up in console, which can be traced to [email protected] which is a dependency of node-fetch. I've replaced node-fetch with native fetch from Node. Since Node18, the fetch is no longer under experimental flag, and since Node21 it's marked as stable.

Remarks:

  • Needed to remove @types/opentype.js package as it was polluting global context with DOM types
  • fetchToTemp used stream.Readable.fromWeb which is still marked as experimental but we only use use it inside of cli-doctor so the impact is relatively low

Test Plan:

  • [ ] - test by setting up a new project

Checklist

  • [x] Documentation is up to date to reflect these changes.
  • [x] Follows commit message convention described in CONTRIBUTING.md

jbroma avatar May 07 '24 10:05 jbroma