lionside
Joined 7 years ago
Joined 7 years ago
I used to work there; great team behind the product!
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.
[1] https://github.com/Wulf/create-rust-app
[2] https://www.shuttle.rs/blog/2021/10/08/building-a-startup-wi...
One of the first requests I got for ‘create-rust-app’ was from a friend of mine regarding ViteJS. At the time, I didn’t know how awesome and fast ViteJS was as opposed to webpack and the name sounded like a JavaScript library so I didn’t really see the point. Upon a second review of the project, I realized the best thing I could do for the rust web dev community was to create an example of how to integrate ViteJS-based SSR in rust. And voilà, here it is. The docs also link to an “awesome list” which references create-rust-app [1].
This integration paves the way for things like adding multiple front end framework choices for the project and potentially doing SSG in rust.
[1] https://github.com/vitejs/awesome-vite#integrations-with-bac...
I know this is not realistic, but the only thing rust is missing is faster compilation times. To be fair, it’s already super fast.
I was adding a repl[1] to create-react-app[2] (trying to achieve something like RoR’s console) and it took way too long for it to boot simply because the dependencies for something like a full scale web app take long to compile. Even with incremental compilation, that first boot time was too much.
In case you want to try rust and react together:
```
As with all things in life, there are considerations to take into account before using vite-rs:
```