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

Remove AbortController polyfill as it is no longer needed and use native fetch where possible #8162

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

talentlessguy
Copy link

Description

This PR removes a redundant AbortController polyfill, since it's supported natively in Node.js since v14.18, and Firebase minimum target is 18. It also removes fetch polyfill where it's not needed anymore, however I had to leave it be in one place because of usage of custom HTTP agents, which native fetch doesn't support yet. node-fetch-native supports proxies but not custom http agents based on what I know.

Scenarios Tested

I've run npm test, and a bunch of unrelated tests started failing (assertions). Will see what I can do. Linting passes though

@@ -374,7 +371,7 @@ export class Client {
reqTimeout = setTimeout(() => {
controller.abort();
}, options.timeout);
fetchOptions.signal = controller.signal;
fetchOptions.signal = controller.signal as RequestInit["signal"];
Copy link
Author

Choose a reason for hiding this comment

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

this is due to node-fetch AbortController types not being up-to-date with the runtime AbortController which supports more features

@talentlessguy talentlessguy marked this pull request as ready for review February 7, 2025 13:00
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.

1 participant