Skip to content

feat(cloudflare): inherit worker bindings from exact versions - #1035

Open
benpsnyder wants to merge 2 commits into
alchemy-run:mainfrom
benpsnyder:feat/cloudflare-worker-binding-inheritance
Open

feat(cloudflare): inherit worker bindings from exact versions#1035
benpsnyder wants to merge 2 commits into
alchemy-run:mainfrom
benpsnyder:feat/cloudflare-worker-binding-inheritance

Conversation

@benpsnyder

@benpsnyder benpsnyder commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a first-class, value-free Worker binding inheritance contract pinned to an exact prior version
  • propagate Cloudflare strict inheritance through regular, versioned, gradual-deployment, and dispatch-namespace uploads
  • reject non-deterministic or ambiguous configurations, including latest, blank or duplicate names, and overlaps with explicit or Alchemy-managed bindings
  • include the canonical inheritance contract in the Worker metadata hash
  • document code-only deployment usage and add request-path plus live provider coverage

No inherited binding values are read, logged, or persisted by Alchemy.

Proposed DX

yield* Cloudflare.Worker("Api", {
  main: "./src/api.ts",
  bindingInheritance: {
    mode: "strict",
    versionId: priorVersionId,
    bindingNames: ["API_TOKEN", "SIGNING_KEY"],
  },
});

Validation

  • bun tsc -b packages/alchemy/tsconfig.json
  • bun run docs:check
  • bun x oxfmt --check on all changed source and test files
  • git diff --check
  • executable runtime assertions for lowering, conflict rejection, and regular/dispatch request propagation

Closes #1024

@sam-goodwin

Copy link
Copy Markdown
Contributor

Please include the proposed DX as a code snippet in PR description

@benpsnyder

Copy link
Copy Markdown
Contributor Author

Added — the PR description now includes the proposed bindingInheritance DX with strict mode, an exact prior version ID, and the named bindings to inherit. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloudflare Worker: inherit named bindings from an exact prior version

2 participants