Skip to content

Add Miniflare & Wrangler support for unbound Durable Objects#10596

Merged
penalosa merged 8 commits intomainfrom
penalosa/do-migrations-storage
Sep 14, 2025
Merged

Add Miniflare & Wrangler support for unbound Durable Objects#10596
penalosa merged 8 commits intomainfrom
penalosa/do-migrations-storage

Conversation

@penalosa
Copy link
Copy Markdown
Contributor

@penalosa penalosa commented Sep 9, 2025

Fixes #10294


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal implementation detail
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: not a patch

@penalosa penalosa requested a review from a team as a code owner September 9, 2025 22:10
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: f1105de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
miniflare Minor
wrangler Minor
@cloudflare/pages-shared Patch
@cloudflare/vite-plugin Major
@cloudflare/vitest-pool-workers Patch

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

@penalosa penalosa force-pushed the penalosa/do-migrations-storage branch from 654af9f to 21d5739 Compare September 9, 2025 22:11
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Sep 9, 2025
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Sep 9, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: f1105de

@github-actions
Copy link
Copy Markdown
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main penalosa/do-migrations-storage might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-10596
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

@penalosa penalosa force-pushed the penalosa/do-migrations-storage branch from 9829be6 to eb271e3 Compare September 12, 2025 17:36
Copy link
Copy Markdown
Contributor

@jamesopstad jamesopstad 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 to me. Non-blocking question: The alternative approach would be to collect all the DOs in the same way (by storage) and then collect the bindings for those that have them. Would that also work or not?

Comment on lines 357 to 354
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is exactly the same as the map callback above. Could we combine before mapping e.g. [...Object.values(workerOpts.do.durableObjects ?? {}), ...(workerOpts.do.additionalUnboundDurableObjects ?? [])].map(). Either that or extract the callback into a function that's reused.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Sep 12, 2025
@penalosa
Copy link
Copy Markdown
Contributor Author

Looks good to me. Non-blocking question: The alternative approach would be to collect all the DOs in the same way (by storage) and then collect the bindings for those that have them. Would that also work or not?

In theory, yes, and I initially tried that approach. However, it ended up being much more invasive across Miniflare/Vite/Vitest since all of those assume in various places that the durable object config is a record of binding name to config. This approach seemed like a much simpler option to reduce the added complexity

@penalosa penalosa force-pushed the penalosa/do-migrations-storage branch from 2fd34ff to d9477b7 Compare September 12, 2025 19:11
penalosa and others added 6 commits September 12, 2025 20:19
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
@penalosa penalosa merged commit 735785e into main Sep 14, 2025
83 of 107 checks passed
@penalosa penalosa deleted the penalosa/do-migrations-storage branch September 14, 2025 16:50
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

wrangler doesn't recognize a Durable Object namespace exists without a binding

3 participants