01 / DECISION
When this primitive earns a place
Cloudflare now says to start new projects with Workers, so keep Pages for existing projects and get the per-branch loop from Worker Previews instead.
02 / ARCHITECTURE
Build the smallest defensible path
On Workers, pin build commands and runtime versions, declare each Preview in the previews block, bind KV, D1, and R2 to separate resources, then deploy production with wrangler deploy. On an existing Pages project, keep wrangler pages deploy dist until it migrates.
- 01Name the contract
Cloudflare now says to start new projects with Workers, so keep Pages for existing projects and get the per-branch loop from Worker Previews instead.
- 02Add one primitive
On Workers, pin build commands and runtime versions, declare each Preview in the previews block, bind KV, D1, and R2 to separate resources, then deploy production with wrangler deploy. On an existing Pages project, keep wrangler pages deploy dist until it migrates.
- 03Capture failure evidence
Test the preview URL, generated asset set, canonical links, redirects, and rollback; repeat the same smoke checks on production.
03 / REPRODUCE
Evidence before confidence
Test the preview URL, generated asset set, canonical links, redirects, and rollback; repeat the same smoke checks on production.
npx wrangler preview # existing Pages project: npx wrangler pages deploy dist 04 / BOUNDARY
The production boundary
A successful build does not prove runtime integrations, secrets, redirects, headers, or custom-domain behavior. Previews do not inherit production settings, and account-level resources such as KV, D1, and R2 are only isolated when you bind each Preview to its own resource.
05 / FIRST-PARTY SOURCES
Keep first-party sources authoritative
Product behavior, limits, pricing, and availability can change. Re-check these sources before acting.