|
|
|
|
|
by chinedufn
2880 days ago
|
|
Sure! The backend is pretty much this (messy) file - https://github.com/chinedufn/percy/blob/master/examples/isom... . It 1. Pulls in your application crate
2. Initializes your app (more or less sets initial state
3. Renders your app's virtual DOM into an HTML string
4. Serves the HTML to the client, along with the initial state serialized into JSON in a script tag (using serde-json)
5.Also serves the WASM script and the JS that initializes the WASM So that's your server crate. Then your client crate also pulls in your same application crate and you compile it to WebAssembly and that's what runs browser side. Feel free to let me know if any of that was poorly explained! |
|