Skip to content

feat: load the local Cloudflare bindings automatically - #132

Merged
yusukebe merged 2 commits into
nextfrom
feat/bindings
Sep 12, 2026
Merged

yusukebe merged 2 commits into
nextfrom
feat/bindings

Conversation

@yusukebe

Copy link
Copy Markdown
Member

In a project with a wrangler config, c.env now carries the real local bindings (KV, D1, R2, vars) in request, batch, and snapshot — wrangler's getPlatformProxy simulates the binding backends while the app stays on Node.js. Automatic on purpose: a flag nobody routes to does not exist, and the correct default needs no rail. --no-bindings skips it; a missing wrangler warns and continues; a broken config fails as BINDINGS_FAILED. wrangler stays out of the dependencies (resolved from the project, like the workerd path).

Verified against a real Workers project: vars and KV reach c.env, a KV put→get flow passes in one batch --compact call, the proxy disposes cleanly (no hang), and non-wrangler projects are untouched. Logged in docs/agent-dx-log.md; agent-dx measures next with a D1/KV fixture.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • pnpm run format:fix && pnpm run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

@yusukebe
yusukebe merged commit 1471b36 into next Sep 12, 2026
4 checks passed
@yusukebe
yusukebe deleted the feat/bindings branch September 12, 2026 07:29
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.

1 participant