Skip to content

Remove cross-fetch dependency in favor of global fetch#134

Open
Copilot wants to merge 4 commits intomainfrom
copilot/remove-cross-fetch-usage-again
Open

Remove cross-fetch dependency in favor of global fetch#134
Copilot wants to merge 4 commits intomainfrom
copilot/remove-cross-fetch-usage-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

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.

fetch is globally available since Node 18, which is now the minimum supported version. Remove the cross-fetch polyfill across the monorepo.

  • Source files: Remove cross-fetch imports from guaranteeFetch.ts, authFetch.ts, UnauthenticatedSolidLdoProvider.tsx, and test helpers in solid-type-index and solid-react — all now use the global fetch
  • Package dependencies: Remove cross-fetch from dependencies/devDependencies in connected-solid, ldo, react, connected-nextgraph, and solid-react
// Before
import crossFetch from "cross-fetch";
export function guaranteeFetch(fetchInput?: typeof fetch): typeof fetch {
  return fetchInput || crossFetch;
}

// After
export function guaranteeFetch(fetchInput?: typeof fetch): typeof fetch {
  return fetchInput || fetch;
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove cross-fetch usage</issue_title>
<issue_description>fetch is a global object as of Node 18; which is now the oldest supported version of Node. Thus it is safe to remove the cross-fetch global and just use fetch in the next major release.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI and others added 2 commits March 8, 2026 12:13
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 cross-fetch dependency in favor of global fetch Mar 8, 2026
Copilot finished work on behalf of jeswr March 8, 2026 12:19
@jeswr jeswr marked this pull request as ready for review March 8, 2026 13:54
Copilot AI review requested due to automatic review settings March 8, 2026 13:54
@jeswr
Copy link
Copy Markdown
Collaborator

jeswr commented Mar 8, 2026

Supercedes #124

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-fetch imports/usages with the global fetch in runtime code and test helpers.
  • Update guaranteeFetch and its test to default to global fetch.
  • Remove cross-fetch from package dependencies/devDependencies and 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>
@jeswr jeswr requested a review from jaxoncreed March 8, 2026 14:02
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.

Remove cross-fetch usage

3 participants