Skip to content

Conversation

@korinne
Copy link
Contributor

@korinne korinne commented Aug 11, 2025

To do

  • Need to finish the automated deployments section
  • Clean up the rest of environments docs

@github-actions
Copy link
Contributor

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

Pattern Owners
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing, @kodster28, @cloudflare/wrangler, @cloudflare/workers-runtime-1, @cloudflare/wrangler

@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2025

Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

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

👍

There are the existing docs here:

https://developers.cloudflare.com/workers/wrangler/environments/

Which are going to be people's default starting place

How should that change? Should content adapt, what should redirect, etc.

Think the challenge of this content will be — how can it be comprehensive and have lots of code examples (what's here is great) — without feeling overwhelming to the reader?

separate pages? tabbed components? expandable code blocks? etc.

<details>
<summary>Complete configuration example with all binding types</summary>

This comprehensive example shows how to configure all available binding types across environments. The inline comments explain isolation requirements for each binding type.
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like this format as a way to explain

Wonder how it looks to highlight the comments, to break it up into sections visually

https://starlight.astro.build/guides/authoring-content/#expressive-code-features

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately the expressive code features don't work currently with the WranglerConfig component -- can see if I can update the component itself

Copy link
Contributor

Choose a reason for hiding this comment

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

@kodster28 for context (this docs page has a lot of stuff to explain and kind of pushing bounds of how we use code samples to convey things)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@korinne, let me throw some time on your cal to chat and see if we can work through some of these.

"certificate_id": "<STAGING_CERTIFICATE_ID>",
},
],
// Version metadata - can be shared across environments
Copy link
Contributor

Choose a reason for hiding this comment

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

What does it mean for this to be "shared across environments"?

"zone_name": "example.org",
},
// Service bindings - target specific Worker environments
// Use just the worker name to target its production environment
Copy link
Contributor

Choose a reason for hiding this comment

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

I know from context what this means but wonder if someone / LLM might need example

ex: if you have worker foo with env bar
and you want to bind to foo
you would set service to foo
if you wanted to bind to the worker named "foo" but target the environment "bar"
you would set service to foo-bar

- The production environment deploys as a Worker named `my-api`
- The staging environment deploys as a separate Worker named `my-api-staging`

To deploy environments programmatically using the [Cloudflare API](/api/resources/workers/subresources/scripts/methods/update/), you upload each environment as a separate Worker script and specify tags to identify the relationship:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would restructure and bring the tags part way up in this, make it the topline thing that someone needs to understand

  1. this works by adding tags
  2. each environment is its own Worker, with common tag


**Deploy to production:**

```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

SDK

{
"binding": "<BINDING_NAME1>",
"bucket_name": "<STAGING_BUCKET_NAME>",
// Warning: Using the production bucket would share files
Copy link
Contributor

Choose a reason for hiding this comment

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

"share files" ?


This approach means each environment runs as a completely separate Worker with its own isolated execution context, routes, and bindings. The tagging system helps Cloudflare understand the relationship between these separate Workers for management purposes.

## How bindings behave in environments
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this section

Wonder about using tabbed component with tab for each code example so that page doesn't get super long?

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

Labels

product:workers Related to Workers product size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants