[Stream] Add worker bindings support#12957
Conversation
🦋 Changeset detectedLatest commit: 081bb8d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
penalosa
left a comment
There was a problem hiding this comment.
Looks good! But could you remove the raw field? Apologies, I was wrong on that point
No worries, went ahead and removed it |
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 Missing stream binding handling in miniflare buildMiniflareBindingOptions (packages/wrangler/src/dev/miniflare/index.ts:599-601)
In packages/wrangler/src/dev/miniflare/index.ts, the media binding is extracted (line 501), warned about being always-remote (line 599-600), and passed to miniflare's binding options (line 770-776). The stream binding has none of this handling — it is not extracted, not warned about, and not passed through. Without at least a warnOrError call like media has, users who try to use a stream binding in local dev will get no feedback that the binding requires a remote proxy connection. Additionally, unlike media which has a miniflare plugin at packages/miniflare/src/plugins/media/, there is no corresponding miniflare plugin for stream, so the binding cannot be proxied to the remote session even when remote: true is set.
View 6 additional findings in Devin Review.
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 Missing stream binding handling in miniflare buildMiniflareBindingOptions (packages/wrangler/src/dev/miniflare/index.ts:599-601)
In packages/wrangler/src/dev/miniflare/index.ts, the media binding is extracted (line 501), warned about being always-remote (line 599-600), and passed to miniflare's binding options (line 770-776). The stream binding has none of this handling — it is not extracted, not warned about, and not passed through. Without at least a warnOrError call like media has, users who try to use a stream binding in local dev will get no feedback that the binding requires a remote proxy connection. Additionally, unlike media which has a miniflare plugin at packages/miniflare/src/plugins/media/, there is no corresponding miniflare plugin for stream, so the binding cannot be proxied to the remote session even when remote: true is set.
View 9 additional findings in Devin Review.
6de4dd0 to
081bb8d
Compare
Fixes STREAM-6693
This PR updates the wrangler and workers-utils packages to recognize the Stream binding. Support for a local mode via miniflare will be included in a separate PR.
A picture of a cute animal (not mandatory, but encouraged)
