remix icon indicating copy to clipboard operation
remix copied to clipboard

support `getLoadContext` when using Vite

Open nicksrandall opened this issue 1 year ago • 6 comments

  • Similar the the Cloudflare preset maintained by remix team, it would be great if the vercelPreset could also accept the getLoadContext function so that the all loaders can get that context.

I don't care how it's implemented, I just need to be able to define my loader context somewhere and use it in a vercel app.

nicksrandall avatar May 23 '24 17:05 nicksrandall

Did you have a particular use case that you need it for? See https://github.com/vercel/remix/issues/92 for a previous time when this was brought up.

TooTallNate avatar May 23 '24 18:05 TooTallNate

I'm migrating an existing codebase (~80 routes) and they are all setup to pull resources (like database client, environment variables) from the loader context. We did this, in theory, to make our app more portable across all runtimes/environments. Ironically, its now the only thing preventing us from using vercel.

nicksrandall avatar May 23 '24 18:05 nicksrandall

If you could show me where this change would live... I'd be happy to send you a PR.

nicksrandall avatar May 23 '24 18:05 nicksrandall

Same situation here, very desperate

zipme avatar Jun 21 '24 08:06 zipme

Same issue here, we have shared context, and currently we need to make multiple API calls per session to retrieve that context (config related).

paul-vd avatar Jul 23 '24 06:07 paul-vd

@TooTallNate any plans on supporting Hydrogen Vite? I know that getLoadContext is already supported in a classic Remix app, but it would be great to also be able to deploy Hydrogen Vite to Vercel.

thomasKn avatar Nov 08 '24 02:11 thomasKn