8000 Prefer current global fetch implementation over isomorphic-fetch if available by mwolting · Pull Request #759 · linear/linear · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prefer current global fetch implementation over isomorphic-fetch if available #759

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

Merged
merged 2 commits into from
Jul 3, 2025

Conversation

mwolting
Copy link
Contributor
@mwolting mwolting commented Jul 3, 2025

isomorphic-unfetch resolves & re-exports the global fetch at the time of import (if available). This means if you want to use something like MSW to intercept requests in testing, you need to get the order of imports/logic exactly right, or it will use the global fetch available at the time of import (& most likely make actual network requests)

Instead, when global fetch is available, we can use that directly (& allow the environment to inject a different implementation into the global scope, so things like MSW actually work)

Fixes LIN-38846

@mwolting mwolting requested review from leelasn and itsmingjie July 3, 2025 15:11
Copy link
linear bot commented Jul 3, 2025

Copy link
changeset-bot bot commented Jul 3, 2025

🦋 Changeset detected

Latest commit: 785d0b7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@linear/sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mwolting mwolting merged commit 28939d3 into master Jul 3, 2025
2 checks passed
@mwolting mwolting deleted the matthijs/isomorphic-unfetch-drop branch July 3, 2025 15:18
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.

2 participants
0