Skip to content

Commit 5c6ac3e

Browse files
committed
[Workers] Clarify which bindings are incompatible with ServiceWorkers
1 parent b9bc94d commit 5c6ac3e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/content/docs/workers/reference/migrate-to-module-workers.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ This guide will show you how to migrate your Workers from the [Service Worker](h
1414

1515
There are several reasons to migrate your Workers to the ES modules format:
1616

17-
1. [Durable Objects](/durable-objects/), [D1](/d1/), [Workers AI](/workers-ai/), [Vectorize](/vectorize/) and other bindings can only be used from Workers that use ES modules.
18-
2. Your Worker will run faster. With service workers, bindings are exposed as globals. This means that for every request, the Workers runtime must create a new JavaScript execution context, which adds overhead and time. Workers written using ES modules can reuse the same execution context across multiple requests.
19-
3. You can [gradually deploy changes to your Worker](/workers/configuration/versions-and-deployments/gradual-deployments/) when you use the ES modules format.
20-
4. You can easily publish Workers using ES modules to `npm`, allowing you to import and reuse Workers within your codebase.
17+
1. Your Worker will run faster. With service workers, bindings are exposed as globals. This means that for every request, the Workers runtime must create a new JavaScript execution context, which adds overhead and time. Workers written using ES modules can reuse the same execution context across multiple requests.
18+
2. Implementing [Durable Objects](/durable-objects/) requires Workers that use ES modules.
19+
3. Bindings for [D1](/d1/), [Workers AI](/workers-ai/), [Vectorize](/vectorize/), [Workflows](/workflows/), and [Images](/images/) can only be used from Workers that use ES modules.
20+
4. You can [gradually deploy changes to your Worker](/workers/configuration/versions-and-deployments/gradual-deployments/) when you use the ES modules format.
21+
5. You can easily publish Workers using ES modules to `npm`, allowing you to import and reuse Workers within your codebase.
2122

2223
## Migrate a Worker
2324

0 commit comments

Comments
 (0)