Let me know if you have questions!
Specifically, I think there’s a rare window of opportunity to replicate the new Expo router file system routes exactly in vite and build the holy grail of universal stacks.
I forked Hydrogen a month back or so just to get a feel for RSC and potentially how it’d work with native. Came away with huge positive impressions on Vite in general (and a vite stack that works nicely[1] with the Tamagui optimizing compiler fully working[2]).
Would love to collaborate towards this ideal setup with anyone competent, get in touch or I’ll ping in the discord.
There’s huge wins to be had at that level of vertical integration I think we haven’t touched yet.
[1] https://github.com/tamagui/tamagui/tree/master/apps/site-vit...
Yes! Please let me know about your blockers. Feel free to create a new GitHub ticket "Tamagui Integration" for this.
> RSC [...] huge positive impressions
Yes, RSC is groundbreaking, especially for mobile.
FYI the RSC Vite plugin is coming: https://github.com/Shopify/hydrogen/discussions/2225#discuss... (the author of that comment is React's tech lead).
> get in touch
I just wrote you on Discord.
1) Astro is either all-SSG or all-SSR, while VPS is mix-and-match
2) Astro uses `.astro` templates by default, while VPS uses `.js` by default
3) Astro comes out-of-the-box with Typescript, Sass, etc., while VPS requires more configuration (by design)
Other than that, they seem to have fairly similar project structures and use-cases... Or am I misunderstanding?
I’ve integrated vite with a rust backend[1] and so many people have asked me how I managed to achieve SSR because they equate SSR with render+hydrate but it’s really just classical SSR. I think I can finally make their dreams come true because of this.
Love the Rust + Vite combo. These kind of combos are actually very well on my radar. (Also with Telefunc - a RPC implementation I'm working on.)
FYI, in case you missed ViteConf yesterday: Rollup (which Vite uses) is considering rewrite parts of itself in Rust.
My only issue with it was (when I used it last) I couldn't get it to easily just output an HTML fragment. It kept trying to wrap my output in a full HTML doc (with a <HEAD>/<BODY> etc). That's one of my major contentions with NextJS as well. Often my webapps are used in the context of a larger document (sort of like Micro Frontends).
Feel free to create a GitHub ticket for that. (That's fairly easy to support as the only blocker is vite-plugin-ssr automatically injecting script tags.)
Things like the Enhance framework or Astro would be trivial to build with vps, especially once there single file page proposals get built.
Had some issues running the SSR api function on Vercel, though. Probably something to do with the the assets/ being specified in the wrong directory.
A lot of vite-plugin-ssr users are deploying to Vercel - have you seen https://vite-plugin-ssr.com/vercel and https://github.com/brillout/vite-plugin-ssr_vercel?
The recommended approach using an Vercel API Route is quite simple & straightforward.
Edit: DevClad => nice project btw.!
It's working great now. Love this project!
Next.js is really being held back by webpack IMO and they would do well to convert to rollup / vite I think. This, Hydrogen from Shopify et. al. are proving webpack doesn't have the best future I think.
All that said, there is one thing about community solutions like this I worry about:
I know as long as I'm paying money to Vercel, I have support with Next.js and it will (in all realistic likelihood) be that way for years.
With community backed frameworks, there is no way that, say, this won't become unmaintained.
For all the possible warts Vercel / Next.js may or may not have, I think as a business building on top of these things, its important to take this into consideration. I'd rather not switch my SSR framework out from under my feet in 18 months.
A more conservative answer is that vite-plugin-ssr is actually already fairly stable: only minor adaptations are required upon new Vite major releases. Do-one-thing-do-it-well tools stabilize quickly, that's one fundamental architectural advantage. Now the DX status quo is continuously evolving/improving and vite-plugin-ssr has to keep up (when not leading the way e.g. with Route Functions :-)). But, in the worst case scenario, you'll be stuck with non-modern DX while you'll be able to upgrade React/Vue/... independently of vite-plugin-ssr until you migrate away.
A more personal answer is that I love doing it, so expect me around ;-).
Bold claim, but I guess it depends on the definition of "known" :)
But nicely done! I'll play around with it