Visitar URL original
perf(wasm): Trim the script copies embedded in runtime assemblies by MartinZikmund · Pull Request #26057 · unoplatform/uno · GitHub
Skip to content

perf(wasm): Trim the script copies embedded in runtime assemblies - #26057

Draft
MartinZikmund wants to merge 1 commit into
masterfrom
dev/mazi/wasm-strip-embedded-scripts
Draft

MartinZikmund wants to merge 1 commit into
masterfrom
dev/mazi/wasm-strip-embedded-scripts

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #26051

PR Type:

🐞 Bugfix

What changed? 🚀

Uno.Wasm.Bootstrap extracts each assembly's WasmScripts/WasmCSS into the app's package folder at build time (from the pre-link reference assemblies), and the app loads those files. The trimmed assemblies still carried the embedded copies, so Uno.Runtime.Wasm.js (425 KB) and Uno.Wasm.js (157 KB) were downloaded twice.

Both projects now add an ILLink substitution that removes these resources from the linked output: −81 KB brotli (Runtime.WebAssembly.Browser −58 KB, WinRT −23 KB).

Validation:

  • Publish: resources gone from the linked assemblies; the JS/CSS files are still in package_*.
  • Runtime: blank app pixel-identical, no new console errors.

Measurements

Without this PR With this PR Δ
Download (brotli) 6.51 MB 6.42 MB −82 KB
4G visually ready 7029 ms (7011–7029) 6976 ms (6961–6995) −53 ms (−0.8%)
Local visually ready 866 ms (852–872) 852 ms (844–868) within noise

How this was measured

Blank dotnet new unoapp (Skia, net10.0-browserwasm, Release publish), built twice from the same tree: with all six startup PRs (#26054–#26059) plus UnoXamlResourcesTrimming, and with only this PR's change removed. Both builds were served by the same static server (brotli q11, immutable caching for fingerprinted files) and loaded cold in headless Chrome, runs interleaved. "Visually ready" is the first CDP screencast frame identical to the settled final frame. 4G = 9 Mbps down, 85 ms RTT (CDP emulation). Values are medians with (min–max). A difference is only claimed where the ranges don't overlap. Rig: Playwright + Node, available on request.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable)
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features)
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij

Uno.Wasm.Bootstrap extracts each assembly's WasmScripts/WasmCSS into the
app's package folder at build time and the app loads those files, but
the trimmed assemblies still carried the embedded copies: the browser
runtime's 425 KB Uno.Runtime.Wasm.js and Uno.WinRT's Uno.Wasm.js, so
every app downloaded them twice. Linker substitutions now remove them:
-81 KB brotli on a blank app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij
@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Nov 4, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WASM] Runtime assemblies embed scripts the bootstrapper already ships as files

2 participants