[wrangler] Add experimental support for declarative Durable Object exports#14210
Draft
petebacondarwin wants to merge 3 commits into
Draft
[wrangler] Add experimental support for declarative Durable Object exports#14210petebacondarwin wants to merge 3 commits into
petebacondarwin wants to merge 3 commits into
Conversation
…ports Adds client-side wiring for the EWC declarative DO exports flow (DEVX-2572). Gated behind --experimental-do-exports (alias --x-do-exports). Wires the new field through both `wrangler deploy` and `wrangler versions upload`, renders the success-side reconciliation envelope (created / updated / deleted / renamed / transferred / transfer_pending / info / warnings / removable_entries), and converts the EWC `ErrExportsReconciliation` error envelope's `meta.details[]` into a structured UserError so the deploy command surfaces every blocking scenario in one round trip. Also extends the new @cloudflare/config package's `exports.durableObject()` with tombstone factories (`deleted()`, `renamed()`, `transferred()`) and a `transferFrom` option, and replaces the previous `convertExports` throw with a snake_case conversion that maps to the wrangler config schema. Spec: https://wiki.cfdata.org/spaces/WX/pages/1396640001
🦋 Changeset detectedLatest commit: be1facc The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
@cloudflare/wrangler-bundler
commit: |
DEVX-2572 replaces the "Durable Object exports are not currently supported" throw in @cloudflare/config's convertExports with a snake_case conversion. Update the experimental-new-config spec to assert that resolvePluginConfig now succeeds rather than throws.
…s e2e
Restructure the gated DEVX-2572 e2e suite into four self-contained
describe blocks, each owning its own helper / worker(s) and afterAll
cleanup so stateful deploy sequences can't bleed across blocks:
- wrangler deploy — keeps the existing scenarios 1, 2, T2,
T3, and 5 (auto-provision, no-op,
delete tombstone, stale tombstone, and
the 100402 multi-error envelope).
- wrangler versions upload — exercises the same payload and
reconciliation rendering on the
POST /versions path.
- zero-downtime rename — three deploys covering the live target
+ renamed tombstone shape and the
no-op drop of the tombstone.
- cross-script transfer — two-script, two-phase commit covering
target-side transfer_from -> Transfer
pending, then source-side transferred
-> Transferred (committed).
Still gated behind WRANGLER_E2E_DO_EXPORTS=1 + CLOUDFLARE_ACCOUNT_ID so
the suite stays inert in CI until the server-side exports_reconciliation
entitlement is enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes DEVX-2572.
Adds client-side wiring for the EWC declarative Durable Object exports flow.
What this adds
A new declarative
exportsmap inwrangler.json/wrangler.tomlas an alternative to the legacymigrationsarray, gated behind--experimental-do-exports(alias--x-do-exports):{ "exports": { "MyDO": { "type": "durable_object", "storage": "sqlite" }, "OldGone": { "type": "deleted" }, "OldName": { "type": "renamed", "renamed_to": "NewName" }, "Movee": { "type": "transferred", "transferred_to_script": "target-worker" } } }Both
wrangler deployandwrangler versions uploadsend the new payload when the flag is on. The upload response'sexports_reconciliationenvelope is rendered with the spec's visibility hierarchy:✘per-class detail (rendered from the v4 envelope'smeta.details[]), thrown as aUserErrorso every blocking scenario surfaces in one round tripblocked_bylists for stale tombstonesexports" hintServer dependencies
Requires the
exports_reconciliationaccount entitlement on Cloudflare's side. Hidden behind an experimental flag until that gate ships broadly.Server-side phases: DEVX-2563 (1a), DEVX-2598 (1b), DEVX-2564 (2), DEVX-2600 (1d). DEVX-2599 (1c) adds full
transferredsupport — until that lands, thetransferredtombstone returns a "not yet implemented" error from EWC, which is rendered correctly via the samemeta.detailspath.Coordinated with the new config redesign
The new
@cloudflare/configpackage'sexports.durableObject()is extended with tombstone factories (exports.deleted(),exports.renamed({ to }),exports.transferred({ toScript })) and atransferFromoption. The previous "Durable Object exports are not currently supported" throw inconvertExportsis replaced with a snake_case conversion that emits the wrangler config schema.Spec
https://wiki.cfdata.org/spaces/WX/pages/1396640001
A picture of a cute animal (not mandatory, but encouraged)