docs: update all compatibility_date values to $today#27992
docs: update all compatibility_date values to $today#27992MattieTK merged 6 commits intoproductionfrom
Conversation
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.
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
src/content/docs/browser-rendering/playwright/playwright-mcp.mdx
Outdated
Show resolved
Hide resolved
| 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
| 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/). |
This bit isn't a new feature introduced here, it should possibly be renamed to |
Note
This PR was authored by OpenCode (Claude) and reviewed by @MattieTK.
Summary
compatibility_datevalues in WranglerConfig blocks to use$todayAdds inline comments for features with minimum date requirementsThis 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$todaymagic 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: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:
nodejs_compat(v2 behavior)2024-09-232024-04-032024-10-222025-08-01@cloudflare/playwright2025-09-15node.fsAPIStyle guide updated
Added guidance to
/style-guide/components/wrangler-config/explaining:$todayfor compatibility datesHow to add minimum date comments when documenting features that require themNot 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.mdxsrc/content/docs/kv/examples/*.mdx(4 files)src/content/docs/workers-vpc/index.mdxsrc/content/docs/hyperdrive/index.mdxsrc/content/docs/cloudflare-one/tutorials/ai-wrapper-tenant-control.mdx