vercel / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
63 stars 20 forks source link

Support bundling with `unstable_vitePlugin` introduced in remix v2.2 #63

Closed mmachatschek closed 7 months ago

mmachatschek commented 11 months ago

Official Vercel Remix v2.2 support for the newly introduced unstable vite plugin would be great

EndangeredMassa commented 11 months ago

@mmachatschek we're looking into, thanks!

684efs3 commented 11 months ago

That's good - looking forward to it!

sigma-andex commented 10 months ago

@EndangeredMassa do you have a timeline for this? Seems right now remix doesn't work on vercel even without vite (see #59 - having the same error).

EndangeredMassa commented 10 months ago

The https://github.com/vercel/remix/issues/59 issue was just resolved. Let us know if you are still seeing that issue.

We do not have a timeline for the vite plugin support, but it is a priority.

684efs3 commented 10 months ago

For the vite plugin support, is this something like a week, a month, several months? Ballpark would be great. Thank you!

mmachatschek commented 10 months ago

FYI the remix roadmap tracks a new feature Bundle Shredding 🎸 for Lambda/Serverless Architecture. With that it should be able to output the built remix production code in a format that is supported by the Vercel build API.

I think this would make the @vercel/remix plugin obsolete and add native serverless/edge function support from the remix side 🤔

684efs3 commented 10 months ago

Very interesting! That would make it easier to deploy on Cloudflare too right?

john-griffin commented 10 months ago

Spotted this work around https://www.youtube.com/watch?v=oYmjsWjoFB0

mitchelvanbever commented 10 months ago

Any updates?

EndangeredMassa commented 10 months ago

For the vite plugin support, is this something like a week, a month, several months? Ballpark would be great. Thank you!

It's not likely to come in the next month. We very much want to get to this as soon as we can.

684efs3 commented 10 months ago

Thank you for the update!

swamidass commented 9 months ago

Any progress here?

ALSO, note that the vite builder rejects Vercel's approach to specifying edge routes:

export const config = { runtime: 'edge' };

That does NOT work on the vite build, which only allows whitelisted (i.e. remix) exports from routes. Some sort of work around is needed.

EndangeredMassa commented 8 months ago

This is still in the list of projects we want to tackle next. We'll make an announcement when it's done, but we have other things we need to tackle first.

jgentes commented 8 months ago

FYI the remix roadmap tracks a new feature Bundle Shredding 🎸 for Lambda/Serverless Architecture. With that it should be able to output the built remix production code in a format that is supported by the Vercel build API.

I think this would make the @vercel/remix plugin obsolete and add native serverless/edge function support from the remix side 🤔

Looks like Bundle Shredding (now called Server Bundles) was completed yesterday: https://github.com/remix-run/remix/issues/8296

Any word on how this might impact Vite + Remix support on Vercel?

mmachatschek commented 8 months ago

It looks like there is some progress here https://github.com/vercel/vercel/pull/11031

EndangeredMassa commented 8 months ago

Any word on how this might impact Vite + Remix support on Vercel?

We are exploring it, but no ETA just yet.

justyn-clark commented 7 months ago

If we can't get this soon then I'm going to have to migrate back over to Railway.app and/or Fly.io. I wish Vercel would just let us deploy Docker images.

sigma-andex commented 7 months ago

If we can't get this soon then I'm going to have to migrate back over to Railway.app and/or Fly.io. I wish Vercel would just let us deploy Docker images.

I feel you! Also thinking about switching to cloudflare because of this.

justyn-clark commented 7 months ago

If we can't get this soon then I'm going to have to migrate back over to Railway.app and/or Fly.io. I wish Vercel would just let us deploy Docker images.

I feel you! Also thinking about switching to cloudflare because of this.

That's not a bad idea and I've been temped as well as I have pending DNS switch overs to Cloudflare waiting for me to disconnect from Vercel and press go. From my observations, Remix and CF is a solid reliable pairing and apps serve fast from Workers and Pages. Actually might be a safer bet just in case Vercel pulls some marketing stunts down the road that makes things more difficult for devs when as they continue seeking profit.

But @sigma-andex have no fear. I'm happy to share that have and am successfully deploying Vite Remix to Vercel serverless, and it's working pretty damn good.

All thanks to our hero and single most influential contributor to version 2.7.2 bringing us the stable Vite Remix.

Just pre-build that shit and deploy it from your local IDE. Bypass even dealing with the Vercel website in fact. https://vercel.com/docs/cli/deploy

Here's the stuff. https://github.com/hi-ogawa/remix-vite-deployment-examples

Thank you hi-ogawa! Really appreciate you contributions here.

itzcull commented 7 months ago

@justyn-clark your example is great, unblocked me!

TooTallNate commented 7 months ago

We are getting closer to announcing our Remix + Vite support on Vercel. If you would like to help test, I've posted some instructions on how to do so here.

justyn-clark commented 7 months ago

We are getting closer to announcing our Remix + Vite support on Vercel. If you would like to help test, I've posted some instructions on how to do so here.

Done deal. My tests passed. https://github.com/vercel/vercel/pull/11031#issuecomment-1967814302

TooTallNate commented 7 months ago

Remix + Vite + Vercel is now stable.

olros commented 7 months ago

Just tested Remix + Vite + Vercel, but WARN: Vercel uses its own "enter.server" file, so the file "app/entry.server.tsx" has been deleted. cause problems for me. I'm using MUI components which uses emotion for styling. According to the Remix example app with emotion, custom entry.client.tsx and entry.server.tsx is required to inject styles correctly. Is there any workaround which allows me to provide my own entry.server.tsx-file?

k1sul1 commented 6 months ago

Is there any workaround which allows me to provide my own entry.server.tsx-file?

Same problem with Sentry.

https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/

TooTallNate commented 6 months ago

Heard. I'm working on a fix for that. Stay tuned.

TooTallNate commented 6 months ago

@olros @k1sul1 Follow along in https://github.com/vercel/remix/pull/89.