Skip to content

Conversation

@RMNCLDYO
Copy link
Contributor

@RMNCLDYO RMNCLDYO commented Aug 14, 2025

What

Add TypeScript definition for the decompress option in fetch().

Why

This option works at runtime but requires @ts-ignore in TypeScript:

Before:

// @ts-ignore  
decompress: false

After:

decompress: false

How

Added the decompress property to BunFetchRequestInit interface with JSDoc documentation.

Add missing TypeScript definitions for two fetch() options that
already work at runtime but require @ts-ignore in TypeScript.
@RiskyMH RiskyMH added the types An issue with TypeScript types label Aug 14, 2025
@RiskyMH RiskyMH requested a review from alii August 14, 2025 18:57
@alii
Copy link
Member

alii commented Aug 14, 2025

decompress is supported and should be documented, but afaik highWaterMark is not implemented in Bun's fetch implementation (see src/bun.js/webcore/fetch.zig).

@RMNCLDYO RMNCLDYO changed the title feat(types): add highWaterMark and decompress to fetch() feat(types): add decompress to fetch() Aug 15, 2025
Per maintainer feedback, highWaterMark is not implemented in Bun's fetch() (only in Bun.serve()). Keeping only decompress which is supported.
@RMNCLDYO
Copy link
Contributor Author

decompress is supported and should be documented, but afaik highWaterMark is not implemented in Bun's fetch implementation (see src/bun.js/webcore/fetch.zig).

Ahh sorry about that @alii ! I've updated the PR to remove highWaterMark and keep only decompress. I see now that highWaterMark is only for Bun.serve(), not fetch().

@alii
Copy link
Member

alii commented Aug 15, 2025

Thanks! 🤩

@alii
Copy link
Member

alii commented Aug 15, 2025

Approved CI to run. Sometimes things pop up even in just types, so it's worth just checking. Will merge if all is ok

@alii
Copy link
Member

alii commented Aug 15, 2025

The failing tests are flaky, so happy to merge this. Thanks for the contribution

@alii alii merged commit 22a37b2 into oven-sh:main Aug 15, 2025
59 of 62 checks passed
@RMNCLDYO
Copy link
Contributor Author

Awesome, happy to contribute! Thanks @alii.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

types An issue with TypeScript types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants