Open
Conversation
- Remove cross-fetch imports from source files and replace with global fetch - Remove cross-fetch from package.json dependencies across 5 packages - Update tests to use global fetch instead of cross-fetch - Add DOM lib to connected-solid tsconfig.esm.json to provide type definitions for DOM types (HeadersInit, window, etc.) that were previously provided transitively via cross-fetch's type reference Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove cross-fetch usage in major release
Remove Jan 3, 2026
cross-fetch usage
There was a problem hiding this comment.
Pull request overview
This PR removes the cross-fetch polyfill dependency from the codebase in favor of native fetch, which is now globally available as of Node 18 (the minimum supported version). The changes eliminate an unnecessary dependency and modernize the codebase.
- Replaced all
cross-fetchimports with native globalfetch - Removed
cross-fetchfrom 5 package.json files - Updated TypeScript configuration to include DOM types previously provided transitively
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/connected-solid/src/util/guaranteeFetch.ts |
Removed cross-fetch import and updated to use global fetch; also fixed typo "Guantees" → "Guarantees" |
packages/solid-react/src/UnauthenticatedSolidLdoProvider.tsx |
Removed cross-fetch import and changed from libraryFetch to global fetch |
packages/test-solid-server/src/authFetch.ts |
Removed unused cross-fetch import (already using global fetch) |
packages/connected-solid/test/guaranteeFetch.test.ts |
Updated test assertion from crossFetch to global fetch and updated test description |
packages/solid-type-index/test/fileData.ts |
Removed unused cross-fetch type import |
packages/solid-react/test/fileData.ts |
Removed unused cross-fetch import |
packages/connected-solid/tsconfig.esm.json |
Added "lib": ["ES2021", "DOM"] to provide DOM types like HeadersInit |
packages/connected-solid/package.json |
Removed cross-fetch dependency |
packages/solid-react/package.json |
Removed cross-fetch dependency |
packages/react/package.json |
Removed cross-fetch dependency |
packages/ldo/package.json |
Removed cross-fetch dev dependency |
packages/connected-nextgraph/package.json |
Removed cross-fetch dependency |
package-lock.json |
Updated lockfile to reflect removed dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
Note that https://github.com/o-development/ldo/pull/122/files also adds a minimum version number to the package.json |
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.
fetchis a global API as of Node 18, which is now the minimum supported version. This removes thecross-fetchpolyfill dependency.Changes
Source files: Replace
cross-fetchimports with nativefetchin:packages/connected-solid/src/util/guaranteeFetch.tspackages/solid-react/src/UnauthenticatedSolidLdoProvider.tsxpackages/test-solid-server/src/authFetch.tsDependencies: Remove
cross-fetchfrom 5 package.json files:connected-solid,solid-react,connected-nextgraph,ldo,reactTypeScript config: Add
"lib": ["ES2021", "DOM"]topackages/connected-solid/tsconfig.esm.jsonto provide DOM types (HeadersInit,window, etc.) that were previously included transitively viacross-fetch's type referenceTests: Update
guaranteeFetch.test.tsto assert against globalfetchinstead ofcrossFetchExample
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.w3.org/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/ldo/ldo/node_modules/jest-worker/build/workers/processChild.js mcli/run-script/--coverage node er/b�� config.esm.json tsconfig.cjs.json(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/ldo/ldo/node_modules/jest-worker/build/workers/processChild.js odules/.bin/sh node er/b�� config.esm.json tsconfig.cjs.json(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/ldo/ldo/node_modules/jest-worker/build/workers/processChild.js es/ldo/node_modu--coverage sh k/ld�� tsc --project tsconfig.esm.json n es/.bin/sh config.cjs.json watchman node mcli/run-script/lib/node-gyp-binjest --coverage sh -c config.cjs.json && node ../../scripts/rename-to-cjs.js sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original 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.