Skip to content

[Stream] Add worker bindings support#12957

Merged
penalosa merged 5 commits intocloudflare:mainfrom
natewong1313:nwong/stream-binding
Mar 19, 2026
Merged

[Stream] Add worker bindings support#12957
penalosa merged 5 commits intocloudflare:mainfrom
natewong1313:nwong/stream-binding

Conversation

@natewong1313
Copy link
Copy Markdown
Member

@natewong1313 natewong1313 commented Mar 18, 2026

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.

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: The binding is not publicly available yet

A picture of a cute animal (not mandatory, but encouraged)
image


Open with Devin

@natewong1313 natewong1313 requested a review from a team as a code owner March 18, 2026 20:16
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 18, 2026

🦋 Changeset detected

Latest 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

@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 18, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 18, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12957

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12957

miniflare

npm i https://pkg.pr.new/miniflare@12957

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12957

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12957

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12957

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12957

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12957

wrangler

npm i https://pkg.pr.new/wrangler@12957

commit: 081bb8d

Copy link
Copy Markdown
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! But could you remove the raw field? Apologies, I was wrong on that point

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 18, 2026
@natewong1313
Copy link
Copy Markdown
Member Author

Looks good! But could you remove the raw field? Apologies, I was wrong on that point

No worries, went ahead and removed it

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Devin Review

@natewong1313 natewong1313 force-pushed the nwong/stream-binding branch from 6de4dd0 to 081bb8d Compare March 19, 2026 17:56
@penalosa penalosa merged commit 62545c9 into cloudflare:main Mar 19, 2026
34 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants