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

feat: use native fetch from node #2381

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jbroma
Copy link
Contributor

@jbroma jbroma commented May 7, 2024

Summary:

When using CLI with Node >= 21, there are deprecation warnings showing up in console, which can be traced to whatwg-url@5.0.0 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

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

Copy link
Collaborator

@szymonrybczak szymonrybczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Still there are some errors in higher Node versions, I'll address them in upcoming PRs 👍

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

Successfully merging this pull request may close these issues.

None yet

4 participants