Skip to content

[Stream] Add Stream binding local mode#13030

Merged
petebacondarwin merged 11 commits intomainfrom
nwong/STREAM-6694
Mar 25, 2026
Merged

[Stream] Add Stream binding local mode#13030
petebacondarwin merged 11 commits intomainfrom
nwong/STREAM-6694

Conversation

@natewong1313
Copy link
Copy Markdown
Member

@natewong1313 natewong1313 commented Mar 23, 2026

This MR adds local mode support for the Stream binding. Its architected as follows

  • entry worker in binding.worker.ts has a bunch of RPC targets, which mimics our production implementation
  • DO in object.worker.ts handles blob storage for video/watermark files, plus SQLlite for crud operations

Note that this MR doesn't support creating direct upload URLs yet but I'll do that in a follow up MR


  • 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: Feature is in progress

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 23, 2026 23:29
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: b2d629d

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 23, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 23, 2026

APIError: Not Found: Not found

github run

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 23, 2026

@natewong1313 Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@natewong1313 natewong1313 changed the title feat: Add Stream binding local mode [Stream] Add Stream binding local mode Mar 23, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 23, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: b2d629d

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 6 additional findings.

Open in Devin Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

✅ All changesets look good

@austin-mc
Copy link
Copy Markdown
Contributor

lgtm!

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Done to Untriaged in workers-sdk Mar 25, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

The miniflare plugin itself looks good - I have left a few comments but I think they are mostly just nits that you can choose to implement if you wish.

I would, though, like to see some changes to the tests - there are quite a few scenarios (e.g. non-happy path) that are not tested. But most importantly, I would like the following:

  • can we add tests that check the plugin works on reloads (e.g. setOptions and persistence changes).
  • avoid using "real timers" in the tests (e.g. await new Promise((r) => setTimeout(r, 5));) which slow down the tests and can also be potential causes of flakes under load. Other plugins implement enableFakeTimers and are able to use that approach to get the desired test coverage.

I am sure that OC could fix up these tests in no time. If you want help I could do probably do this?

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

The miniflare plugin itself looks good - I have left a few comments but I think they are mostly just nits that you can choose to implement if you wish.

I would, though, like to see some changes to the tests - there are quite a few scenarios (e.g. non-happy path) that are not tested. But most importantly, I would like the following:

  • can we add tests that check the plugin works on reloads (e.g. setOptions and persistence changes).
  • avoid using "real timers" in the tests (e.g. await new Promise((r) => setTimeout(r, 5));) which slow down the tests and can also be potential causes of flakes under load. Other plugins implement enableFakeTimers and are able to use that approach to get the desired test coverage.

I am sure that OC could fix up these tests in no time. If you want help I could do probably do this?

Thanks Pete, I've added more tests with what you wanted and got rid of timers

@github-project-automation github-project-automation bot moved this from In Review to Approved in workers-sdk Mar 25, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

natewong1313 and others added 5 commits March 25, 2026 13:29
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@petebacondarwin petebacondarwin merged commit 0386553 into main Mar 25, 2026
48 checks passed
@petebacondarwin petebacondarwin deleted the nwong/STREAM-6694 branch March 25, 2026 18:58
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 25, 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.

4 participants