Skip to content

Conversation

penalosa
Copy link
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
Copy link

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
Copy link

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

Copy link
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 added the skip-v3-pr Skip validation of presence of a v3 backport PR label Sep 12, 2025
@penalosa penalosa force-pushed the penalosa/do-migrations-storage branch from 9829be6 to eb271e3 Compare September 12, 2025 17:36
Copy link
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
).map((workerDODesignator) => {
const doInfo = normaliseDurableObject(workerDODesignator);
if (doInfo.serviceName === undefined) {
// Fallback to current worker service if name not defined
doInfo.serviceName = workerServiceName;
}
return {
doInfo,
workerRawName: workerOpts.core.name,
};
});
Copy link
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

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