Skip to content

[Workers, Pages] Update Pages-to-Workers migration guide and prompt - #35676

Merged
irvinebroque merged 11 commits into
productionfrom
docs/pages-workers-migration-guide
Nov 30, 2026
Merged

irvinebroque merged 11 commits into
productionfrom
docs/pages-workers-migration-guide

Conversation

@irvinebroque

@irvinebroque irvinebroque commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates the Pages-to-Workers migration guide (src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx) and the companion migration prompt (public/workers/prompts/pages-to-workers.txt) to fix inaccurate migration guidance and reflect current Workers capabilities.

  • Fixes broken edit URL, Source Maps comparison matrix contradiction, and broken Wrangler command anchors (/workers/wrangler/commands/general/#deploy and #dev).
  • Explains when wrangler setup cannot run on a Pages project, how to match both /api and /api/*, and why Workers Cache—not zone Cache Rules—can serve cached Worker responses without running the handler. Adds comparison rows for Workflows, Containers, and Secrets Store.
  • Rewrites the prompt for Wrangler v4 and supported framework adapters. Preserve the app's public behavior, not local emulator artifacts. Scope any header shim to verified static responses and leave dynamic and private responses unchanged.

In 19 local migration attempts across four fixtures, the original Next.js probes passed with every prompt variant. The difference showed up after adding a private 404 and making a prerendered route private:

Local result Prior PR head First candidate Final prompt
Advanced routing, static rules, and Preact asset/Function collision 5/5 5/5 3/3
Next.js with a supported adapter and all existing probes passing 2/2 2/2 2/2
Next.js rebuilds and preserves both private responses after those route changes 0/2 1/2 2/2

With the prior PR head, one migration rewrote private responses as public and added wildcard CORS; the other stopped building when the prerendered file disappeared. Both final-prompt runs preserved the responses and produced smaller wrappers (28–30 lines vs. 73–99). This rerun did not deploy anything or verify Git-connected previews.

Closes #20445

Documentation checklist

@github-actions github-actions Bot added the product:workers Related to Workers product label Nov 27, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://docs-pages-workers-migration-guide.previews.developers.cloudflare.com (commit de320c7)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Cancelled 🚫

View logs ↗
43909a2 2026-11-30T21:34:18.808Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://bb0f257b.previews.developers.cloudflare.com de320c7 2026-11-30T20:43:25.565Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://07987bd1.previews.developers.cloudflare.com 9990c0f 2026-11-27T07:05:57.227Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://29b491da.previews.developers.cloudflare.com bedfe2f 2026-11-27T06:29:24.097Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://08d04082.previews.developers.cloudflare.com e1906b9 2026-11-27T05:42:27.247Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c33a13bc.previews.developers.cloudflare.com 3a602b5 2026-11-27T05:26:07.080Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ed90277e.previews.developers.cloudflare.com bf99ff3 2026-11-27T05:11:39.288Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://fd30c385.previews.developers.cloudflare.com 2c7fe33 2026-11-27T04:02:39.140Z Visit the dashboard ↗

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

@irvinebroque
irvinebroque marked this pull request as ready for review November 27, 2026 04:48
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

AI Review

✅ Reviewed 43909a2 · 0 findings · incremental

Commands
  • /review Run a review now.
  • /full-review Review the entire PR diff.
  • /disable-auto-review Stop automatic reviews.
  • /rebase Rebase against production.

@yomna-shousha yomna-shousha left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Followed the guide on a small Pages project and migrated it. A few fixes below; the suggestions can be batch-applied.

@yomna-shousha

Copy link
Copy Markdown
Contributor

Looks good. One small thing before I approve: the not_found_handling link on L216 (/workers/static-assets/binding/#not_found_handling) points to an anchor that does not exist on the binding page. /workers/static-assets/#routing-behavior covers it.

@irvinebroque
irvinebroque added this pull request to the merge queue Nov 30, 2026
Merged via the queue into production with commit 52cd7cf Nov 30, 2026
12 of 13 checks passed
@irvinebroque
irvinebroque deleted the docs/pages-workers-migration-guide branch November 30, 2026 21:34
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/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify caching difference between Cloudflare Workers with Static Assets and Cloudflare Pages advanced mode

2 participants