Skip to content

[codex] add Cloudflare SSR for playground#1303

Draft
jderochervlk wants to merge 2 commits into
masterfrom
vlk/enable-cloudflare-ssr
Draft

[codex] add Cloudflare SSR for playground#1303
jderochervlk wants to merge 2 commits into
masterfrom
vlk/enable-cloudflare-ssr

Conversation

@jderochervlk
Copy link
Copy Markdown
Collaborator

@jderochervlk jderochervlk commented May 20, 2026

Context

This is the first slice of the playground SSR work. The docs app can keep prerendering static routes while letting /try run through Cloudflare Pages Functions.

Summary

  • Enables React Router SSR for @rescript-lang/docs.
  • Omits /try from React Router prerender output while keeping the existing stdlib prerender paths.
  • Adds a Cloudflare Pages SSR entry/function path for /try and /try.data.
  • Adds wrangler.toml for local Pages dev/deploy, including nodejs_compat and the Pages project name.
  • Clears out before copying build/client so stale prerendered /try artifacts do not survive rebuilds.
  • Formats the v12.3 API JSON files that were failing the existing full-repo format CI job.

Validation

  • node .yarn/releases/yarn-4.13.0.cjs build:res
  • node .yarn/releases/yarn-4.13.0.cjs workspace @rescript-lang/docs build:vite
  • node_modules/.bin/oxfmt --check apps/docs/react-router.config.mjs apps/docs/app/entry.server.js apps/docs/server/react-router-handler.js apps/docs/functions/try.js apps/docs/functions/try.data.js
  • yarn ci:format
  • Wrangler Pages smoke test from fresh out: /, /try, and /try.data returned 200; /try.data included bundleBaseUrl and versions loader data.

No generated .jsx files are included in this PR.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 20, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
guide faf42a2 Commit Preview URL

Branch Preview URL
May 21 2026, 04:07 PM

@jderochervlk jderochervlk force-pushed the vlk/enable-cloudflare-ssr branch from fb02aa1 to faf42a2 Compare May 21, 2026 16:05
@github-actions
Copy link
Copy Markdown

Guide Cloudflare deployment

⛅️ wrangler 4.85.0
───────────────────
🌀 Building list of assets...
✨ Read 10 files from the assets directory /home/runner/work/rescript-lang.org/rescript-lang.org/apps/guide/out
🌀 Starting asset upload...
No updated asset files to upload. Proceeding with deployment...
Total Upload: 0.31 KiB / gzip: 0.22 KiB
Worker Startup Time: 0 ms
Uploaded guide (2.54 sec)
Worker Version ID: bfaec051-3f7b-4d5b-bdca-fde674e65ea6
Version Preview URL: https://bfaec051-guide.rescript.workers.dev
Version Preview Alias URL: https://vlk-enable-cloudflare-ssr-guide.rescript.workers.dev

To deploy this version to production traffic use the command wrangler versions deploy

Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command wrangler versions deploy

Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command wrangler triggers deploy

@github-actions
Copy link
Copy Markdown

Cloudflare deployment

Deployement ID: 8f8ad45c-c177-4fa8-8858-e21b2e2fe795
Deployment Environment: preview

⛅️ wrangler 4.85.0
───────────────────
Uploading... (8401/8403)
Uploading... (8402/8403)
Uploading... (8403/8403)
✨ Success! Uploaded 2 files (8401 already uploaded) (1.63 sec)

✨ Uploading _redirects
✨ Uploading Functions bundle
🌎 Deploying...
✨ Deployment complete! Take a peek over at https://8f8ad45c.rescript-lang.pages.dev
✨ Deployment alias URL: https://vlk-enable-cloudflare-ssr.rescript-lang.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant