iamshaunjp / Complete-React-Tutorial

All course files for the Complete React Tutorial on the Net Ninja YouTube channel.
1.77k stars 1.7k forks source link

Showcase the blog as server-side rendered app #17

Open tpmccallum opened 2 years ago

tpmccallum commented 2 years ago

Hi, I wrote the following article and would like to update it by showing the blog off as a server side rendered app.

https://medium.com/wasm/server-side-rendering-ssr-using-webassembly-wasm-752841a13439

I have performed the following modifications (very simple procedure) using WasmEdge's React SSR documentation.

https://wasmedge.org/book/en/dev/js/ssr.html

After the above modifications the React blog app builds successfully and can be served without any errors in the terminal/console (server side). However, the web page is not loading on the client side; I believe this could be routing or port related.

Would you like to collaborate briefly on this in order to demonstrate how React apps can be served as SSR using WebAssembly.

Kind regards Tim

tpmccallum commented 2 years ago

I have forked the complete react tutorial and then added all of the necessary documentation and code to get the blog app to the point where it will build and serve. The forked repo is here https://github.com/second-state/Complete-React-Tutorial-Plus-SSR/tree/main As mentioned previously, the client's browser page is not rendering. I tried going right back to branch lesson-2 to remove any complexities i.e. routing etc. but interestingly the client's page still did not render (as a SSR app). This SSR approach does indeed work with just a basic create-react-app to I am interested to learn why the page is not rendering (there are no errors in the console either so I am a bit stumped). Thanks