DEV Community

Discussion on: Can You Use Blazor for Only Part of an App?

Collapse
 
jrumandal profile image
John Ralph Umandal

Hi Aaron, thanks for honey juicy introduction to Blazor.
Something I didn't get though...Is Blazor doing server rendering or is the serverside code entirely based on compiled WebAssembly/WASM that get interpreted in the browser?

Collapse
 
aaronpowell profile image
Aaron Powell

If you're using Blazor Server then the rendering happens on the server and it uses SignalR to ship the changes down to the browser (and some JS magic is done for you to swap out the right parts of the DOM).

With the WASM version, which I used across these blogs, it's all done in the browser. The Razor files are compiled to C# (if you use a tool like ILSpy you can find them in the DLL) as essentially strings that are merged with the data and the appropriate DOM elements are generated. Then the Mono/WASM runtime handles the interop into the browser where the DOM elements are injected by Blazor.