Skip to content

Prepare website for Cloudflare deploy#134

Merged
fabian-hiller merged 3 commits into
mainfrom
deploy-on-cloudflare
Jun 4, 2026
Merged

Prepare website for Cloudflare deploy#134
fabian-hiller merged 3 commits into
mainfrom
deploy-on-cloudflare

Conversation

@fabian-hiller

@fabian-hiller fabian-hiller commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Prepares the website for deployment on Cloudflare Workers Static Assets. Adds wrangler config, Cloudflare build/deploy scripts, and tuned caching/redirects while keeping Vercel deploys available.

  • New Features

    • Added website/wrangler.jsonc to serve ./dist with trailing-slash and 404 handling.
    • Added build.cloudflare and deploy.cloudflare scripts; Vercel is now deploy.vercel.
    • Updated _headers and _redirects for Workers static assets:
      • Immutable caching for /build/*, /assets/*, /fonts/*; shorter TTL for /og/*.
      • Simplified q-data.json caching with a single /*q-data.json rule.
      • Added redirects for /playground/playground/login/, /{framework}/guides.../introduction/, and /core/api/solid/api/.
    • Added wrangler to devDependencies; workspace enables workerd builds and excludes miniflare/wrangler from minimum release age.
    • Added .wrangler to .gitignore.
  • Migration

    • Cloudflare: pnpm -C website build.cloudflare then pnpm -C website deploy.cloudflare
    • If automation used pnpm -C website deploy, switch to deploy.vercel (Vercel) or deploy.cloudflare (Cloudflare).

Written for commit 96708c4. Summary will update on new commits.

Review in cubic

Copilot AI review requested due to automatic review settings June 4, 2026 21:25
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
formisch Ready Ready Preview, Comment Jun 4, 2026 9:52pm

Request Review

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 4, 2026
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5055b26d-085c-4eda-986f-6ef092dbf4a6

📥 Commits

Reviewing files that changed from the base of the PR and between f24fdbe and 96708c4.

📒 Files selected for processing (1)
  • website/public/_headers
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/public/_headers

Walkthrough

This PR configures the site for Cloudflare Workers static-assets: adds a wrangler.jsonc config pointing to ./dist (auto-trailing-slash, 404-page), updates package.json with Cloudflare build/deploy scripts and adds wrangler to devDependencies, updates pnpm-workspace.yaml to allow workerd builds and exclude specific miniflare/wrangler versions from minimumReleaseAge, expands Cloudflare Cache-Control headers and redirects, and adds website/.gitignore entry to ignore public/react/.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and directly summarizes the main objective of the changeset: preparing the website for deployment on Cloudflare.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing all major changes including Cloudflare configuration, scripts, caching rules, and migration instructions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI 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.

Pull request overview

Prepares the website/ package for deployment via Cloudflare Workers Static Assets by adding Wrangler configuration, Cloudflare-oriented build/deploy scripts, and updating static asset redirect/header rules while keeping the existing Vercel workflow available.

Changes:

  • Added wrangler.jsonc and a deploy.cloudflare script to support Cloudflare Workers Static Assets deployment.
  • Updated public/_headers and public/_redirects to align with Workers Static Assets routing/caching behavior.
  • Updated workspace configuration and lockfile to include wrangler (and its dependency chain) and allow workerd builds under pnpm’s build allowlist.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/wrangler.jsonc Adds Wrangler (JSONC) config to serve ./dist via Workers Static Assets with trailing-slash + 404 handling.
website/public/_redirects Adds static redirects intended for Workers Static Assets.
website/public/_headers Adds caching rules for build/assets/fonts/og + Qwik q-data.json responses.
website/package.json Adds build.cloudflare, deploy.cloudflare, and renames Vercel deploy script to deploy.vercel; adds wrangler dev dependency.
website/.gitignore Ignores public/react/ outputs.
pnpm-workspace.yaml Allows workerd builds and pins release-age exclusions for miniflare/wrangler.
pnpm-lock.yaml Lockfile updates for wrangler and related dependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/public/_headers Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
website/public/_redirects (1)

3-18: ⚡ Quick win

Consider using 301 (permanent) redirects for legacy URLs.

All redirects currently use status 302 (temporary). If these are permanent URL structure changes (e.g., legacy framework guide paths, deprecated /core/api path), consider using 301 (permanent) instead. Permanent redirects:

  • Signal to search engines that these URLs have permanently moved
  • Allow browsers to cache the redirect
  • Improve SEO by transferring page authority to the new URLs

Use 302 only if these redirects are temporary or experimental.

♻️ Example change to permanent redirects
-/preact/guides /preact/guides/introduction/ 302
-/preact/guides/ /preact/guides/introduction/ 302
+/preact/guides /preact/guides/introduction/ 301
+/preact/guides/ /preact/guides/introduction/ 301
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/public/_redirects` around lines 3 - 18, The redirects file currently
marks legacy mappings like "/playground /playground/login/ 302", "/preact/guides
/preact/guides/introduction/ 302", "/qwik/guides /qwik/guides/introduction/
302", "/react/guides /react/guides/introduction/ 302", "/solid/guides
/solid/guides/introduction/ 302", "/svelte/guides /svelte/guides/introduction/
302", "/vue/guides /vue/guides/introduction/ 302" and "/core/api /solid/api/
302" as temporary (302); if these are permanent URL moves, update each
corresponding line to use 301 instead of 302 (e.g., change "/playground
/playground/login/ 302" → use 301), leaving any entries that are truly temporary
as 302. Ensure you update every duplicate variant with and without trailing
slashes (both "/playground" and "/playground/") so all legacy forms reflect the
chosen permanent (301) status.
pnpm-workspace.yaml (1)

15-17: 💤 Low value

minimumReleaseAgeExclude for very recent releases.

The miniflare@4.20260603.0 and wrangler@4.98.0 versions appear to be released around June 3, 2026 (based on the version date encoding). Excluding them from minimum release age requirements is appropriate for this migration, but be aware that these are cutting-edge versions.

Consider monitoring for any bug reports or patches in the days following this deployment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm-workspace.yaml` around lines 15 - 17, The workspace YAML currently
excludes two very recent releases via the minimumReleaseAgeExclude list; ensure
the entries minimumReleaseAgeExclude contains miniflare@4.20260603.0 and
wrangler@4.98.0 (as shown) and add a short inline comment above or next to
minimumReleaseAgeExclude noting these are cutting-edge temporary exclusions and
should be monitored and reviewed for updates/patches in the days after
deployment; plan to remove or relax these specific exclusions once stability is
confirmed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@website/public/_headers`:
- Around line 12-20: The _headers entry only defines q-data.json caching up to
"/:a/:b/:c/q-data.json", so add additional route-depth rules in
website/public/_headers (e.g., "/:a/:b/:c/:d/q-data.json" and further depths as
needed, e.g., "/:a/:b/:c/:d/:e/q-data.json" or up to
"/:a/:b/:c/:d/:e/:f/q-data.json") with the same Cache-Control: public,
max-age=60, stale-while-revalidate=604800 so q-data.json responses for deeper
routes (referenced by nested routes like the UseFieldConfig properties path)
receive the intended headers.

---

Nitpick comments:
In `@pnpm-workspace.yaml`:
- Around line 15-17: The workspace YAML currently excludes two very recent
releases via the minimumReleaseAgeExclude list; ensure the entries
minimumReleaseAgeExclude contains miniflare@4.20260603.0 and wrangler@4.98.0 (as
shown) and add a short inline comment above or next to minimumReleaseAgeExclude
noting these are cutting-edge temporary exclusions and should be monitored and
reviewed for updates/patches in the days after deployment; plan to remove or
relax these specific exclusions once stability is confirmed.

In `@website/public/_redirects`:
- Around line 3-18: The redirects file currently marks legacy mappings like
"/playground /playground/login/ 302", "/preact/guides
/preact/guides/introduction/ 302", "/qwik/guides /qwik/guides/introduction/
302", "/react/guides /react/guides/introduction/ 302", "/solid/guides
/solid/guides/introduction/ 302", "/svelte/guides /svelte/guides/introduction/
302", "/vue/guides /vue/guides/introduction/ 302" and "/core/api /solid/api/
302" as temporary (302); if these are permanent URL moves, update each
corresponding line to use 301 instead of 302 (e.g., change "/playground
/playground/login/ 302" → use 301), leaving any entries that are truly temporary
as 302. Ensure you update every duplicate variant with and without trailing
slashes (both "/playground" and "/playground/") so all legacy forms reflect the
chosen permanent (301) status.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d32248ba-257e-431f-8c8c-f1c68059f4ae

📥 Commits

Reviewing files that changed from the base of the PR and between d2a8552 and 8785994.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • pnpm-workspace.yaml
  • website/.gitignore
  • website/package.json
  • website/public/_headers
  • website/public/_redirects
  • website/wrangler.jsonc

Comment thread website/public/_headers Outdated
@fabian-hiller fabian-hiller merged commit ca60f5d into main Jun 4, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants