Repository navigation
feat: Add preload links for the startup chain - #1100
Conversation
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Legacy runtime resource shapes and non-fingerprinted publishes are not handled correctly, and the required specification is missing.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Adds browser preload hints to parallelize Uno WebAssembly startup downloads and reduce latency.
Changes:
- Generates preload/modulepreload links from runtime configuration.
- Integrates generation into publishing with an opt-out property.
- Adds tests and deployment documentation.
| File | Description |
|---|---|
test-fingerprint.sh |
Validates published preload URLs. |
PreloadLinks.cs |
Builds and inserts preload markup. |
GeneratePreloadLinksTask.cs |
Implements the publishing task. |
Uno.Wasm.Bootstrap.targets |
Registers and invokes preload generation. |
Given_PreloadLinks.cs |
Tests link generation and replacement. |
deploy-and-publish.md |
Documents behavior and opt-out configuration. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
65bb7b1 to
b0cd654
Compare
bcc68cf to
8f61d63
Compare
8f61d63 to
117dc01
Compare
117dc01 to
53c654e
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1100.eastus2.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1100.eastus2.1.azurestaticapps.net |
7f6b2ba to
316e345
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1100.eastus2.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1100.eastus2.1.azurestaticapps.net |
The browser discovered the startup files one round-trip at a time: index.html, uno-bootstrap.js, uno-config.js, dotnet.js, then the runtime modules and dotnet.native.wasm, and the require.js dependencies only once the runtime was ready. Publishing now adds modulepreload/preload hints for them to index.html, matching the requests they stand for so nothing is downloaded twice. On a simulated 4G link, the large downloads start at 280 ms instead of 620 ms; on 3G, startup is about 1 s faster. Can be disabled with WasmShellGeneratePreloadLinks=false. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
A malformed boot config or uno_dependencies array threw from the task and failed the publish. Each section now only loses its own hints. Also checks the dotnet.js fingerprint is a plain file name before combining paths. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ADrzrqtw3RQdHan77rypBM
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ADrzrqtw3RQdHan77rypBM
A dictionary entry whose value carries a name points at that file, not at its key, matching the service worker and the bootstrapper. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ADrzrqtw3RQdHan77rypBM
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01ADrzrqtw3RQdHan77rypBM
1e56b61 to
a5e5e2d
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1100.eastus2.1.azurestaticapps.net |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1100.eastus2.1.azurestaticapps.net |


Fixes #1093
What changed
The browser discovered the startup files one round-trip at a time:
index.html→uno-bootstrap.js→uno-config.js→dotnet.js→ the runtime modules anddotnet.native.wasm. Therequire.jsdependencies only started once the runtime was ready.Publishing now inserts hints before
</head>, between<!-- uno-preload-links -->markers (replaced on republish):modulepreloadforuno-config.js,dotnet.<fp>.jsand the runtime'sdotnet.runtime/dotnet.nativemodulespreload as="fetch" crossorigin="anonymous" type="application/wasm"fordotnet.native.wasm. There's nointegrityattribute: Chrome ignores it on fetch preloads and warns (crbug.com/981419).preload as="script"for therequire.jsdependenciesThe URLs are derived from the
uno-bootstrap.jsscript tag inindex.html, so they follow the base path. Theuno-config.jshint follows where the file was published: next toindex.html(the layout from #1077) or in thepackage_<hash>folder. They come from the boot config embedded indotnet.js; the SDK's endpoints manifest only marksdotnet.jsfor preloading. Disable withWasmShellGeneratePreloadLinks=false.Validation
test-fingerprint.sh: the hints include the currentdotnet.js, and every hint points at a published file. Tests 1–11 pass.Given_PreloadLinks.🤖 Generated with Claude Code
https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs