Skip to content

docs: update all compatibility_date values to $today#27992

Merged
MattieTK merged 6 commits intoproductionfrom
update-compatibility-dates-to-today
Feb 2, 2026
Merged

docs: update all compatibility_date values to $today#27992
MattieTK merged 6 commits intoproductionfrom
update-compatibility-dates-to-today

Conversation

@MattieTK
Copy link
Member

@MattieTK MattieTK commented Jan 30, 2026

Note

This PR was authored by OpenCode (Claude) and reviewed by @MattieTK.

Summary

  • Updates all hardcoded compatibility_date values in WranglerConfig blocks to use $today
  • Adds style guide documentation for how to handle compatibility dates
  • Adds inline comments for features with minimum date requirements

This is a more extensive version of #27887, covering all documentation files.

Why

AI agents and users accessing documentation pages should be encouraged to use the current date for compatibility_date. The $today magic string in the WranglerConfig component automatically renders as the current date at build time, ensuring docs always suggest the latest date.

Changes

67 documentation files updated

Replaced hardcoded dates like "2025-09-17" with "$today" across:

  • Workers configuration and tutorials
  • Browser Rendering (Playwright, Puppeteer, Stagehand)
  • Workflows (TypeScript and Python)
  • Hyperdrive
  • D1, R2, KV, Queues
  • Durable Objects
  • Pages Functions
  • And more

Minimum date requirements

For features that require a minimum compatibility date, added inline comments to preserve this information:

This was decided to be excessive.

Known minimum compatibility dates based on documentation:

Feature Minimum date Reason
nodejs_compat (v2 behavior) 2024-09-23 Enables bundled polyfills and globals
RPC 2024-04-03 Feature introduction date
Workflows binding 2024-10-22 Required for binding from Workers
Python Workflows 2025-08-01 Platform requirement
@cloudflare/playwright 2025-09-15 Requires native node.fs API

Style guide updated

Added guidance to /style-guide/components/wrangler-config/ explaining:

  • Always use $today for compatibility dates
  • How to add minimum date comments when documenting features that require them

Not included (future work)

~8 files use manual <Tabs>/<TabItem> for wrangler configs instead of the <WranglerConfig> component. These need manual conversion:

  • src/content/docs/kv/index.mdx
  • src/content/docs/kv/examples/*.mdx (4 files)
  • src/content/docs/workers-vpc/index.mdx
  • src/content/docs/hyperdrive/index.mdx
  • src/content/docs/cloudflare-one/tutorials/ai-wrapper-tenant-control.mdx

Replace hardcoded compatibility_date values with $today magic string
which WranglerConfig components transform to the current date.

For files with minimum date requirements, adds inline comments
indicating the minimum required date (e.g., // Minimum: 2025-09-15).
Document that $today should always be used for compatibility_date values,
and explain how to add minimum date comments when features require them.
@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/changelog/ @cloudflare/pm-changelogs, @cloudflare/pcx-technical-writing
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @whoiskatrin, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents
/src/content/docs/browser-rendering/ @mchenco, @cloudflare/pcx-technical-writing, @celso, @kathayl, @ToriLindsay
/src/content/docs/cloudflare-for-platforms/workers-for-platforms/ @irvinebroque, @dinasaur404, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing
/src/content/docs/cloudflare-one/access-controls/ @kennyj42, @ranbel, @cloudflare/pcx-technical-writing
/src/content/docs/cloudflare-one/ @ranbel, @cloudflare/pcx-technical-writing
/src/content/docs/d1/ @elithrar, @rozenmd, @vy-ton, @joshthoward, @oxyjun, @harshil1712, @cloudflare/pcx-technical-writing
/src/content/docs/durable-objects/ @elithrar, @vy-ton, @joshthoward, @oxyjun, @lambrospetrou, @mikenomitch, @cloudflare/pcx-technical-writing
/src/content/docs/hyperdrive/ @elithrar, @thomasgauvin, @sejoker, @oxyjun, @cloudflare/pcx-technical-writing
/src/content/docs/pages/ @cloudflare/workers-docs, @GregBrimble, @WalshyDev, @aninibread, @irvinebroque, @cloudflare/pcx-technical-writing
/src/content/docs/queues/ @elithrar, @jonesphillip, @harshil1712, @mia303, @cloudflare/pcx-technical-writing
/src/content/docs/r2/ @oxyjun, @elithrar, @jonesphillip, @aninibread, @harshil1712, @cloudflare/workers-docs, @cloudflare/pcx-technical-writing
/src/content/docs/radar/ @andre-j3sus, @cloudflare/pcx-technical-writing
/src/content/docs/style-guide/ @dcpena, @cloudflare/pcx-technical-writing
/src/content/docs/workers-ai/ @rita3ko, @craigsdennis, @mchenco, @cloudflare/pcx-technical-writing
* @cloudflare/pcx-technical-writing
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing, @cloudflare/wrangler, @mattietk
/src/content/docs/workers/observability/ @irvinebroque, @mikenomitch, @nevikashah, @cloudflare/pcx-technical-writing
/src/content/docs/workers/static-assets @irvinebroque, @GregBrimble, @WalshyDev, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing
/src/content/docs/workers/wrangler/ @cloudflare/wrangler, @irvinebroque, @cloudflare/pcx-technical-writing
/src/content/docs/workflows/ @elithrar, @celso, @mia303, @jonesphillip, @cloudflare/pcx-technical-writing
/src/content/partials/hyperdrive/ @elithrar, @thomasgauvin, @sejoker, @oxyjun, @cloudflare/pcx-technical-writing
/src/content/partials/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @WalshyDev, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing, @cloudflare/wrangler, @mattietk

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

Preview URL: https://5adbcfab.preview.developers.cloudflare.com
Preview Branch URL: https://update-compatibility-dates-to-today.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/
https://developers.cloudflare.com/style-guide/components/wrangler-config/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/style-guide/components/wrangler-config/
https://developers.cloudflare.com/workers/static-assets/binding/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/workers/static-assets/binding/
https://developers.cloudflare.com/workers/vite-plugin/tutorial/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/workers/vite-plugin/tutorial/
https://developers.cloudflare.com/browser-rendering/playwright/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/browser-rendering/playwright/
https://developers.cloudflare.com/d1/tutorials/build-a-staff-directory-app/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/d1/tutorials/build-a-staff-directory-app/
https://developers.cloudflare.com/workers/static-assets/migration-guides/vercel-to-workers/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/workers/static-assets/migration-guides/vercel-to-workers/
https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/
https://developers.cloudflare.com/workflows/build/workers-api/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/workflows/build/workers-api/
https://developers.cloudflare.com/changelog/2025-10-24-tanstack-start/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/changelog/2025-10-24-tanstack-start/
https://developers.cloudflare.com/agents/api-reference/configuration/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/agents/api-reference/configuration/
https://developers.cloudflare.com/agents/guides/chatgpt-app/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/agents/guides/chatgpt-app/
https://developers.cloudflare.com/agents/guides/human-in-the-loop/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/agents/guides/human-in-the-loop/
https://developers.cloudflare.com/agents/guides/slack-agent/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/agents/guides/slack-agent/
https://developers.cloudflare.com/browser-rendering/playwright/playwright-mcp/ https://update-compatibility-dates-to-today.preview.developers.cloudflare.com/browser-rendering/playwright/playwright-mcp/

@MattieTK MattieTK enabled auto-merge (squash) January 30, 2026 19:21
A `$today` value can be used in this component to automatically insert the today's date. This is useful for suggesting that users set the latest compatibility date.
## Compatibility date

Always use `$today` for the `compatibility_date` value. This magic string is automatically replaced with the current date at build time, ensuring documentation always suggests the latest date.
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I have mixed feelings here...
I agree it's probably not good to have very old dates...
And at the same time why even bother with compatibility_date if it should always be today?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, I've made this more specific to the meaning I was trying to get across with starting new projects, and nodded to the ability users have to use compat flags to disable specific features if required. Is this better?

Suggested change
Always use `$today` for the `compatibility_date` value. This magic string is automatically replaced with the current date at build time, ensuring documentation always suggests the latest date.
You should generally use `$today` for the `compatibility_date` value for new projects. This magic string is automatically replaced with the current date at build time, ensuring documentation always suggests the latest date. If you need to specify a fixed date, you can do so as well, but you may miss out on the latest features and performance improvements. You can disable specific features by using [compatibility flags](/workers/configuration/compatibility-flags/).

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Some changes should be reverted.

Also a few minor comment.

And last nit "today" is Sunday to me, not 2026-02-01 - maybe use a less ambiguous name?

@MattieTK MattieTK disabled auto-merge February 1, 2026 17:42
@MattieTK
Copy link
Member Author

MattieTK commented Feb 2, 2026

And last nit "today" is Sunday to me, not 2026-02-01 - maybe use a less ambiguous name?

This bit isn't a new feature introduced here, it should possibly be renamed to $todaysDate or something but I would expect that to be outside the scope of this change.

@vicb vicb self-requested a review February 2, 2026 16:03
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@MattieTK MattieTK merged commit e55ca2b into production Feb 2, 2026
9 checks passed
@MattieTK MattieTK deleted the update-compatibility-dates-to-today branch February 2, 2026 18:38
@MattieTK MattieTK restored the update-compatibility-dates-to-today branch February 12, 2026 15:47
@MattieTK MattieTK deleted the update-compatibility-dates-to-today branch February 12, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. product:browser-rendering product:changelog product:cloudflare-for-platforms product:cloudflare-one product:d1 D1: https://developers.cloudflare.com/d1/ product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ product:pages product:queues Cloudflare Queues: https://developers.cloudflare.com/queues product:r2 R2 object storage: https://developers.cloudflare.com/r2 product:radar product:style-guide product:workers Related to Workers product product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ product:workers-vpc product:workflows Workflows: https://developers.cloudflare.com/workflows/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.