Skip to content
Commit Detail

Commit 6caa936

Author
Kenton Varda <kenton@cloudflare.com> 2025-01-31 17:52:03 -0600
Parents
51123f6
Tree
c5ae143
Implement automatic self-referential bindings via ctx.exports.

For every top-level export, `ctx.exports` will contain a corresponding property which acts as a binding to that export. If the export is a simple object or `WorkerEntrypoint`, then the `ctx.exports` property is a service binding. If the export is a Durable Object class (and it has been configured with storage), the `ctx.exports` property is a DO namespace binding.

So you can do: `ctx.exports.MyEntrypoint.someRpc()`

And it calls `someRpc()` on the entrypoint named `MyEntrypoint`, as if you had called it over a service binding.

This is marked experimental for now since it won't work on the edge until further changes are made to our control plane.

Files changed