Skip to content
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

Add full TypeScript definitions and export them, add basic TS tests. #159

Merged
merged 3 commits into from Dec 31, 2022

Conversation

developit
Copy link
Owner

I'm hoping this addresses #144. The definitions are exported both as Unfetch-prefixed names, and within an Unfetch namespace (Unfetch.Response). They're almost compatible with the standard Response/Headers/RequestInit types, except where Unfetch's Headers implementation uses an Array instead of an Iterable - the types being incompatible there is actually accurate, it's not currently possible to do response.headers.entries().next() in unfetch.

@github-actions
Copy link

Size Change: 0 B

Total Size: 1.06 kB

ℹ️ View Unchanged
Filename Size Change
dist/unfetch.js 490 B 0 B
dist/unfetch.umd.js 567 B 0 B

compressed-size-action

@developit developit merged commit fb69127 into main Dec 31, 2022
@developit developit deleted the typescript-support branch December 31, 2022 04:17
@kolorfilm
Copy link

Hi there, I don't know if this something have to do with this fix, but since I use the latest version I get eslint errors.

I'm using fetch like this this in my projects:

import fetch from 'isomorphic-unfetch'

Since the update I get: ESLint: No default export found in imported module "isomorphic-unfetch".(import/default)

@developit
Copy link
Owner Author

hey @kolorfilm - thanks for the ping, I had forgotten to remove the "files" field from isomorphic-unfetch and the publish was missing index.mjs and browser.mjs from the package. I just published isomorphic-unfetch@4.0.2 with the fix. (as validated on unpkg)

kodiakhq bot pushed a commit to X-oss-byte/Nextjs that referenced this pull request Oct 16, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [unfetch](https://togithub.com/developit/unfetch) | [`4.2.0` -> `5.0.0`](https://renovatebot.com/diffs/npm/unfetch/4.2.0/5.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/unfetch/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/unfetch/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/unfetch/4.2.0/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/unfetch/4.2.0/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>developit/unfetch (unfetch)</summary>

### [`v5.0.0`](https://togithub.com/developit/unfetch/releases/tag/5.0.0)

[Compare Source](https://togithub.com/developit/unfetch/compare/4.2.0...5.0.0)

#### What's Changed

-   Add TypeScript definitions and export them [@&#8203;developit](https://togithub.com/developit) in [developit/unfetch#159
-   Add [Package Exports](https://togithub.com/developit/unfetch/blob/ed9469aab15e2cd8c243995a8ba964599467e413/package.json#L16-L26) to both unfetch and isomorphic-unfetch

#### New Contributors

-   [@&#8203;RishikeshDarandale](https://togithub.com/RishikeshDarandale) made their first contribution to isomorphic-unfetch in [developit/unfetch#156

**Full Changelog**: developit/unfetch@4.2.0...5.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
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.

None yet

2 participants