vite-plugin-react icon indicating copy to clipboard operation
vite-plugin-react copied to clipboard

feat(rsc): react-router cloudflare single worker example

Open hi-ogawa opened this issue 7 months ago • 3 comments

Description

Summary

  • port "single worker" setup from examples/cf-single-worker to examples/react-router, namely enable loadModuleDevProxy.
  • update react-router entry.ssr to provide generateHTML, which works on "serializable" values
    • generateHTML: (url: string, headers: Headers, rscResponse: Response) => Promise<Response>
  • update utils/rpc.ts to encode/decode Headers and Response via custom turbo-stream plugins

hi-ogawa avatar Aug 31 '25 07:08 hi-ogawa

@hi-ogawa I wonder if latest RR that supports framework mode can have example like this one too?

ivogt avatar Oct 14 '25 10:10 ivogt

I just wanted to mention that I tried this one. Works compiled but not in dev when @clouldfware/vite-plugin is used. It doesn't say an error and just prints <..redacted..>

ivogt avatar Oct 23 '25 11:10 ivogt

@ivogt Hey, Sorry, I missed the message. To answer the question, no. RR framework plugin needs a change to support a setup like this. You can probably raise a feature request on react router repo.

hi-ogawa avatar Oct 23 '25 12:10 hi-ogawa