Skip to content

fix: Update fetch input types to account for Request object as first … - #1766

Open
janniks wants to merge 3 commits into
mainfrom
fix/update-fetch-types
Open

fix: Update fetch input types to account for Request object as first …#1766
janniks wants to merge 3 commits into
mainfrom
fix/update-fetch-types

Conversation

@janniks

@janniks janniks commented Nov 18, 2024 •

Copy link
Copy Markdown
Contributor

This PR was published to npm with the version 7.0.3-pr.4+64a49b58
e.g. npm install @stacks/common@7.0.3-pr.4+64a49b58 --save-exact

  • I think we need this for better compat with the createClient approach. Mainly for types, but also a fetch param could look different from the only string format supported currently (even though maybe this mainly already works... probably)
  • Added a url: fetchParams.input so this won't impact current code (just show deprecation notice)

@janniks
janniks requested a review from zone117x November 18, 2024 18:24
@vercel

vercel Bot commented Nov 18, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stacksjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 0:21am

@codecov

codecov Bot commented Nov 18, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/common/src/fetch.ts 85.71% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

}

export type FetchFn = (url: string, init?: RequestInit) => Promise<Response>;
export type FetchFn = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this just be:

export FetchFn = typeof globalThis.fetch;

?

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.

3 participants