Skip to content

Fix UnoWasmChecker for modern .NET 8+ apps (backport #1034) - #1041

Merged
jeromelaban merged 8 commits into
release/stable/10.0from
mergify/bp/release/stable/10.0/pr-1034
Feb 20, 2026
Merged

jeromelaban merged 8 commits into
release/stable/10.0from
mergify/bp/release/stable/10.0/pr-1034

Conversation

@mergify

@mergify mergify Bot commented Feb 20, 2026

Copy link
Copy Markdown

Summary

The uno-wasm-version tool (UnoVersionExtractor) no longer works with modern Uno WASM apps (e.g. https://nuget.info/) because:

  1. assemblies_with_size and uno_main were removed from uno-config.js — ShellTask.cs no longer generates these fields (removed in commit 12a666f, Sept 2024).
  2. blazor.boot.json no longer exists — .NET 8+ embeds the boot configuration directly inside _framework/dotnet.js between /*json-start*/ and /*json-end*/ markers.

The tool was outputting "No assemblies found" and exiting with error code 1 on all modern deployments.

What changed

  • Added a new GetDotnetConfigFromDotnetJs() method that fetches _framework/dotnet.js, extracts the embedded JSON boot config via regex, and parses assemblies and metadata from it.
  • Added a shared ExtractAssembliesFromResources() helper that handles both the new array format ([{"virtualPath":"X.wasm","name":"X.abc.wasm"}]) and the old object format ({"X.dll": "sha256-..."}).
  • Reordered the Extract() flow to try the modern dotnet.js path first, then fall back to blazor.boot.json for older apps.
  • Extended UnoConfig to parse config.dotnet_js_filename from uno-config.js.
  • Extended DotnetConfig with debugLevel and linkerEnabled fields.
  • Added display of globalization mode, linker status, and debug level in OutputResults().

Backward compatibility

All three config formats are supported:

  • Modern apps (dotnet.js embedded boot config) — new path
  • Older apps (blazor.boot.json) — existing fallback
  • Legacy apps (assemblies_with_size in uno-config.js) — existing path

Verified against

Site Assemblies App Runtime Config source
nuget.info 143 PackageExplorer 7.0.7 .NET 10.0 dotnet.js (new)
gallery.platform.uno 98 Uno.Gallery 1.7.0-dev.1 .NET 9.0 blazor.boot.json
playground.platform.uno 97 Uno.Playground.WASM 1.4.0-dev.325 .NET 9.0 blazor.boot.json

Modern Uno WASM apps embed the boot configuration directly inside
_framework/dotnet.js between /*json-start*/ and /*json-end*/ markers
instead of using blazor.boot.json. This change adds support for
extracting assemblies and metadata from the embedded boot config,
with fallback to blazor.boot.json for older apps.

(cherry picked from commit 3050b5d)
Refactor UnoVersionExtractor to expose testable static methods
(ExtractBootConfigFromScript, ParseUnoConfigFields,
ExtractAssembliesFromResources) and add 19 unit tests covering
JSON parsing, boot config extraction, and uno-config parsing.

Add CI validation of embedded boot config markers in dotnet.js
via MSBuild AfterPublishValidation and a bash script.

Address review feedback: remove unused AssemblyDownloadInfo,
narrow exception handling in GetDotnetConfigFromDotnetJs, and
fix mainAssemblyName comparison by stripping file extension.

(cherry picked from commit 3f07fa0)
Use perl -0777 for multiline JSON extraction in validate-boot-config.sh
(sed cannot handle JSON spanning multiple lines, causing CI failure).

Include dotnetJsFilename in ParseUnoConfigFields early-break condition
so it is always captured regardless of field order in uno-config.js.

Remove unreachable catch (JsonException) in GetDotnetConfigFromDotnetJs
since ExtractBootConfigFromScript already handles JSON parse failures.

(cherry picked from commit 5225b47)
Rewrite to reflect the current tool behavior: modern .NET 8+ boot
config extraction, WebCIL support, updated console output columns
(Build, Commit), and new diagnostic fields (globalization, linker,
debug level). Remove shell prompt prefix from code blocks to fix
copy-paste. Add supported formats table, exit codes reference, and
update command.

(cherry picked from commit c6576a4)
Show dnx as the primary way to run the tool without installation,
as introduced in .NET 10.

(cherry picked from commit 70bbeeb)
Add blank lines before lists (MD032) and replace bold-as-heading
with proper heading levels (MD036) in spec.md and README.md.
Add Newtonsoft and Linq to cspell dictionary.

(cherry picked from commit 322a41b)
Remove dotnetJsFilename from early-break condition so legacy configs
without that field still benefit from early termination. Add null
checks for packagePath/managePath in GetUnoConfig to prevent
NullReferenceException with incomplete configs.

(cherry picked from commit 3976841)
@jeromelaban
jeromelaban merged commit b6d43a6 into release/stable/10.0 Feb 20, 2026
7 of 10 checks passed
@jeromelaban
jeromelaban deleted the mergify/bp/release/stable/10.0/pr-1034 branch February 20, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants