Skip to content

Commit dbc1630

Browse files
committed
Add changelog for ctx.exports.
And added some final tweaks. Leaving worker-loader out of changelog for now since it's closed beta.
1 parent ed54d06 commit dbc1630

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Automatic loopback bindings via ctx.exports
3+
description: You no longer have to configure bindings explicitly when they point back to your own Worker's top-level exports
4+
date: 2025-09-26
5+
---
6+
7+
The [`ctx.exports` API](/workers/runtime-apis/context/#exports) contains automatically-configured bindings corresponding to your Worker's top-level exports. For each top-level export extending `WorkerEntrypoint`, `ctx.exports` will contain a [Service Binding](/workers/runtime-apis/bindings/service-bindings) by the same name, and for each export extending `DurableObject` (and for which storage has been configured via a [migration](/durable-objects/reference/durable-objects-migrations/)), `ctx.exports` will contain a [Durable Object namespace binding](/durable-objects/api/namespace/). This means you no longer have to configure these bindings explicitly in `wrangler.jsonc`/`wrangler.toml`.
8+
9+
At present, you must use [the `enable_ctx_exports` compatibility flag](/workers/configuration/compatibility-flags#enable-ctxexports) to enable this API, though it will be on by default in the future.
10+
11+
[See the API reference for more information.](/workers/runtime-apis/context/#exports)

src/content/docs/workers/runtime-apis/bindings/worker-loader.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
:::note[Dynamic Worker Loading is in closed beta]
1616

17-
The Worker Loader API is available in local development with Wrangler and workerd. But, to use it in production, you must [sign up for the closed beta](TODO: Link to sign-up form).
17+
The Worker Loader API is available in local development with Wrangler and workerd. But, to use it in production, you must [sign up for the closed beta](https://forms.gle/MoeDxE9wNiqdf8ri9).
1818

1919
:::
2020

src/content/docs/workers/runtime-apis/context.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ To use `ctx.exports`, you must use [the `enable_ctx_exports` compatibility flag]
7373
`ctx.exports` provides automatically-configured "loopback" bindings for all of your top-level exports.
7474

7575
* For each top-level export that `extends WorkerEntrypoint` (or simply implements a fetch handler), `ctx.exports` automatically contains a [Service Binding](/workers/runtime-apis/bindings/service-bindings).
76-
* For each top-level export that `extends DurableObject` (and which has been configured with storage via a [migration](https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/)), `ctx.exports` automatically contains a [Durable Object namespace binding](https://developers.cloudflare.com/durable-objects/api/namespace/).
76+
* For each top-level export that `extends DurableObject` (and which has been configured with storage via a [migration](/durable-objects/reference/durable-objects-migrations/)), `ctx.exports` automatically contains a [Durable Object namespace binding](/durable-objects/api/namespace/).
7777

7878
For example:
7979

0 commit comments

Comments
 (0)