-
Notifications
You must be signed in to change notification settings - Fork 166
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
Use fetch-h2
by default with option to fallback to node-fetch
#522
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
I'm thinking about using |
What's the advantage of supporting both |
Yes. |
In that case, I suggest we use |
- `node-fetch` doesn't support HTTP/2 and has had an issue for support open since 2017: node-fetch/node-fetch#342 - `fetch-h2` supports HTTP1.1 and HTTP/2 with upgrade.
- Defaults to using `fetch-h2`. - Allows optionally using `node-fetch`. - Centralises calls to `fetch` in `FetchUtils`.
node-fetch
with fetch-h2
on core
fetch-h2
by default with option to fallback to node-fetch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good!
Aren't we going to make one of them an optional dependency?
I don't think there's a big overhead in having both and this allow deciding which one to use when executing the app. Otherwise, users need to decide at install time. |
Gotcha, LGTM |
node-fetch
doesn't support HTTP/2 and has had an issue forsupport open since 2017: Support HTTP/2 node-fetch/node-fetch#342
fetch-h2
supports HTTP1.1 and HTTP/2 with upgrade.fetch-h2
by default, but allows changing the default fromFetchUtils.setFetchEngine()
.