feat: re-export header types from fetchdts#1358
feat: re-export header types from fetchdts#1358LikiosSedo wants to merge 3 commits intoh3js:mainfrom
Conversation
Re-export TypedHeaders, RequestHeaders, ResponseHeaders, RequestHeaderMap, and ResponseHeaderMap so consumers can type functions that accept h3 headers without importing fetchdts directly. Closes h3js#1308
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated TypeScript exports to expose five header-related types (TypedHeaders, RequestHeaders, ResponseHeaders, RequestHeaderMap, ResponseHeaderMap) by adding imports/re-exports in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…fetchdts re-export Avoids build issues since fetchdts is a devDependency — the build tool (obuild) inlines types referenced through h3's own modules but may not handle direct re-exports from external packages.
Import TypedHeaders, RequestHeaders, ResponseHeaders, RequestHeaderMap, and ResponseHeaderMap from fetchdts and re-export them so the build tool can inline them properly.
Summary
Re-export
TypedHeaders,RequestHeaders,ResponseHeaders,RequestHeaderMap, andResponseHeaderMapfromfetchdtsso consumers can type functions that accept h3 headers without importingfetchdtsdirectly.Currently
TypedServerRequestis exported but theTypedHeaderstype used by itsheadersproperty is not, making it awkward to write typed helper functions.Also adds the
RequestHeadersandResponseHeadersexports mentioned in the migration guide ("TypedHeaders: Migrate to RequestHeaders and ResponseHeaders").Closes #1308
Summary by CodeRabbit