-
Notifications
You must be signed in to change notification settings - Fork 10
Remove cross-fetch usage
#124
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
base: main
Are you sure you want to change the base?
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>
cross-fetch usage
There was a problem hiding this 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 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.
|
Note that https://github.com/o-development/ldo/pull/122/files also adds a minimum version number to the package.json |
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.