Repository navigation
fix(build): compile without Runtime Async so Blazor WebAssembly works (3.0.0-prerelease.6) - #70
Merged
Merged
Conversation
3.0.0-prerelease.5 shipped every net11.0 assembly built with Runtime Async, which Purview.BuildSdk 2.0 turns on by default. Mono does not support it (dotnet/aspnetcore#68067), and Mono is the runtime behind Blazor WebAssembly, so a wasm consumer threw an empty InvalidProgramException from AsyncHelpers.Await the first time it validated a form through ZodValidator. Republishing the same consumer untrimmed reproduced it, so this was not ILLink. Almost every package here can be consumed from the browser - the core package, SystemTextJson, Http and Blazor - so the repository opts out instead of carrying a per-project split that would still leave the core library unusable on WebAssembly. The C# 15 updated memory-safety rules are independent of this and stay on. Proven with purview-dev/value-objects' packed-consumer gate: its Blazor WebAssembly consumer failed on 3.0.0-prerelease.5 and passes on the packages packed from this commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
3.0.0-prerelease.5shipped everynet11.0assembly built with Runtime Async (runtime-async=on, thePurview.BuildSdk2.0 default). Runtime Async is not supported by Mono, and Mono is the runtime behind Blazor WebAssembly, so a wasm consumer failed at the firstawaitit reached:Found by
purview-dev/value-objects' packed-consumer gate. Full evidence, including the IL diff between.2/.3(builder state machine) and.5(AsyncHelpers::Await), is in #69.What changed
src/Directory.Build.propssetsPurviewRuntimeAsync=false, so nonet11.0target is compiled with it. Every package here can be consumed from the browser — the core package, SystemTextJson, Http and Blazor — so a per-project split would still leave the core library unusable on WebAssembly. The C# 15 updated memory-safety rules (MemorySafetyRules=2) are independent and stay on.AGENTS.mdrecords the opt-out and the Mono limitation, so it is not "fixed" back on in a later SDK bump.package.json→3.0.0-prerelease.6, with aCHANGELOG.mdentry.Verification
dotnet build src/ZodSharp.slnx -c Release: succeeds, 0 warnings.Purview.ZodSharp*net11.0assembly in the build output referencesAsyncHelpersany more;ZodValidator.ValidateFormAsynccompiles to the classicAsyncTaskMethodBuilderstate machine.csharpier check .: clean.dotnet packproduced3.0.0-prerelease.6packages on ASP.NET Core 11.0.0 GA (no11.0.0-rc.3, so no NU1902 on the consumer side).purview-dev/value-objects'scripts/test-packed-consumers.ps1 -DependencyFeed <local .6 feed>passes — Native AOT console 24 checks, Blazor WebAssembly trimmed + browser self-test, Blazor Server forms, net10.0 console, leak scans.Release
Merging this bumps to
3.0.0-prerelease.6, so theReleaseworkflow publishes it.purview-dev/value-objectscan then move itsPurviewZodSharpVersionpin from.5to.6and its packed-consumer gate goes green.Closes #69.