Only include System.Runtime.InteropServices.JavaScript in coreAssembly for Mono#130771
Open
pavelsavara with Copilot wants to merge 2 commits into
Open
Only include System.Runtime.InteropServices.JavaScript in coreAssembly for Mono#130771pavelsavara with Copilot wants to merge 2 commits into
pavelsavara with Copilot wants to merge 2 commits into
Conversation
…y for Mono Co-authored-by: pavelsavara <[email protected]>
Copilot created this pull request from a session on behalf of
pavelsavara
July 15, 2026 11:09
View session
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts WebAssembly boot config generation so System.Runtime.InteropServices.JavaScript.dll is only treated as a core boot-time assembly when targeting the Mono runtime, avoiding unnecessary inclusion for CoreCLR.
Changes:
- Adds a
UseMonoRuntimetask parameter and derives anisMonoRuntimeflag inGenerateWasmBootJson. - Extends
BootJsonBuilderHelperwith anIsMonoRuntimeconstructor flag and makesSystem.Runtime.InteropServices.JavaScriptcore-only for Mono. - Plumbs
$(UseMonoRuntime)throughMicrosoft.NET.Sdk.WebAssembly.Browser.targetsand includes it in the incremental stamp content so boot config regenerates when the runtime flavor changes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/GenerateWasmBootJson.cs | Adds UseMonoRuntime input and passes computed runtime-flavor flag into boot JSON building. |
| src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs | Makes “core assembly” classification depend on runtime flavor, keeping JS interop core-only for Mono. |
| src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets | Passes UseMonoRuntime into GenerateWasmBootJson and adds it to build/publish stamp content for incrementality correctness. |
Member
|
LGTM apart from one comment |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs:22
BootJsonBuilderHelperis a public type in the WebAssembly SDK tasks assembly. Changing the primary constructor signature is a source/binary breaking change for any external consumers that new up this helper directly. Consider adding a compat constructor overload with the previous signature that forwards to the new one (defaultingIsMonoRuntimetotrueto preserve prior behavior).
public class BootJsonBuilderHelper(TaskLoggingHelper Log, string DebugLevel, bool IsMultiThreaded, bool IsPublish, Version TargetFrameworkVersion, bool IsMonoRuntime)
{
#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.
internal static readonly Regex mergeWithPlaceholderRegex = new Regex(@"/\*!\s*dotnetBootConfig\s*\*/\s*{}");
internal static readonly Regex bundlerFriendlyImportsRegex = new Regex(@"/\*!\s*bundlerFriendlyImports\s*\*/");
akoeplinger
approved these changes
Jul 15, 2026
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.
Fixes #122392
System.Runtime.InteropServices.JavaScript.dllis only required to start the Mono runtime on browser-wasm; CoreCLR does not need it to boot. It should therefore only be listed in the boot config'scoreAssemblygroup when targeting Mono.Changes
BootJsonBuilderHelper: Added anIsMonoRuntimeconstructor flag.System.Private.CoreLibremains core for both runtimes;System.Runtime.InteropServices.JavaScriptmoved to a Mono-only core assembly list that is consulted only whenIsMonoRuntimeis set.GenerateWasmBootJsontask: Added aUseMonoRuntimestring parameter and computes the flag as!equals("false"), so unset/empty (the Mono default) preserves existing behavior and onlyUseMonoRuntime=false(CoreCLR) excludes the JS assembly.Microsoft.NET.Sdk.WebAssembly.Browser.targets: PassesUseMonoRuntime="$(UseMonoRuntime)"to both build and publish invocations and adds it to the incremental build/publish stamp content so the boot config regenerates when the runtime flavor changes.