feat(http): Add streaming request body support#3635
Merged
feat(http): Add streaming request body support#3635
Conversation
Deploying feathers-eagle with
|
| Latest commit: |
35b09d3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://31fcff55.feathers-a8l.pages.dev |
| Branch Preview URL: | https://v6-streaming.feathers-a8l.pages.dev |
Deploying feathers-dove with
|
| Latest commit: |
35b09d3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0ec7482f.feathers.pages.dev |
| Branch Preview URL: | https://v6-streaming.feathers.pages.dev |
- Auto-detect ReadableStream in fetch client and pass through directly - Stream unknown content types to services instead of throwing error - Replace @whatwg-node/server with native Node.js adapter - Add tests for streaming text, binary, and chunked data - Update REST client docs with streaming upload examples
a4bfcb8 to
1873ed5
Compare
- Add createHandler for Web Standard (Request) => Response pattern - Add toNodeHandler adapter for Node.js http.createServer - Works natively in Deno, Bun, and Cloudflare Workers - Node.js requires the adapter due to lack of native Web Standard server - Add feathers/http/node export for Node.js adapter - Add documentation for all runtimes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to stream data into Feathers services using
ReadableStream.Changes
Client (
packages/feathers/src/client/fetch.ts)ReadableStreamand passes it directly to fetchduplex: 'half'for streaming bodiesapplication/octet-streamif no Content-Type specifiedServer (
packages/feathers/src/http/middleware.ts)ReadableStreamTest Fixture (
packages/feathers/fixtures/index.ts)@whatwg-node/serverwith native Node.js adapterStreamingServicefor testingUsage
Use Cases
Compatibility
This PR is compatible with
v6-form-data. When both merge, the bodyParser will handle:application/json→ parsedapplication/x-www-form-urlencoded→ parsedmultipart/form-data→ parsed (from form-data PR)Breaking Changes
None. Previously unknown content types threw an error; now they stream through.