Remove cross-fetch dependency in favor of global fetch#134
Open
Remove cross-fetch dependency in favor of global fetch#134
cross-fetch dependency in favor of global fetch#134Conversation
Since fetch is a global object as of Node 18 (the oldest supported version), cross-fetch is no longer needed. This removes: - cross-fetch imports from source and test files - cross-fetch from package.json dependencies in all affected packages - Updates guaranteeFetch to fall back to global fetch - Updates tests to verify against global fetch Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
…vider Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove cross-fetch usage in codebase
Remove Mar 8, 2026
cross-fetch dependency in favor of global fetch
Collaborator
|
Supercedes #124 |
There was a problem hiding this comment.
Pull request overview
This PR removes the cross-fetch polyfill across the monorepo and switches all internal usage to the global fetch now that Node 18+ is assumed.
Changes:
- Replace
cross-fetchimports/usages with the globalfetchin runtime code and test helpers. - Update
guaranteeFetchand its test to default to globalfetch. - Remove
cross-fetchfrom packagedependencies/devDependenciesand update the workspace lockfile.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/test-solid-server/src/authFetch.ts | Drops cross-fetch import; relies on global fetch for auth flow requests. |
| packages/solid-type-index/test/fileData.ts | Removes cross-fetch type import; uses global fetch typing for helpers. |
| packages/solid-react/test/fileData.ts | Removes cross-fetch import; uses global fetch in test setup. |
| packages/solid-react/src/UnauthenticatedSolidLdoProvider.tsx | Replaces cross-fetch with global fetch in auth context provider. |
| packages/solid-react/package.json | Removes direct cross-fetch dependency. |
| packages/react/package.json | Removes direct cross-fetch dependency. |
| packages/ldo/package.json | Removes direct cross-fetch devDependency. |
| packages/connected-solid/test/guaranteeFetch.test.ts | Updates expectation to default to global fetch. |
| packages/connected-solid/src/util/guaranteeFetch.ts | Updates implementation/docs to default to global fetch. |
| packages/connected-solid/package.json | Removes direct cross-fetch dependency. |
| packages/connected-nextgraph/package.json | Removes direct cross-fetch dependency. |
| package-lock.json | Reflects dependency graph changes after removing direct cross-fetch deps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supercedes #124. Note this is a breaking change since Node 18 will be the minimum node version supported after this change. This is not an issue since the current maintenance version of node is Node 20.
fetchis globally available since Node 18, which is now the minimum supported version. Remove thecross-fetchpolyfill across the monorepo.cross-fetchimports fromguaranteeFetch.ts,authFetch.ts,UnauthenticatedSolidLdoProvider.tsx, and test helpers insolid-type-indexandsolid-react— all now use the globalfetchcross-fetchfromdependencies/devDependenciesinconnected-solid,ldo,react,connected-nextgraph, andsolid-reactOriginal prompt
cross-fetchusage #99💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.