Skip to content

Commit 52ddd22

Browse files
authored
clarify which bindings require module-worker syntax (#21173)
* [Workers] Clarify which bindings are incompatible with ServiceWorkers * [Workers] deeplink to images bindings Images bindings are hard to find from the main "images" landing page. Linking directly to them saves some confusion.
1 parent 0e22234 commit 52ddd22

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
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/transform-images/bindings/) 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

src/content/docs/workers/runtime-apis/bindings/images.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
pcx_content_type: navigation
33
title: Images
4-
external_link: /images
4+
external_link: /images/transform-images/bindings/
55
head: []
66
description: Store, transform, optimize, and deliver images at scale.
77

0 commit comments

Comments
 (0)