Skip to content

feat: Compile .wasm.cs and .browserwasm.cs files for WebAssembly#22690

Open
MartinZikmund wants to merge 11 commits intomasterfrom
dev/mazi/wasmcs
Open

feat: Compile .wasm.cs and .browserwasm.cs files for WebAssembly#22690
MartinZikmund wants to merge 11 commits intomasterfrom
dev/mazi/wasmcs

Conversation

@MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Feb 19, 2026

GitHub Issue: closes #22689

PR Type:

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Copilot AI review requested due to automatic review settings February 19, 2026 17:06
@MartinZikmund MartinZikmund requested a review from kazo0 February 19, 2026 17:07
@MartinZikmund
Copy link
Member Author

@copilot Document the newly added support for .browserwasm.cs as alternative to .wasm.cs

Copy link
Contributor

Copilot AI commented Feb 19, 2026

@MartinZikmund I've opened a new pull request, #22691, to work on those changes. Once the pull request is ready, I'll request review from you.

…# guide

Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Uno’s cross-targeting MSBuild item rules so platform-suffixed C# files are compiled appropriately when targeting the newer browserwasm platform (in addition to the existing WebAssembly runtime identifier flow).

Changes:

  • Adjust .wasm.cs inclusion/removal conditions to allow compilation when IsBrowserWasm=true.
  • Add new default item handling for .browserwasm.cs files so they compile only for BrowserWasm targets.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Uno.Sdk/targets/Uno.CrossTargeting.targets Updates cross-targeting item conditions for .wasm.cs and introduces .browserwasm.cs gating for BrowserWasm builds.
src/Uno.CrossTargetting.targets Mirrors the same item condition updates for solution-wide cross-targeting behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<None Include="**\*.wasm.cs" Exclude="bin\**\*.wasm.cs;obj\**\*.wasm.cs" Condition="'$(UnoRuntimeIdentifier)'!='WebAssembly'" />
<Compile Remove="**\*.wasm.cs" Condition="'$(UnoRuntimeIdentifier)'!='WebAssembly'" />
<None Include="**\*.wasm.cs" Exclude="bin\**\*.wasm.cs;obj\**\*.wasm.cs" Condition="'$(UnoRuntimeIdentifier)'!='WebAssembly' AND '$(IsBrowserWasm)'!='true'" />
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description currently says "closes #" but does not reference an actual GitHub issue. Please update the PR description to include a fully-qualified issue link in a Fixes/Closes/Related footer (e.g., "Closes https://github.com/unoplatform//issues/<ISSUE_NUMBER>") or add the approved "No related issue" note if applicable.

Copilot uses AI. Check for mistakes.
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22690/wasm-skia-net9/index.html

@MartinZikmund
Copy link
Member Author

@copilot adjust the condition to make both suffixes apply in both "isbrowserwasm" and "unoruntime=webassembly" cases

Copy link
Contributor

Copilot AI commented Feb 19, 2026

@MartinZikmund I've opened a new pull request, #22698, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 19, 2026 23:21
…rWasm and UnoRuntime=WebAssembly

Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
feat: Compile `.wasm.cs` and `.browserwasm.cs` files for WebAssembly
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ MartinZikmund
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 4 commits February 19, 2026 23:43
Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
…wasm.cs

Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
feat: Compile `.wasm.cs` and `.browserwasm.cs` files for WebAssembly
Copilot AI review requested due to automatic review settings February 19, 2026 23:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 103 to +106
Starting from Uno Platform 5.2, in project or class libraries using the `Uno.Sdk`, a set of implicit file name conventions can be used to target specific platforms:

* `*.wasm.cs` is built only for `net10.0-browserwasm`
* `*.browserwasm.cs` is built only for `net10.0-browserwasm`
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list now includes both *.wasm.cs and *.browserwasm.cs with the same description ("built only for net9.0-browserwasm") which is ambiguous for readers. Please clarify the intended difference between these suffixes (e.g., native WebAssembly vs Skia browserwasm), and adjust the "Starting from Uno Platform 5.2" wording if this new suffix is introduced in a later version. Also consider updating the Uno.Sdk cross-targeting docs elsewhere (e.g., doc/articles/features/using-the-uno-sdk.md) to include *.browserwasm.cs for consistency.

Suggested change
Starting from Uno Platform 5.2, in project or class libraries using the `Uno.Sdk`, a set of implicit file name conventions can be used to target specific platforms:
* `*.wasm.cs` is built only for `net10.0-browserwasm`
* `*.browserwasm.cs` is built only for `net10.0-browserwasm`
In projects or class libraries using the `Uno.Sdk`, a set of implicit file name conventions can be used to target specific platforms:
* `*.browserwasm.cs` is built only for `net10.0-browserwasm` (recommended suffix for Browser WebAssembly)
* `*.wasm.cs` is also built only for `net10.0-browserwasm` and is kept for backward compatibility with older Uno projects

Copilot uses AI. Check for mistakes.
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22690/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22690/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 197279 has failed on Uno.UI - CI.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.wasm.cs suffix does not work with Skia WASM

6 participants

Comments