Skip to content

[BlazorWebView] Standalone Tizen BlazorWebView package, sample and host-side tests - #6

Merged
Redth merged 21 commits into
mainfrom
redth-tizen-blazorwebview-port
Aug 30, 2026
Merged

Redth merged 21 commits into
mainfrom
redth-tizen-blazorwebview-port

Conversation

@Redth

@Redth Redth commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner

Stacked on redth-tizen-core-vertical-slice. Review only the top commit; merge the core slice first.

Why

Tizen is gone from dotnet/maui in .NET 11. Two things confirm it, both verified against live artifacts rather than assumed:

  • Microsoft.AspNetCore.Components.WebView.Maui 11.0.0-preview.7.26418.3 ships net11.0, net11.0-android37.0, net11.0-ios26.5, net11.0-maccatalyst26.5 and two Windows TFMs — no Tizen TFM.
  • The .NET 11 maui-tizen workload is now an empty alias that only extends: [maui-blazor] and carries no Samsung packs, so net11.0-tizen* fails with NETSDK1139: The target platform identifier tizen was not recognized.

So the built-in Tizen Blazor handler no longer exists for anyone. This PR reworks the imported sources into a standalone package that plugs into the shared BlazorWebView control through the public extensibility contract from dotnet/maui#36658 (merged to net11.0 on 2026-07-30), rather than shipping another copy of BlazorWebViewHandler.

Relationship to the core slice

TizenBlazorWebViewHandler derives from Maui.Tizen.Core's TizenViewHandler<,>, not directly from MAUI's ViewHandler<,>. That is a correctness requirement, not a convention: TizenLayoutHandler and TizenContentViewHandler reach a child through ITizenPlatformViewHandler when adding it to the native tree, so a BlazorWebView whose handler did not implement that interface would simply never be parented. Deriving also inherits Tizen measurement, arrangement, focus propagation and disposal. The dispatcher is reached through the public IDispatcher the core registers — no Tizen-specific dispatcher type is referenced.

Because it project-references Maui.Tizen.Core, it inherits the Tizen.UIExtensions.NUI 0.9.2 blocker, so it carries the same MAUITIZEN0101 pack guard. Otherwise the blocker would leak into a published package one level up.

What

  • TizenBlazorWebViewHandler implementing IBlazorWebViewHandler, in Microsoft.Maui.Platforms.Tizen.BlazorWebView. No duplicate Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler — there is a test that fails if one ever appears.
  • Ported from dotnet/maui net11.0: TizenWebViewManager, the asset file provider, request interception, static content response behavior and caching, the JS bridge, root components, startup, disposal and logging.
  • Registration: services.AddTizenBlazorWebView() = AddMauiBlazorWebView() then UsePlatformHandler<TizenBlazorWebViewHandler>(), last-registration-wins. UseTizenBlazorWebView() is available for an existing builder.
  • Compile items come from eng/Maui.Tizen.BlazorWebView.Sources.props, following eng/Maui.Tizen.Core.Sources.props. The default glob stays off, so the raw Tizen/ import — the Tizen half of a partial type that now ships complete upstream — stays uncompiled and keeps its provenance value.

Upstream helpers that are internal to Microsoft.AspNetCore.Components.WebView.Maui (QueryStringHelper, StaticContentResponseCache, StaticContentCacheControl, MauiDispatcher, Log) are re-implemented here, so the package uses only public MAUI API — no reflection, no InternalsVisibleTo, no source project references.

The workload gate, and testing around it

The package and the sample set IsTizenProject and are gated by the existing ValidateTizenWorkloadAvailable target. Neither adds a competing gate and neither adds a neutral TFM fallback. Both fail with MAUITIZEN0001 — verified.

tests/Maui.Tizen.BlazorWebView.Tests targets net11.0, defines TIZEN, and compiles the same BlazorWebView sources, the core slice sources they derive from, and the sample head against the pinned Samsung.Tizen.Ref.API15 assemblies (via PackageDownload — the pack is package type DotnetPlatform, so PackageReference is rejected with NU1213).

It combines the roles the core splits across RefPackCompile and UnitTests. The core needs inert stand-ins for its unit lane because it executes code behind #if TIZEN; nothing here does, so real reference assemblies serve both purposes and no stubs are needed. It is explicitly not a neutral fallback: IsPackable is false and nothing it produces ships.

88 tests, all passing: registration and ordering (including that registering before AddMauiBlazorWebView() loses, and that registering last wins), the asset file provider, request mapping and caching (origin filtering, query-string stripping, host-page fallback, raw header blocks, cache opt-in, Range/Authorization/no-store exclusions, no-cache/max-age=0/Pragma revalidation), handler lifecycle including that it really does implement ITizenPlatformViewHandler, root-component validation, and the package/TFM/pack-guard contract. The sample's own MauiProgram.CreateMauiApp() is executed and asserted to register the Tizen handler, so the documented snippet is verified rather than asserted in prose.

eng/build-workload-free.sh passes end to end with CI semantics, including the foundation's new workload-detection regression suite and package-graph probe.

Shared-file footprint

Rebased onto core 2610231 (MAUI 11.0.0-preview.7.26426.4). All transitional package pins have been dropped now that the foundation owns them — Directory.Packages.props and nuget.config are byte-identical to base and have left the PR entirely.

File Change
eng/build-workload-free.sh +18 −0 — registers the new lane only
Maui.Tizen.slnx +3 −0 — the three new projects
everything else confined to src/, tests/, samples/BlazorWebView/, eng/Maui.Tizen.BlazorWebView.Sources.props, docs/blazorwebview.md

Three things I previously changed are now fully owned upstream of this PR: the ASP.NET Core pins, the package source mapping (never actually needed — see the correction note below), and the workload detection.

Replaced by a regression guard

The pins are gone, but the defect they papered over is now tested. AspNetCorePinsMatchTheMauiBlazorNuspecFloor asserts that Microsoft.AspNetCore.Components.WebView.Maui tracks eng/baselines.json while Microsoft.AspNetCore.Components.WebView / Authorization / JSInterop deliberately do not — they track the floor declared in the MAUI Blazor nuspec. Re-verified against 26426.4: still 11.0.0-preview.7.26381.103, matching what the foundation landed.

Correction to earlier revisions of this PR, which pinned 11.0.0-rc.1.26378.118 and added a source mapping. That was wrong. With an unresolvable pin present, NuGet resolves upward to the nearest available version and reports it via NU1603; I read that resolution as the declared dependency. It merely satisfies >=. Pinning to it then drags in packages from another band, which appears to justify a source mapping that was only ever needed because of the wrong pin. Read the nuspec, not the resolution. This is now written up in docs/blazorwebview.md so the next baseline bump doesn't repeat it. Thanks to @Redth for catching it.

Contract tests also stopped hardcoding the baseline version, the Samsung manifest id, and the file that assigns the TFM — all three moved under me during this rebase (the TFM assignment relocated to eng/targets/TizenPackage.props, since .targets is imported after the SDK has parsed $(TargetFramework)). They now read from the source of truth instead.

Behavior deltas from the built-in handler

Documented in docs/blazorwebview.md, which also contains a full migration guide:

  • BlazorWebViewInitializedEventArgs.WebView is not populated — the property is declared only in the platform-specific MAUI builds, and there is no Tizen build any more. Read ((TizenBlazorWebViewHandler)blazorWebView.Handler!).PlatformView instead.
  • Static-content hot reload is not wired up: StaticContentHotReloadManager is internal. Component hot reload is unaffected.
  • Disposal is now explicit — the upstream Tizen handler leaked its TizenWebViewManager. DisconnectHandler disposes it (fire-and-forget by default, blocking under the BlazorWebView.UseBlockingDisposal switch), unhooks the root-component collection without clearing it, drops the routing entry and clears the cache.

Upstream API assumptions

All hold in 11.0.0-preview.7.26418.3: public IBlazorWebViewHandler; UsePlatformHandler with last-registration-wins semantics; BlazorWebView delegating through IBlazorWebViewHandler rather than casting to the concrete handler; public WebViewManager.AddRootComponentAsync/RemoveRootComponentAsync.

Gaps, now tracked on an upstream net11 lane covering native-control event args, RootComponent manager operations, and static-content hot reload: BlazorWebViewInitializedEventArgs has no platform-neutral way to surface the native control; StaticContentHotReloadManager is internal; RootComponent.AddToWebViewManagerAsync/RemoveFromWebViewManagerAsync are internal, so their validation has to be duplicated by every third-party backend. When those land, the duplicated helpers under Internal/ and StaticContent/ collapse back onto the shared implementations.

@Redth Redth closed this Aug 26, 2026
@Redth Redth reopened this Aug 26, 2026
@Redth
Redth force-pushed the redth-tizen-blazorwebview-port branch from 4f2c5f9 to 4e127b5 Compare August 26, 2026 19:43
@Redth
Redth changed the base branch from redth-tizen-foundation-import to redth-tizen-core-vertical-slice August 26, 2026 19:43
@Redth
Redth force-pushed the redth-tizen-blazorwebview-port branch 2 times, most recently from 05670f1 to eb1ac0f Compare August 26, 2026 20:02
Redth added a commit that referenced this pull request Aug 26, 2026
…policy

Ten further review findings. All were real; several were things that looked
correct while doing nothing.

Blazor package graph (verified against the feed, not assumed)

Microsoft.AspNetCore.Components.WebView was pinned to MAUI's version stamp
11.0.0-preview.7.26418.3. That version does not exist for that package - it is an
ASP.NET Core package on its own version line - so NuGet silently substituted
11.0.0-rc.1.26378.118 (NU1603) and then failed with NU1109 downgrades across the
graph. That substitution is where the "actual dependency is rc.1" report came
from; it was NuGet's fallback, not a declared dependency.

Microsoft.AspNetCore.Components.WebView.Maui 11.0.0-preview.7.26418.3 declares
Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Components.WebView and
Microsoft.JSInterop at exactly 11.0.0-preview.7.26381.103 - which also matches the
SDK build pinned in global.json, so the whole graph stays on one ASP.NET Core
build. Pinned there. RC1 would have silently upgraded past what MAUI asked for.

Package source mapping now lists the prerelease patterns under BOTH sources.
NuGet restores only from sources declaring the longest matching pattern, so
Microsoft.AspNetCore.* under dotnet11 alone would have made every ASP.NET Core
package resolvable only from that feed (NU1100 for anything it lacks).

Added eng/tests/PackageGraphProbe: a net11.0 project whose only purpose is to make
restore prove these pins resolve. Necessary because the real consumers are Tizen
projects, and they cannot restore at all - the workload gate fires before Restore
- so a broken pin would otherwise stay invisible until Samsung ships. Verified it
reproduces the original NU1603/NU1109 failure.

CI workload probe could never succeed (#5)

`dotnet workload install tizen --skip-manifest-update` cannot work on a clean
runner: the Samsung manifest is third-party and side-loaded, so the workload ID is
not discoverable through public workload search, and --skip-manifest-update
guarantees failure because the manifest is exactly what is missing. A probe that
can never succeed would keep reporting "blocked" for weeks after the gate lifts.
Replaced with a feed probe for an 11.0.100-band manifest package, checking both ID
spellings. Installation, when it happens, goes through Samsung's supported path.

Dead configuration removed (#6, #10)

  - <Compile Update="**/*.Tizen.cs" /> had no metadata, so it changed nothing, and
    EnableDefaultCompileItems=false meant there were no items to update anyway. It
    read as meaningful configuration while being unreachable.
  - ValidateBaselineConsistency did substring matching on JSON inside MSBuild.
    Parsed validation already exists in the workload-free script and the invariant
    tests, which is where it belongs.

Orphan imported projects (#7)

GraphicsTester.Skia.Tizen.csproj was imported because its filename contains
"Tizen", but it cannot load here: its TFM is $(_MauiDotNetTfm)-tizen (a
dotnet/maui property that does not exist here, so the TFM evaluates to the
malformed "-tizen") and both ProjectReferences point at projects never imported.
Parked as .csproj.orphan - file and history intact, invisible to project
discovery - with samples/README.md documenting every orphan asset directory and an
invariant test asserting every .csproj is in the solution.

Analyzers and warnings (#8, #14)

  - Added Microsoft.CodeAnalysis.PublicApiAnalyzers (PrivateAssets=all) so the
    PublicAPI baselines are enforced rather than inert text.
  - Removed the Microsoft.SourceLink.GitHub pin; the SDK has bundled it since .NET 8.
  - Suppressed CS1591 in TizenPackage.props: the inherited sources are not
    uniformly documented, so the first project to start compiling would otherwise
    fail on hundreds of missing-comment errors under warnings-as-errors.
    Documentation is its own workstream, not a blocker for the first handler.

Licensing (#9)

git-filter-repo is vendored and load-bearing, so unlike the referenced-only
Samsung packages it IS redistributed. Added its upstream, version, MIT licence
text and a verification command to THIRD-PARTY-NOTICES.md.

CI hygiene (#11, #12)

  - `dotnet test --no-build` is skipped when a preceding build failed; running it
    against missing output buries the actual first failure in cascading noise.
  - Added a scheduled dependency-audit workflow. The strict policy stays (audit at
    `low`, warnings as errors - this ships to devices where patching is slow), but
    a newly published advisory now files an issue weekly instead of ambushing
    whoever opens the next unrelated PR. Suppression process documented, with a
    required justification and re-review date.

Naming and provenance (#13)

Replaced 'samsung.net.sdk.tizen.manifest-11.0.100' with the actual band contract
Samsung.NET.Sdk.Tizen.Manifest-11.0.100-preview.7, recording both ID spellings
(NuGet IDs are case-insensitive) and the probe results for each. Documented that
tizen11.0/API15 comes from Samsung workload PR #310 - verified, not assumed.

Also recorded that enabling Build.Tasks raises real SkiaSharp native-asset
packaging questions, flagged as an open decision rather than papered over.

Tests: 28 -> 33 invariants, plus the package graph probe wired into the required lane.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Redth
Redth force-pushed the redth-tizen-blazorwebview-port branch from eb1ac0f to b36496f Compare August 26, 2026 21:26
Redth added a commit that referenced this pull request Aug 26, 2026
Maui.Tizen.BlazorWebView now ships the StaticWebAsset -> MauiAsset conversion itself
(PR #6, 5f9894a), so the copy carried here as a reference implementation would be a
second source of truth for a file this package does not own.

It moves to tests/UnitTests/fixtures/ and is documented as a stand-in for "some
package registers an asset provider". The tests it backs still cover this side of the
boundary - the MauiTizenAssetProviderTargets seam, MauiProcessedAsset -> TizenResource,
res/wwwroot layout and de-duplication by destination - without depending on another
package's sources.

Also answers, with a test rather than an assertion in a message, whether Blazor content
needs entries in res.xml: it does not. res.xml describes only the DPI-variant image
buckets under res/contents, and web content is addressed by URL. Two independent things
keep it out - assets travel as MauiProcessedAsset and never reach the generator, which
is only handed MauiProcessedImage, and the generator separately only accepts folders
whose parent is "contents". StaticWebAssetsAreNotDescribedInTheResourceManifest builds
an app with both an image and web content and asserts the observable outcome, so neither
mechanism can regress silently.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Redth
Redth force-pushed the redth-tizen-blazorwebview-port branch 2 times, most recently from e4b54e1 to 6a03599 Compare August 27, 2026 03:56
Redth and others added 6 commits August 27, 2026 11:03
Tizen was dropped from dotnet/maui for .NET 11: the net11 MAUI Blazor
package ships no Tizen TFM, and the maui-tizen workload is now an empty
alias over maui-blazor that carries no Samsung packs. This reworks the
imported BlazorWebView sources into a standalone package that plugs into
the shared BlazorWebView control through the public extensibility contract
from dotnet/maui#36658 instead of shipping another copy of
BlazorWebViewHandler.

TizenBlazorWebViewHandler derives from Maui.Tizen.Core's
TizenViewHandler<,> and implements the public IBlazorWebViewHandler
capability interface. Deriving is a correctness requirement rather than a
convention: TizenLayoutHandler and TizenContentViewHandler reach a child
through ITizenPlatformViewHandler when adding it to the native tree, so a
BlazorWebView whose handler did not implement that interface would never be
parented. It also inherits Tizen measurement, arrangement, focus
propagation and disposal, and reaches the dispatcher through the public
IDispatcher the core registers.

Registration is AddTizenBlazorWebView() - AddMauiBlazorWebView() followed by
UsePlatformHandler<TizenBlazorWebViewHandler>() in the required
last-registration-wins order. TizenWebViewManager, the asset file provider,
request interception, static content response behavior and caching, the
JavaScript bridge, root components, startup, disposal and logging are
ported from dotnet/maui net11.0. Upstream helpers that are internal to
Microsoft.AspNetCore.Components.WebView.Maui (QueryStringHelper,
StaticContentResponseCache, StaticContentCacheControl, MauiDispatcher, Log)
are re-implemented so the package depends only on public MAUI API. An
upstream net11 lane covering native-control event args, RootComponent
manager operations and static-content hot reload will let those duplicates
collapse later.

Compile items come from eng/Maui.Tizen.BlazorWebView.Sources.props,
following eng/Maui.Tizen.Core.Sources.props, so the raw Tizen/ import - the
Tizen half of a partial type that now ships complete upstream - stays
uncompiled and keeps its provenance value. The project carries the same
MAUITIZEN0101 pack guard as Maui.Tizen.Core, since through that reference
it also depends on the unshippable Tizen.UIExtensions.NUI 0.9.2.

The package and the sample are gated by the existing
ValidateTizenWorkloadAvailable target; neither adds a competing gate or a
neutral TFM fallback. Everything above the native NUI boundary is verified
by tests/Maui.Tizen.BlazorWebView.Tests, which compiles the same
BlazorWebView sources, the core slice they derive from, and the sample head
against the pinned Samsung.Tizen.Ref.API15 reference assemblies with TIZEN
defined. It combines the roles that the core splits across RefPackCompile
and UnitTests - the core needs inert stand-ins because it executes code
behind #if TIZEN, and nothing here does. 88 tests run in the workload-free
lane, covering registration and ordering, the file provider, request
mapping and caching, handler lifecycle and the package contract.

Package configuration is now entirely foundation-owned: the transitional
Microsoft.AspNetCore.Components.WebView pin carried by earlier revisions of
this branch has been dropped, and Directory.Packages.props and nuget.config
are byte-identical to the base. AspNetCorePinsMatchTheMauiBlazorNuspecFloor
is added in its place, asserting that the MAUI Blazor pin tracks
eng/baselines.json while the ASP.NET Core pins deliberately do not, so the
NU1100 defect cannot silently return on the next baseline bump. The
contract tests also stopped hardcoding the baseline version, the workload
manifest id and the file that assigns the TFM, all of which the foundation
has since moved or changed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…seline

Addresses the five findings from the Blazor architecture review.

1. MERGE BLOCKER - static assets never reached the app.

Microsoft.AspNetCore.Components.WebView.Maui ships its
ConvertStaticWebAssetsToMauiAssets target in build/ with no buildTransitive/,
and NuGet does not flow build/ past a direct reference. An app that acquires
the MAUI Blazor package transitively - which is what referencing
Maui.Tizen.BlazorWebView does - therefore never got the conversion: the build
succeeded and every asset 404'd at runtime, including
_framework/blazor.webview.js, so Blazor never started.

This package now carries the conversion itself, in buildTransitive/ so it
actually flows, emitting MauiAsset with Link and TargetPath. That is the exact
shape Maui.Tizen.Build.Tasks consumes (ProcessMauiAssets ->
MauiProcessedAsset -> TizenResource, with TizenTpkFileName derived from
%(Link)), so the two halves meet without either knowing about the other. The
conversion is idempotent, because an app that also references the MAUI Blazor
package directly gets the upstream conversion too and duplicate MauiAsset
entries would produce duplicate resources.

The sample's <None Include="wwwroot/**" CopyToOutputDirectory> block is
removed. It was actively misleading: copying next to the assembly does nothing
for a Tizen app, since TizenAssetFileProvider reads the resource directory,
and it could never have covered blazor.webview.js, which is not in the project
at all.

AssetPipelineTests runs MSBuild against a real Razor project and asserts that
index.html, a nested app asset and _framework/blazor.webview.js all arrive as
MauiAsset with the right TargetPath, with no duplicates and no .gz/.br
variants. A test that only inspected our own .targets would not have caught
the original defect, because the file was fine - the NuGet folder convention
was wrong.

2. Commands were silently dropped.

The handler was constructed with a null CommandMapper, so every IView.Invoke
was discarded and the BlazorWebView could not be focused programmatically or
reordered in a layout. It now supplies a CommandMapper chained to
ViewHandler.ViewCommandMapper, tested by resolving each standard command
through the chain and by asserting the mapper actually reaches the base
handler.

3. Connect and disconnect were asymmetric.

Tizen exposes no way to remove a JavaScript message handler or unregister the
interception callback, so a disconnect/reconnect cycle installed a second
bridge (delivering every message twice) and appended a second routing suffix
to the user agent. The bridge is now installed at most once per NUI WebView,
tracked through a ConditionalWeakTable so platform views are not rooted, and
the original user agent is restored on disconnect.

Routing keys move from GetHashCode to a monotonic counter: hash codes are not
unique, and a collision would serve one BlazorWebView's content into another
and corrupt the routing table on removal. Key parsing now reads only the key
rather than the remainder of the user agent, so another component appending
after the suffix cannot break routing.

4. The PublicAPI baseline described the wrong assembly.

The attached net-tizen baseline came from the raw dotnet/maui import and
describes Microsoft.AspNetCore.Components.WebView.Maui - types this package
deliberately does not define - so the analyzer would have demanded members the
assembly never declares while ignoring every member it does. It is kept for
provenance under Tizen/PublicAPI/ where the PublicAPI/** glob does not reach
it, and a package-specific baseline generated for the emitted assembly
replaces it.

Because the shipping project is workload-gated, the analyzer it references
never runs. tests/Maui.Tizen.BlazorWebView.PublicApi compiles the same sources
on a plain net11.0 host with RS0016/RS0017 escalated to errors, so the
baseline is enforced today rather than whenever Samsung ships. The baseline in
this commit was produced by that analyzer, not hand-written.

5. WebResourceRequested documented, with the finding pinned by tests.

IBlazorWebView inherits it from IWebRequestInterceptingWebView, but
WebResourceRequestedEventArgs has only internal constructors and a
per-platform shape typed to WebView2, WKWebView or Android's WebView, with no
Tizen variant and no extensibility point. A third-party backend cannot
construct the argument, so the callback cannot be raised. Static content is
still fully served through the Tizen interception path; only the public
notification is unavailable. WebResourceRequestedTests fails if MAUI ever
makes the type constructible, which is the signal to implement it.

112 tests pass and eng/build-workload-free.sh is green end to end.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…tract

Three follow-ups to the review fixes, all in BlazorWebView-owned files.

Register through MauiTizenAssetProviderTargets.

Maui.Tizen.Build.Tasks publishes an asset-provider contract: a target name
appended to MauiTizenAssetProviderTargets is run before Tizen asset
processing, in both Resizetizer import orders, without the provider naming any
Resizetizer-internal target. The conversion now registers there.

The direct BeforeTargets hook is kept as a fallback for graphs that do not
include Maui.Tizen.Build.Tasks at all, where the conversion still has to run
for anything else consuming MauiAsset. MSBuild runs a target at most once per
build, so being reached through both routes is harmless - and the fallback is
what the tests in this repository exercise, since the fixture imports only
this package.

Stop the MSBuild fixture from joining the machine's node pool.

AssetPipelineTests shells out to MSBuild, which by default reuses long-lived
worker nodes shared across the machine. On an agent already running other
builds the fixture blocked behind them indefinitely - observed here as a test
run that had to be killed after ten minutes - and left nodes behind
afterwards. It now passes -nodeReuse:false, -m:1 and
DOTNET_CLI_USE_MSBUILD_SERVER=0, which takes the same run to nine seconds.
The build is tiny, so single-node costs nothing.

Do not pin the unfingerprinted script name.

The framework script assertion matched wwwroot/_framework/blazor.webview.js
exactly. The SDK fingerprints static web assets in some configurations
(blazor.webview.<hash>.js), and the conversion is deliberately agnostic to
that - it packages whatever target path the SDK computes - so an exact match
asserted an SDK default rather than this package's behavior, and would break
when that default changed. It now matches by prefix and extension, and reports
the observed asset list on failure.

A companion test asserts every converted asset lands under the wwwroot content
root, which is the property that actually matters: that prefix is the
contentRootDir the handler derives from HostPage, so an asset outside it is
unreachable at runtime even though it shipped.

114 tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The conversion is reachable two ways: through MauiTizenAssetProviderTargets,
the contract Maui.Tizen.Build.Tasks publishes, and through a direct
BeforeTargets hook kept as a fallback for graphs without that package.

Only the fallback was actually exercised. The test fixture imports just this
package, so every existing assertion reached the conversion through
BeforeTargets - which meant the registration could have silently stopped
working while the suite stayed green and real applications, where
Maui.Tizen.Build.Tasks drives the contract, broke. The previous test for this
inspected the .targets XML, which would not have caught a registration that
was present but ineffective.

The fixture now defines a stand-in for MauiTizenCollectProvidedAssets that
runs everything in MauiTizenAssetProviderTargets and nothing else. Invoking it
directly schedules none of the targets named in the conversion's BeforeTargets,
so assets appearing under it can only have arrived through the registration.
It is a stand-in rather than a reference to the real package, because
depending on another repository's sources to test our own registration would
couple the two suites.

A companion test asserts both entry points produce identical assets, since an
application gets one or the other depending on whether Maui.Tizen.Build.Tasks
is in the graph and both have to ship the same files.

Also records in docs/blazorwebview.md that asset names must not be hard-coded,
because the SDK fingerprints static web assets in some configurations.

115 tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Core landed an explicit contract for public API baselines: they are never
attached by a glob, imported PublicAPI/net-tizen files are provenance
fixtures, and a project opts in with EnablePublicApiAnalyzer plus
AdditionalFiles pointing at PublicAPI/tizen. This package predated that and
had invented a different layout for the same conclusion.

Two corrections.

The provenance fixture is restored to PublicAPI/net-tizen. Moving it to
Tizen/PublicAPI kept it out of the old glob, which was the right instinct, but
eng/api-baselines identifies imported baselines by that directory name and its
README pins the expected count at 18. The move silently made it 17, breaking
the provenance record this repository exists to preserve. Verified: 16 before,
18 after.

This package's own baseline moves from PublicAPI/ to PublicAPI/tizen, and the
project now opts in explicitly rather than relying on the analyzer being
wired up for it. The analyzer still cannot run in the product project while
the Samsung workload gate is closed, which is why
tests/Maui.Tizen.BlazorWebView.PublicApi continues to enforce the same
baseline on a plain net11.0 host today - but declaring the opt-in means
enforcement starts automatically the moment the gate opens, instead of
depending on someone remembering.

The 42 repository invariant tests pass, including the two that assert no
project consumes an imported upstream baseline and that RS0016/RS0017 are
never globally suppressed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ple host

Ten findings from the exact-head reviews. Each was reproduced before being
fixed; three were silent failures that no existing test would have caught.

RUNTIME

Chain Core's TizenViewMappers, not MAUI's neutral mappers. The property and
command mappers chained ViewHandler.ViewMapper/ViewCommandMapper, whose bodies
are no-ops off a platform TFM. Every inherited IView property - background,
clip, shadow, visibility, opacity - and every view command would have been
dispatched and then done nothing on a BlazorWebView, while working on every
other Tizen view.

Classify request URIs on the path, never the raw URL. Fallback classification
ran url.EndsWith('/') against the URL including its query, so "/?returnUrl=x"
- a root document request Blazor really issues - was classified as an asset,
missed, and the app never started. Extensionless deep routes such as
"/CustomStart/SomeData", reachable through StartPath or in-app navigation, were
also treated as missing assets and 404'd instead of being answered with the
host page. QueryStringHelper.IsDocumentRequest now decides this on the stripped
path, and a theory covers root/deep/asset paths with and without queries.

Own the interception registration process-wide. Tizen registers interception on
the shared WebContext with no unregister counterpart, and the handler
re-registered on every connect. Each call allocated a fresh delegate that
native held with no managed reference, so it was collectible: interception
would stop and every request 404, intermittently and long after startup. Each
call also displaced the previous registration. WebRequestInterceptionCoordinator
registers exactly once per context, roots the delegate for the process
lifetime, and routes per handler through weak references that are pruned rather
than resurrected.

Handle every RootComponents collection action. Reset - which is what Clear()
raises - carries neither OldItems nor NewItems, so nothing was unmounted and
components stayed rendered in a collection the application believed it had
emptied; a mounted-set snapshot now drives removal. Replace added before
removing, registering a second component against a selector the outgoing one
still held. And ConfigureAwait(false) inside the dispatcher callback resumed
continuations on the pool, mutating the manager's single-threaded component
registry off-dispatcher.

SAMPLE AND ASSETS

The sample built nothing and would have launched blank. It imported no
TizenPackage.props in the props phase, so TargetFramework evaluated empty and
no inner build ran; it left EnableDefaultCompileItems at the repository default
of false, so Compile was empty; and it used MAUI Controls' UseMauiApp with
MAUI's MauiApplication rather than UseMauiAppTizen and TizenMauiApplication,
binding it to a backend that no longer ships for Tizen. It now follows the core
sample's proven shape.

A ProjectReference does not import a referenced project's buildTransitive
assets - only a PackageReference does - so in a source build the
StaticWebAsset -> MauiAsset conversion never ran and wwwroot never became Tizen
resources. The sample imports the provider targets explicitly.

VALIDATION AND PACKAGING

The BlazorWebView test invocation sat outside the BUILD_OK guard, so
--no-build after a failed build could pass against stale assemblies from an
earlier run. It is now gated like every other test step.

IsPackable had regressed to the repository default of false, so the project
produced no package at all - and since the buildTransitive targets only reach
consumers through the package, it shipped nothing while looking healthy. It
opts back in explicitly, and tests now assert the opt-in, the buildTransitive
pack paths, the sample's explicit import and the sample's host wiring.

The MSBuild fixture built outside the repository, where NuGet's directory walk
never finds the repository nuget.config, so it silently used the machine-global
config and cache. It now copies the repository config in and restores into a
private cache sited beside the project, not inside it - inside, the Razor SDK
globs it into the very item groups the test asserts on.

128 tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Redth
Redth force-pushed the redth-tizen-blazorwebview-port branch from 6a03599 to e92e3a7 Compare August 27, 2026 15:06
Redth and others added 4 commits August 27, 2026 17:23
…t reconciliation

Addresses the three runtime blockers from the exact-head review of e92e3a7,
and fixes a static-asset filter that the existing test could not detect.

1. Bootstrap every host-page route, not just "/"

   Blazor.start() was injected only when the load-finished URL equalled the app
   origin exactly, so a non-root StartPath (/CustomStart/SomeData) or a root URL
   carrying a query string loaded the host page and then never initialized.

   The request processor now reports each document route it answers with the host
   page, and the handler injects for any reported URL. URLs that were never
   recorded - the first navigation, or one the web view normalized between request
   and load-finished - fall back to classifying the URL itself, on the path with
   the query stripped, so a query string can neither make a document look like an
   asset nor the reverse.

   Classification is extracted to ShouldInjectBlazorStart so it can be tested at
   the exact URL the web view reports rather than only through fallback selection.

2. Root the WebContext that owns the native proxy

   RegisterHttpRequestInterceptedCallback stores our delegate on the WebContext and
   registers an intermediate proxy owned by that same context; native retains a
   pointer to the proxy, not to our callback. Rooting only the callback therefore
   left the registration collectable: once the context went away the proxy died
   with it and every request 404'd, intermittently, under GC pressure.

   Context and callback are now both held strongly for the process lifetime. There
   is no unregister API and only a handful of contexts per process, so nothing is
   leaked that could otherwise have been released. Handlers remain weakly routed,
   so a disconnected BlazorWebView is still collected.

3. Serialize and coalesce root-component reconciliation

   Each collection change started an independent async pass carrying a snapshot
   taken when the event was raised. Those passes await, so they interleaved: with
   Add immediately followed by Clear, the Clear pass computed its removals before
   the Add pass had recorded the component, leaving it mounted in a collection the
   application had emptied. Rapid Replace could strand the outgoing component.

   Changes now mean "state is dirty" rather than "apply this delta". CoalescingReconciler
   serializes passes and re-runs while requests arrive, and each pass re-reads the
   desired collection, so the last pass always observes the final state. The request
   flag is set before dispatch so a change cannot be lost when the dispatcher runs
   inline. Reconciliation stays on the Blazor dispatcher.

Also: drop pre-compressed assets correctly

   PrecompressedVariantsAreNotPackaged was vacuous. A plain Razor build emits no
   compressed assets at all - compression is a Blazor WebAssembly publish-time
   concern - so "no .gz survived" held trivially. Behind it the filter was entirely
   dead: its condition was OR-ed with '$(CompressionEnabled)' != 'false', true
   whenever the property is unset, which short-circuited the whole test and included
   every .gz/.br variant in the TPK.

   The filter now keys on AssetRole='Alternative' alone. That is both the correct
   rule and a more robust one: a user file merely ending in .gz is Primary and
   survives, and a compressed variant is dropped even when its Identity is an
   SDK-generated temp file not named .gz. The fixture seeds SDK-shaped Alternative
   variants so the exclusion is exercised against real input, one test asserts they
   reach the conversion's input, and wwwroot/data/archive.gz pins the AssetRole
   semantics by requiring a genuine user .gz to ship.

Tests: 133 -> 168. Each fix was mutation-tested by reverting the production change
and confirming the new tests fail; the reconciler tests were rewritten after the
first version survived deletion of the very guard they claimed to cover, because
the fake dispatcher chained work items and so serialized passes by itself.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 94b77eb9-6c81-409f-8453-ad2df114f31d
…I/slice

CI builds the PR merge ref, not the branch head, so these broke only in CI while
the branch tested clean locally. Merging the base reproduced all three.

- eng/build-tizen.sh: register the Blazor sample. The base moved the real lane
  into a dedicated script with an explicit project list, and its regression test
  discovers every csproj importing TizenPackage.props and requires it to be
  listed. The Blazor sample qualifies, so the lane counted 7 of 8 projects. It
  sets IsPackable=false, so the pack phase is a no-op for it.

- PackageContractTests: stop pinning the workload gate's manifest id. The gate no
  longer quotes Samsung.NET.Sdk.Tizen.Manifest- literally; it derives the ids from
  eng/baselines.json. The assertion now covers what has to stay true for the error
  to be actionable - it names the project, identifies the Samsung workload, and
  points at docs/migration.md - rather than a string the base is free to reword.
  The test's own comment already called that id a moving target.

- PublicAPI/tizen -> PublicAPI/slice. The base renamed the convention for owned
  package baselines; Core and Controls both moved, and eng/api-baselines/README.md
  documents slice/ as the contract for a standalone package assembly. net-tizen/
  is untouched: it remains the imported upstream provenance fixture, and its
  18-file count is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 94b77eb9-6c81-409f-8453-ad2df114f31d
Maui.Tizen.Build.Tasks (ad041ad) now re-filters AssetRole='Alternative' before
TizenResource, as defense in depth against exactly the dead-condition provider bug
this package shipped. That guard was inert for anything this provider supplied.

The conversion builds its items with Include="%(...Identity)", and an item created
from an identity string inherits no metadata, so every MauiAsset reached the
downstream filter with a blank AssetRole - verified by dumping MauiAsset metadata
from the fixture, which listed Link and TargetPath but no AssetRole on any item.
A blank role never equals 'Alternative', so the guard could not fire regardless of
what this provider did.

AssetRole is now copied explicitly. The subsequent MauiAsset include is an item-list
include, which does inherit, so it carries through to the emitted items - confirmed
by re-running the fixture: all five assets now arrive as AssetRole='Primary',
including wwwroot/data/archive.gz, the real user file whose name merely resembles a
compressed variant.

AssetRoleIsPropagatedToMauiAssetForTheDownstreamGuard pins the seam on the side that
produces it, and was mutation-tested: removing the copy fails it.

Tests: 168 -> 169.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 94b77eb9-6c81-409f-8453-ad2df114f31d
@Redth
Redth changed the base branch from redth-tizen-core-vertical-slice to main August 30, 2026 06:57
Redth added 7 commits August 30, 2026 02:58
Integrate the completed Core, Controls, Essentials, alerts, validation, and package-gate stack while retaining the BlazorWebView projects, tests, sample, and documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Use per-connection root and request lifetimes, preserve routed startup URLs, validate buildTransitive through a real NuGet package, and keep packing closed until the Core package closure is shippable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Route requests, JavaScript messages, root reconciliation, and public dispatch through immutable connection lifetimes; rebuild manager state on virtual-view replacement; and close the remaining sample and package diagnostics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Keep teardown asynchronous, lease and generation-tag inbound IPC, bind page-load callbacks to immutable connections, and always release replacement transition state after disposal failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Capture async dispatcher operations queued by WebViewManager message receipt so connection retirement waits for the actual IPC receiver task instead of a FIFO approximation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Keep generation-matched completion messages admissible while accepted IPC is active, and drain every captured dispatcher task before propagating terminal failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Bound completion-message admission to the pre-retirement cohort and reserve dispatcher operations atomically before scheduling so late work cannot escape the drain.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Redth added 4 commits August 30, 2026 07:54
Transfer dispatcher work arriving after a message capture seals into the live connection lifetime, allowing delayed JSInterop completion while rejecting it safely after retirement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Suppress inherited message capture only around trusted manager disposal so callback-triggered disconnect and replacement can clean renderer and scoped state after retirement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Use a shared active-state suppression token so trusted manager cleanup can dispatch during its scope without granting delayed descendants post-retirement authority.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Route every expired suppression token through the retired connection lifetime even when no operation capture existed, preventing delayed cleanup descendants from running after disposal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
@Redth
Redth merged commit c54aaeb into main Aug 30, 2026
5 checks passed
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.

1 participant