Skip to content

Use isomorphic fetch #506

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

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

Conversation

sv2dev
Copy link

@sv2dev sv2dev commented May 3, 2024

Since fetch is stable in the current LTS version of Node, I don't see any good reason for using node-fetch or any other solution than the web standard.

@CLAassistant
Copy link

CLAassistant commented May 3, 2024

CLA assistant check
All committers have signed the CLA.

@ksinder
Copy link
Contributor

ksinder commented Apr 10, 2025

👋 Hi from Notion's API team! Thanks @huv1k @sv2dev for bumping this issue, looks like it's been open for a while. I don't have much context on this yet, though it looks like you have merge conflicts. I recently added a test that relies on us overriding the fetch passed to the Client constructor so we may need to restructure that if we go this route. Beyond that, I'll check with some folks internally to get caught up on our stance re: isomorphic fetch and see if I can get you an update here!

@sv2dev sv2dev force-pushed the isomorphic-fetch branch 4 times, most recently from 26ff5c4 to 7abf2aa Compare April 10, 2025 17:41
@sv2dev
Copy link
Author

sv2dev commented Apr 10, 2025

Hey @ksinder, thanks for picking this up.
I resolved the conflicts and fixed the test.

@ksinder
Copy link
Contributor

ksinder commented Apr 23, 2025

Getting rid of the node-fetch dependency seems great, but I think ideally we still want to allow passing a fetch constructor argument into the Client to support everyone's individual use-case, instead of only supporting isomorphic fetch. Is there any way to reference a common static type for fetch to get rid of the node-fetch dependency without regressing the customizability?

sv2dev added 3 commits April 25, 2025 21:04
It should be sufficient to run the TypeScript tests.
This way we don't have to run a build before executing the unit tests.
@sv2dev sv2dev force-pushed the isomorphic-fetch branch from 7abf2aa to 3f53ab4 Compare April 25, 2025 19:05
@sv2dev
Copy link
Author

sv2dev commented Apr 25, 2025

Okay, I reverted the typings and client parameter related stuff. Now we should be able to use a different fetch implementation like node-fetch, and the Web API fetch is used by default.

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.

3 participants