Skip to content

Remove timeout option#831

Merged
xxczaki merged 6 commits intomasterfrom
remove-timeout
May 25, 2020
Merged

Remove timeout option#831
xxczaki merged 6 commits intomasterfrom
remove-timeout

Conversation

@Richienb
Copy link
Copy Markdown
Member

@Richienb Richienb commented May 24, 2020

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

What changes did you make? (provide an overview)

Removed the timeout option and updated the migration guide.

Which issue (if any) does this pull request address?

Fixes #523

Richienb added 2 commits May 24, 2020 18:15
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@bitinn
Copy link
Copy Markdown
Collaborator

bitinn commented May 24, 2020

For some reasons my email reply to issues/PRs are no longer getting through, so add it again:

  • This PR has the same level of risk as removing browser export, please make sure at least 3 reviewers have approved it before merging.

  • The timeout signal module appear to be the main alternative after deprecating timeout, I suggest moving it to node-fetch org and adding extra npm owners to ensure maintenance.

  • The documentation shouldn't just say we deprecate it because of "non-standard", while this is a part of our reasoning, the main reason is something like "Abort Signal offers more finegrained control of timeout, and is standardized in Fetch spec. For convenience, we provide a timeout signal as a simple replacement for users upgrading from v2".

@Richienb Richienb requested review from NotMoni, bitinn and xxczaki May 24, 2020 12:08
@tinovyatkin
Copy link
Copy Markdown
Member

Should #810 be merged first, to keep changes to typing in this PR?

@NotMoni
Copy link
Copy Markdown
Member

NotMoni commented May 24, 2020

Again, here Coveralls Coverage decreased by -0.01%

@xxczaki
Copy link
Copy Markdown
Member

xxczaki commented May 24, 2020

@NotMoni This is not a big deal here, once we merge #829 the coverage will raise, as it also includes the updated ignore comments.

We might want to try and bring the coverage back to a full 100% soon in a separate PR.

@xxczaki
Copy link
Copy Markdown
Member

xxczaki commented May 24, 2020

@tinovyatkin Yes, I think so.

@NotMoni
Copy link
Copy Markdown
Member

NotMoni commented May 24, 2020

@NotMoni This is not a big deal here, once we merge #829 the coverage will raise, as it also includes the updated ignore comments.

We might want to try and bring the coverage back to a full 100% soon in a separate PR.

Yea, coverage to 100% will be good to do.

@tinovyatkin
Copy link
Copy Markdown
Member

tinovyatkin commented May 24, 2020

This will be a very painful breaking change for may libraries that depends on node-fetch, as it will require to introduce abort-controller as a dependency. Maybe we should just deprecate timeout in 3.0 and remove it in the next major?

@xxczaki
Copy link
Copy Markdown
Member

xxczaki commented May 24, 2020

@tinovyatkin It would, but only for people, who actually want to use this feature. So the others would benefit, as the "core" node-fetch package would not include it.

I agree that this is a breaking change, so more discussion is probably a good thing.

cc @node-fetch/core

@tinovyatkin
Copy link
Copy Markdown
Member

tinovyatkin commented May 24, 2020

@xxczaki I mean, I believe that it will be too hard to implement vs a desire to just stick with 2.x version. For example, gaxios by Google is using node-fetch and even has abort-controller as a dependency, but only to declare types:
https://github.com/googleapis/gaxios/search?q=abort-controller&unscoped_q=abort-controller

So, now they will need to decide whether to drop timeout parameter on their side and release new major of gaxios or implement their timeout via AbortSignal or just pin the dependency on the latest 2.x version of node-fetch until they will have the bandwidth to deal with it.

gaxios engine requirement is already 10.x, so, actually that will be the only breaking change for them...

Deprecating (with process.emitWarning) this parameter in 3.0 will allow us to get customer feedback before moving forward - I believe it's a Node.JS way for matured libraries.

@NotMoni
Copy link
Copy Markdown
Member

NotMoni commented May 24, 2020

pls fix merge conflict with TS Typing before we can merge

cc/ @Richienb

…o remove-timeout

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@gr2m
Copy link
Copy Markdown
Collaborator

gr2m commented May 25, 2020

This will be a very painful breaking change for may libraries that depends on node-fetch, as it will require to introduce abort-controller as a dependency

For what it's worth, I use node-fetch heavily in the @octokit libraries, and I allow to pass a signal option to each request, which can be set using an AbortController instance. I do not need to add abort-controller as a dependency, it's up to the integrator to add that if they need to.

Copy link
Copy Markdown
Collaborator

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Great work 👍

@xxczaki xxczaki merged commit 94e5b92 into master May 25, 2020
@xxczaki xxczaki deleted the remove-timeout branch May 25, 2020 11:30
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

Successfully merging this pull request may close these issues.

Should we deprecate timeout in favor of AbortController?

7 participants