who use rust in backend tnx in advance for guiding me
i'm a react developer and i'm trying to learn rust in order to use in backend but the problem i'm facing is that most of the ways i've seen to ssr react is through a node js server
i was wondering do other frameworks like vue/angular ... support ssr better than react with a rust server ?
i'm curious to know what js framework you use with a rust backend which handles ssr nice and ez
I don't think there is any easy way to do this. The thing about ssr with js frameworks like react, Vue, angular etc is that you need to be able to process js from the backend. This is quite straightforward with nodejs because it's a js runtime. To perform ssr for js frameworks on a rust server you would first need some sort of js runtime or processor associated with the rust backend. Nodejs being a js runtime similar to the browser, it's able to execute the js code that renders the output of react and Vue, use libraries like isomorphic-fetch to fetch data regardless of whether the runtime is the server or browser and a whole bunch of other things. Doing all this on a rust server is not impossible, but it's certainly very difficult. This being the case, I'm not aware of any js framework that's ez to use with a rust backend. I have come across projects based on wasm that perform some of the work that react, Vue etc does on the js runtime, but in wasm (obviously); but they were all experimental in nature for the most part. The most promising one in my opinion is https://yew.rs/docs/ If it's absolutely necessary that you use a rust backend, it might be easier to use a framework like this instead of any js framework. You could also try to implement something similar on your own for your preferred js framework if you're looking for a challenge. Hope this answers your question.
Обсуждают сегодня