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

feat: support web streams #432

Merged
merged 7 commits into from
Jul 10, 2023
Merged

feat: support web streams #432

merged 7 commits into from
Jul 10, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jul 10, 2023

πŸ”— Linked issue

unjs/nitro#1327

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR adds support for sending Web Streams for Node.js and for Worker environments (only via unenv+nitro). Also enables tests.

Users can directly return a web stream in an event handler.

Notes:

  • Support for workers is experimental
  • Node.js 18 is required for global ReadableStream (Node.js 16 does not support Web Streams)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Jul 10, 2023

Codecov Report

Merging #432 (5224f03) into main (e359f5f) will decrease coverage by 1.34%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main     #432      +/-   ##
==========================================
- Coverage   76.33%   75.00%   -1.34%     
==========================================
  Files          26       26              
  Lines        2502     2552      +50     
  Branches      354      365      +11     
==========================================
+ Hits         1910     1914       +4     
- Misses        592      638      +46     
Impacted Files Coverage Ξ”
src/utils/response.ts 68.75% <87.50%> (+6.13%) ⬆️

... and 5 files with indirect coverage changes

@pi0 pi0 marked this pull request as ready for review July 10, 2023 12:05
@pi0 pi0 merged commit 6d88dc4 into main Jul 10, 2023
6 checks passed
@pi0 pi0 deleted the fix/sendstream branch July 10, 2023 12:05
@pi0 pi0 mentioned this pull request Aug 4, 2023
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

1 participant