Repository navigation
NetWasm.UI 0.8.0
The first screen can now be rendered into the HTML at publish time, so visitors see content
before the Wasm has loaded:
<PropertyGroup>
<NetWasmUIPrerender>true</NetWasmUIPrerender>
<NetWasmUIPrerenderShell>404.html</NetWasmUIPrerenderShell>
</PropertyGroup>
<ItemGroup>
<NetWasmUIPrerenderRoute Include="/about;/blog" />
</ItemGroup>This is a snapshot, not hydration: links work right away, but event handlers start with the
app, which then replaces the markup. Hydration is planned next. The build runs the published
Wasm in the Node that NetWasm ships, so nothing more needs to be installed. See
Why Node and not .NET?.
Added
- Prerendering (opt-in): with
NetWasmUIPrerender=true,dotnet publishruns the app in Node
for/and eachNetWasmUIPrerenderRoute, and writes the rendered HTML into the mount
element ofindex.html,about.htmland so on. Content shows before the Wasm has loaded, and
the app replaces it when it starts.NetWasmUIPrerenderShellwrites a bare page, e.g.
404.html, for the SPA fallback. See Prerendering. - The project website prerenders its home, examples and benchmarks pages.
nwui-devserves/aboutfromabout.htmlwhen it exists, then404.html, then
index.html, as static hosts do.