Skip to content

[IN PROGRESS] Create dedicated Dynamic Workers documentation section#29019

Open
dinasaur404 wants to merge 15 commits intoproductionfrom
dynamic-workers-doc
Open

[IN PROGRESS] Create dedicated Dynamic Workers documentation section#29019
dinasaur404 wants to merge 15 commits intoproductionfrom
dynamic-workers-doc

Conversation

@dinasaur404
Copy link
Contributor

@dinasaur404 dinasaur404 commented Mar 16, 2026

Create a dedicated Dynamic Workers docs section and organize the current material into overview, getting started, configuration, examples, and API reference pages.

  • Add a new Dynamic Workers section with overview, getting started, configuration, examples, and API reference content so the feature has a dedicated documentation home.
  • Document the main setup and runtime flows, including load() and get(), billing behavior, bindings, static assets, egress control, observability, and API details
  • Examples (currently placeholders) that customers will be able to deploy for different use cases
image

@irvinebroque
Copy link
Contributor

/bonk what do you think of these docs? Anything you think they missed? Any issues with structure? Any inaccuracies or unsubstantiated claims?

@irvinebroque
Copy link
Contributor

@dinasaur404 see merge conflict

@dinasaur404 dinasaur404 force-pushed the dynamic-workers-doc branch from 8df1d81 to d224ac9 Compare March 16, 2026 16:16
@github-actions
Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/public/__redirects @cloudflare/content-engineering, @cloudflare/pcx-technical-writing
* @cloudflare/pcx-technical-writing
*.ts @cloudflare/content-engineering, @kodster28


A Dynamic Worker does not automatically inherit bindings from the Worker that creates it. You must pass each binding explicitly.

## Environment variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is confusing to have the first part of the section on "bindings" be about environment variables — most people dont think of these that way, and it's even more confusing given note above about how these are values we copy into the Worker. Suggest leading with example people canonically know as a binding.


import { Details } from "~/components";

Bindings pass data and resources to a Dynamic Worker through the `env` property in the `WorkerCode` object returned by `get()` or passed to `load()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I know what this is all about if I have never heard of bindings? What should I read / where should I go to understand and orient myself?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. — how do we not presume that the reader already knows everything about Workers?

Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of Dynamic Workers Documentation

Overall, this is a well-structured documentation section with clear writing and good use of code examples. The content covers the key concepts (loader binding, load() vs get(), bindings, egress control, observability, static assets) thoroughly.

Below are the issues I found, organized by severity.


Bug in sidebar.ts (unrelated to Dynamic Workers docs)

This PR includes changes to src/util/sidebar.ts that appear to be from a different changeset (refactoring getCollection to getEntry, changing llms.txt links, etc.). One of these changes introduces a logic bug:

Line 138 — The new comparison href.slice(0, -1) === href is always false. A string with its last character removed can never equal itself. The original code was comparing normalizedHref === normalizedPathname (stripping trailing slashes from both). This means the sidebar "current page" highlight will only work for exact matches, breaking the trailing-slash-tolerant comparison.

This should likely be:

if (href === pathname || href.slice(0, -1) === pathname) {

or the original normalization approach.

I'd recommend separating the sidebar.ts refactor into its own PR to keep this documentation PR focused, and to avoid shipping the bug alongside the new docs.


Placeholder example pages

Four example pages are frontmatter-only with no body content:

  • examples/dynamic-workers-playground.mdx
  • examples/agents-executing-code.mdx
  • examples/running-ai-generated-code.mdx
  • examples/codemode.mdx (this one is an external_link, so it is fine)

The first three will render as empty pages. Since the PR title says "IN PROGRESS", these may be intentionally deferred — but they should either have content or be removed before merging to avoid publishing blank pages.


Minor style guide items

  1. static-assets.mdx:83 — Inconsistent heading style: ## Serving assets from R2 uses gerund form while the sibling heading ## Serve assets from memory uses imperative. Suggest changing to ## Serve assets from R2 for consistency.

  2. api-reference.mdx:70 — The caution admonition references "Dynamic Isolates" terminology (While Dynamic Isolates support Python...) which does not match the "Dynamic Workers" naming used everywhere else in these docs. Should be updated for consistency.

    Wait — actually, on re-reading, this says "While Dynamic Isolates support Python" but the rest of the docs consistently use "Dynamic Workers." This terminology mismatch should be resolved.

  3. api-reference.mdx:51 — "Experimental flags cannot be enabled in production." Per the style guide, prefer "turned on" over "enabled."

  4. Passive voice — Several instances across api-reference.mdx and getting-started.mdx use passive voice (e.g., "The code is passed as strings", "a new isolate is loaded", "the stub is returned synchronously"). Consider revising to active voice per the style guide.


Content observations (non-blocking)

  • The __redirects entry for /dynamic-workers/examples/codemode//agents/api-reference/codemode/ is correct and the target page exists on the production branch.
  • The directory/dynamic-workers.yaml entry looks good and follows the same pattern as other products like agents.yaml.
  • All component imports (WranglerConfig, TypeScriptExample, Details, PackageManagers, DirectoryListing, Description) are correct and from ~/components.
  • No unescaped MDX special characters found.
  • All code blocks use valid lowercase language identifiers.
  • Internal links use correct absolute paths without file extensions.

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 16, 2026

Correction to my earlier review: I initially flagged a bug in sidebar.ts at line 138 (href.slice(0, -1) === href). After further investigation, that code is not from this PR's commit — it was already present on the branch from a prior change (1669b537). The actual sidebar.ts change in this PR is limited to replacing getCollection("directory") with getEntry("directory", group.label), which is a valid refactor.

Apologies for the noise. The key items from my review that do apply to this PR are:

  1. api-reference.mdx:72 — "Dynamic Isolates" should be "Dynamic Workers" for consistency
  2. static-assets.mdx:83 — heading style inconsistency (## Serving vs ## Serve)
  3. Placeholder example pages — three example pages have no body content
  4. Minor passive voice instances across several files

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 16, 2026

Review complete. Here's a summary of what I found and posted on PR #29019:

Issues found:

  1. api-reference.mdx:72 — Terminology mismatch: "Dynamic Isolates" should be "Dynamic Workers" to match the rest of the documentation (inline comment posted).

  2. static-assets.mdx:83 — Inconsistent heading style: ## Serving assets from R2 uses gerund form while the sibling ## Serve assets from memory uses imperative. Should be ## Serve assets from R2 (inline comment posted).

  3. Three empty example pagesdynamic-workers-playground.mdx, agents-executing-code.mdx, and running-ai-generated-code.mdx have frontmatter only with no body content. They will render as blank pages. Since the PR is marked "IN PROGRESS," these may be intentionally deferred.

  4. Minor passive voice instances across api-reference.mdx, getting-started.mdx, and bindings.mdx (noted in review).

Things that checked out fine:

  • All component imports are correct
  • No unescaped MDX special characters
  • All code blocks use valid lowercase language identifiers
  • Internal links use correct absolute paths
  • The external_link to /agents/api-reference/codemode/ is valid (page exists on production)
  • The directory/dynamic-workers.yaml follows the correct pattern
  • The __redirects entry is valid
  • The sidebar.ts change (replacing getCollection with getEntry) is a valid refactor
  • npm run check passes with 0 errors

github run


### Use function parameters for Durable Object storage

Durable Objects have their own lifecycle and can be shut down independently of a Dynamic Worker. Do not give a Dynamic Worker direct access to objects owned by the Durable Object, such as `this.storage`, at creation time. The Durable Object could be destroyed while the Dynamic Worker is still alive, causing references to its storage to become invalid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to say this like human to other humans

}));

// Forward logs to your logging endpoint, a Queue, or a Durable Object.
await fetch(`https://logs.example.com/ingest/${workerName}`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't buy that this is right thing to suggest, it makes it such that the recieving endpoint must be able to do 1:1 same request volume that the whole platform does.

Re-log it so that goes to WOBS and then get logs by user Worker. why not show that


## Retrieve logs after execution

If you need to read logs right after execution finishes, for example, to return them in an API response, store them in a Durable Object that both the Tail Worker and the loader Worker can access.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the use case here

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

Preview URL: https://5300173f.preview.developers.cloudflare.com
Preview Branch URL: https://dynamic-workers-doc.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/dynamic-workers/configuration/bindings/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/configuration/bindings/
https://developers.cloudflare.com/dynamic-workers/api-reference/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/api-reference/
https://developers.cloudflare.com/dynamic-workers/configuration/static-assets/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/configuration/static-assets/
https://developers.cloudflare.com/dynamic-workers/getting-started/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/getting-started/
https://developers.cloudflare.com/dynamic-workers/configuration/observability/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/configuration/observability/
https://developers.cloudflare.com/dynamic-workers/configuration/egress-control/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/configuration/egress-control/
https://developers.cloudflare.com/dynamic-workers/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/
https://developers.cloudflare.com/dynamic-workers/configuration/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/configuration/
https://developers.cloudflare.com/dynamic-workers/examples/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/examples/
https://developers.cloudflare.com/dynamic-workers/examples/codemode/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/examples/codemode/
https://developers.cloudflare.com/dynamic-workers/examples/agents-executing-code/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/examples/agents-executing-code/
https://developers.cloudflare.com/dynamic-workers/examples/dynamic-workers-playground/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/examples/dynamic-workers-playground/
https://developers.cloudflare.com/dynamic-workers/examples/running-ai-generated-code/ https://dynamic-workers-doc.preview.developers.cloudflare.com/dynamic-workers/examples/running-ai-generated-code/


Dynamic Workers can serve static assets like HTML pages, JavaScript bundles, images, and other files alongside your Worker code. This is useful when you need a dynamic Worker to serve a full-stack application.

Static assets for dynamic Workers work differently from static assets in regular Workers. Instead of uploading assets at deploy time, you provide them at runtime through the Worker Loader `get()` callback, sourcing them from R2, KV, or another storage backend.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to docs that would explain how they work for Workers. Don't assume knowledge.

STORAGE: storage,
ASSET_CONFIG: {
not_found_handling: "single-page-application",
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API design wise, I don't follow why these are all passed in separately to env (and therefore directly accessible to the user Worker) rather than just providing the user Worker with a clean interface

"/styles.css": "body { margin: 0 }",
});

// Storage reads from R2 on demand.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read this I think "well then things aren't cached?"


</TypeScriptExample>

You can also use KV as a caching layer in front of R2 to reduce latency on frequently accessed assets:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why KV? Why not cache directly?

@@ -0,0 +1,180 @@
---
title: Static assets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this deserves to be better, there are a lot of hoops to jump here, while still having an abstraction

It's neither "we've abstracted it all away nicely via an interface provided as a library" nor is it "here are the raw building blocks"


This is the structure returned by `getCodeCallback` to represent a Worker.

### `compatibilityDate`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any of these that refers to something documented well elsewhere in the developer docs needs to link to those docs


import { WranglerConfig, TypeScriptExample } from "~/components";

Worker Loader lets a Worker create and run other Workers at runtime. Each Dynamic Worker runs in its own isolated sandbox. You provide the code, choose which bindings the Dynamic Worker can access, and control whether the Dynamic Worker can reach the network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to be consistent about language across "Worker Loader" and "Dynamic Workers"

Odd to start sentence with "Worker Loader" and have that sentence not use the language "Dynamic Workers". Then next sentence presumes you know what a "Dynamic Worker" is

- `load()` creates a fresh Dynamic Worker for one-time execution.
- `get(id, callback)` caches a Dynamic Worker by ID so it can stay warm across requests.

`load()` is best for one-time code execution, for example when using Codemode. `get(id, callback)` is better when the same code will receive subsequent requests, for example when you are building applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How from this do I know what "codemode" is

- **AI agents executing code**: Run code for tasks like data analysis, file transformation, API calls, and chained actions.
- **Running AI-generated code**: Run generated code for prototypes, projects, and automations in a secure, isolated sandboxed environment.
- **Fast development and previews**: Load prototypes, previews, and playgrounds in milliseconds.
- **Custom automations**: Create custom tools on the fly that execute a task, call an integration, or automate a workflow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this tabbed component that shows mermaid diagrams of different architectures

how can someone land on this page and immediately be able to visually reason about how and when they might use this

Also needs to link to relevant other parts of docs or examples

});
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe somewhere why this change to sidebar code is necessary?

@dinasaur404
Copy link
Contributor Author

/bonk address the feedback in the comments

Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted 7 inline suggestions. Key issues:

HIGH

  • sidebar.ts: frontmatter.wid is not defined in any frontmatter schema (src/schemas/base.ts or Starlight's schema). No MDX file sets it. The productAvailabilityBadge() function is unreachable — frontmatter.wid is always undefined. Either add wid to the base schema and populate it, or revert to the previous betaBadgeUrls collection-based approach.

MEDIUM

  • api-reference.mdx:72: "Dynamic Isolates" terminology mismatch (confirming bonk's finding).
  • api-reference.mdx:51: Style guide prefers "turned on" over "enabled".
  • api-reference.mdx:43-47: Link to canonical compat date/flags docs instead of re-explaining.
  • static-assets.mdx:83: Heading style inconsistency (gerund vs imperative).
  • bindings.mdx:11: Assumes reader knows what bindings are — needs orientation link.
  • Three empty example pages will render as blank.

LOW

  • Passive voice in several places across api-reference.mdx and getting-started.mdx.
  • observability.mdx:34: Log forwarding pattern sends fetch() at full request volume to an external endpoint (echoing irvinebroque's concern).

Comment on lines +220 to +221
} else if (frontmatter.wid) {
const availabilityBadge = await productAvailabilityBadge(frontmatter.wid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frontmatter.wid does not exist in any frontmatter schema — not in src/schemas/base.ts nor in Starlight's built-in schema. No MDX file in the repo sets this field. This means frontmatter.wid is always undefined, and the productAvailabilityBadge() function (line 323) is dead code.

The old approach loaded all directory entries + product-availability at module scope and built a URL-keyed betaBadgeUrls map. This refactor replaces that with a per-entry lookup keyed by wid, but the plumbing to get wid into doc frontmatter was never added.

Options:

  1. Add wid to baseSchema in src/schemas/base.ts and populate it in relevant index.mdx frontmatter
  2. Revert to the previous collection-based badge lookup
  3. Look up the directory entry by path segment and use its id field instead of requiring a frontmatter field


import { Details } from "~/components";

Bindings pass data and resources to a Dynamic Worker through the `env` property in the `WorkerCode` object returned by `get()` or passed to `load()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This jumps straight into the env property without orienting readers who may be new to Workers. Add a link to the canonical bindings overview.

Suggested change
Bindings pass data and resources to a Dynamic Worker through the `env` property in the `WorkerCode` object returned by `get()` or passed to `load()`.
Bindings pass data and resources to a Dynamic Worker through the `env` property in the `WorkerCode` object returned by `get()` or passed to `load()`. If you are new to bindings, refer to [Bindings](/workers/runtime-apis/bindings/) for an overview of how they work in Workers.

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 16, 2026

Review posted on PR #29019 with 7 inline suggestions and a summary comment. Here is what was found:

HIGH

  • sidebar.ts: frontmatter.wid is not defined in any frontmatter schema. No MDX file sets it. The productAvailabilityBadge() function is unreachable dead code. The refactor removed the working betaBadgeUrls map but never added the wid field to the schema or frontmatter to replace it.

MEDIUM

  • api-reference.mdx:72 — "Dynamic Isolates" should be "Dynamic Workers" (suggestion posted)
  • api-reference.mdx:51 — "enabled" should be "turned on" per style guide (suggestion posted)
  • api-reference.mdx:43-47 — Compat date/flags should link to canonical docs (suggestion posted)
  • static-assets.mdx:83 — Heading style inconsistency: "Serving" vs "Serve" (suggestion posted)
  • static-assets.mdx:12-13 — Should link to canonical Workers static assets docs (suggestion posted)
  • bindings.mdx:11 — Needs orientation link for readers unfamiliar with bindings (suggestion posted)
  • Three empty example pages will render as blank

LOW

  • Passive voice instances across several files
  • observability.mdx log forwarding pattern raises scaling concerns (aligns with irvinebroque's feedback)

github run

dinasaur404 and others added 2 commits March 16, 2026 13:58
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
dinasaur404 and others added 5 commits March 16, 2026 13:59
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
…earer explanations

- Restructure page with diagram showing binding flow between loader and Dynamic Worker
- Add TrackedKV custom binding example logging KV writes to Analytics Engine
- Improve WorkerEntrypoint/RPC explanation for custom bindings
- Remove Durable Object storage section
…ough

- Add intro explaining Dynamic Worker log capture with Tail Workers
- Three-step guide: enable Workers Logs, define Tail Worker, attach to Dynamic Worker
- Explain ctx.exports and props for wiring up Tail Workers
- Add real-time log retrieval pattern using Durable Objects
@dinasaur404
Copy link
Contributor Author

/bonk review the observability page, let me know your feedback. want to make sure it's intuitive

Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 17 changed files. Posted 9 inline suggestions below.

HIGH

  • sidebar.ts:220-221,301-302: frontmatter.wid is not in any frontmatter schema and no MDX file sets it. The productAvailabilityBadge() function is unreachable dead code. The old betaBadgeUrls map was removed but nothing replaced the data source. Either add wid to the base schema and populate it in frontmatter, or revert to the collection-based badge lookup.
  • static-assets.mdx:11-13: Duplicated opening paragraph (identical sentences repeated verbatim).
  • observability.mdx:32-36: TOML config block for Wrangler config is not wrapped in the WranglerConfig component, which means it only shows TOML without the auto-generated JSONC tab.

MEDIUM

  • api-reference.mdx:72: "Dynamic Isolates" should be "Dynamic Workers".
  • api-reference.mdx:51: Style guide prefers "turned on" over "enabled".
  • index.mdx:9: Unused imports (WranglerConfig, TypeScriptExample) — neither component is used on this page.
  • observability.mdx:120: "refer to this example" is a dead link — no URL or path is provided.
  • Three empty example pages (dynamic-workers-playground.mdx, agents-executing-code.mdx, running-ai-generated-code.mdx) will render as blank. Remove them or add placeholder content before merge.

LOW

  • getting-started.mdx:18: "Codemode" is referenced without context — readers arriving at this page have no idea what it is.
  • bindings.mdx:61,80,96: Heading levels skip from H2 to H4 (the #### headings under the "To pass bindings" section should be ###).

Comment on lines +11 to +13
Dynamic Workers can serve static assets like HTML pages, JavaScript bundles, images, and other files alongside your Worker code. This is useful when you need a dynamic Worker to serve a full-stack application.

Dynamic Workers can serve static assets like HTML pages, JavaScript bundles, images, and other files alongside your Worker code. This is useful when you need a dynamic Worker to serve a full-stack application.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated paragraph — lines 11-12 are identical to lines 13-14.

Suggested change
Dynamic Workers can serve static assets like HTML pages, JavaScript bundles, images, and other files alongside your Worker code. This is useful when you need a dynamic Worker to serve a full-stack application.
Dynamic Workers can serve static assets like HTML pages, JavaScript bundles, images, and other files alongside your Worker code. This is useful when you need a dynamic Worker to serve a full-stack application.
Dynamic Workers can serve static assets like HTML pages, JavaScript bundles, images, and other files alongside your Worker code. This is useful when you need a dynamic Worker to serve a full-stack application.


:::caution[Warning]

While Dynamic Workers support Python, Python Workers are much slower to start than JavaScript Workers, which may defeat some of the benefits of dynamic isolate loading. They may also be priced differently when Worker Loaders become generally available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminology mismatch — "Dynamic Isolates" does not match the "Dynamic Workers" naming used everywhere else in these docs.

Suggested change
While Dynamic Workers support Python, Python Workers are much slower to start than JavaScript Workers, which may defeat some of the benefits of dynamic isolate loading. They may also be priced differently when Worker Loaders become generally available.
While Dynamic Workers support Python, Python Workers are much slower to start than JavaScript Workers, which may defeat some of the benefits of dynamic isolate loading. They may also be priced differently when Worker Loaders become generally available.

Comment on lines +220 to +221
} else if (frontmatter.wid) {
const availabilityBadge = await productAvailabilityBadge(frontmatter.wid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frontmatter.wid is not defined in the base schema (src/schemas/base.ts) or Starlight's schema. No MDX file sets this field. This means frontmatter.wid is always undefined and the productAvailabilityBadge() function on line 325 is dead code.

The old approach loaded all directory + product-availability entries at module scope and built a URL-keyed betaBadgeUrls map. This refactor removed that but never added wid to the schema or any frontmatter to replace it. Either:

  1. Add wid to baseSchema in src/schemas/base.ts and populate it in relevant index.mdx files
  2. Revert to the previous collection-based badge lookup
  3. Look up the directory entry by path segment instead of requiring a frontmatter field

This change should be separated from the docs PR regardless of the approach chosen.

└─────────────────────────────────────────────────────────┘
```

#### Add the binding to the loader Worker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an #### (H4) heading but it follows an H2 (## Custom bindings is not its parent — the numbered list above is). The heading hierarchy skips H3. Same issue at lines 80 and 96. These should be ### headings.

Suggested change
#### Add the binding to the loader Worker
### Add the binding to the loader Worker

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 17, 2026

Review posted on PR #29019 with 9 inline suggestions and a summary comment. Key findings:

HIGH

  • sidebar.ts:220-221: frontmatter.wid is not in any schema and no MDX file sets it — the productAvailabilityBadge() function is dead code. The old betaBadgeUrls map was removed but nothing replaced the data source.
  • static-assets.mdx:11-13: Duplicated opening paragraph (identical sentences repeated verbatim).
  • observability.mdx:32-36: Wrangler config block not wrapped in WranglerConfig component.

MEDIUM

  • api-reference.mdx:72: "Dynamic Isolates" should be "Dynamic Workers".
  • api-reference.mdx:51: "enabled" should be "turned on" per style guide.
  • index.mdx:9: Unused WranglerConfig and TypeScriptExample imports.
  • observability.mdx:120: "refer to this example" has no link — dead reference.
  • Three empty example pages will render as blank.

LOW

  • getting-started.mdx:18: "Codemode" referenced without context or link.
  • bindings.mdx:61,80,96: Heading levels skip H3 (H4 headings directly under H2).

github run

@github-actions
Copy link
Contributor

CI run failed: build logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants