Vite on Cloudflare - request in getLoadContext? #8674
aaronadamsCA
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I gave the experimental Cloudflare Vite support a shot. Nice work!
I understand per the docs that it's not meant to be feature-complete yet, specifically that the Cloudflare
EventContext
will take some time to expose in full (or at least in greater part).In the meantime, I have two questions:
Can you improve this type:
remix/packages/remix-dev/vite/presets/cloudflare.ts
Lines 3 to 5 in ae88454
To better match this type?
remix/packages/remix-cloudflare-pages/worker.ts
Lines 11 to 17 in ae88454
And also specify how much of
EventContext
you actually support (so far just{ env: unknown }
). This would get us a step closer to writing onegetLoadContext
function signature that is compatible with both of these types.Do you need to wait for Wrangler to expose
Request
, or could you potentially get it from Vite and add it tocontext
? I ask because we need the URL and headers ingetLoadContext
. I'm not familiar with the Vite plugin API so I have no idea if that's possible.With these two pieces, we could probably get this up and running with our apps to help shake out any further issues. Looking forward to these improvements!
Beta Was this translation helpful? Give feedback.
All reactions