Skip to content

[browser] Remove public WasmInlineBootConfig, WasmBootConfigFileName properties#125645

Merged
maraf merged 15 commits intomainfrom
maraf/BrowserWasmOverrideBootConfigName
Mar 26, 2026
Merged

[browser] Remove public WasmInlineBootConfig, WasmBootConfigFileName properties#125645
maraf merged 15 commits intomainfrom
maraf/BrowserWasmOverrideBootConfigName

Conversation

@maraf
Copy link
Copy Markdown
Member

@maraf maraf commented Mar 17, 2026

… and withConfigSrc API

Drop support for overriding the boot config file name via public MSBuild properties (WasmInlineBootConfig, WasmBootConfigFileName) and the withConfigSrc TypeScript API. Users should either use the default embedded boot config or implement their own solution.

  • Remove public MSBuild property references; private defaults unchanged
  • Deprecate withConfigSrc from TypeScript API (host-builder, run.ts, types)
  • Remove configSrc from both public DotnetModuleConfig and internal EmscriptenModuleInternal
  • Remove boot config file loading path (loadBootConfig, readBootConfigResponse) since config is now always embedded
  • Simplify mono_wasm_load_config to only normalize config and invoke callbacks
  • Remove OverrideBootConfigName test and test asset
  • Remove BootConfigFileName from test infrastructure

Fixes #124947

… and withConfigSrc API

Drop support for overriding the boot config file name via public MSBuild
properties (WasmInlineBootConfig, WasmBootConfigFileName) and the
withConfigSrc TypeScript API. Users should either use the default
embedded boot config or implement their own solution.

- Remove public MSBuild property references; private defaults unchanged
- Remove withConfigSrc from TypeScript API (host-builder, run.ts, types)
- Move configSrc from public DotnetModuleConfig to internal type
- Remove OverrideBootConfigName test and test asset
- Remove BootConfigFileName from test infrastructure

Fixes #124947

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maraf maraf added this to the 11.0.0 milestone Mar 17, 2026
@maraf maraf self-assigned this Mar 17, 2026
Copilot AI review requested due to automatic review settings March 17, 2026 11:02
@maraf maraf added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm labels Mar 17, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
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 removes public customization hooks for the WASM boot config source/name (MSBuild properties WasmInlineBootConfig / WasmBootConfigFileName and the TypeScript withConfigSrc API), aligning the browser runtime and tests with using the default embedded boot config or fully custom user solutions.

Changes:

  • Removes withConfigSrc from the browser runtime’s public TypeScript API surface (types + HostBuilder implementation) and moves configSrc to internal module typing.
  • Removes public MSBuild property wiring for boot config override and keeps internal defaults for _WasmInlineBootConfig / _WasmBootConfigFileName.
  • Deletes the OverrideBootConfigName test scenario and removes BootConfigFileName plumbing from the WASM build test infrastructure.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/native/libs/Common/JavaScript/types/public-api.ts Removes public configSrc mention/field from the common JS public API typings.
src/native/libs/Common/JavaScript/loader/host-builder.ts Drops the unsupported withConfigSrc method from the common JS host builder.
src/native/libs/Common/JavaScript/loader/dotnet.d.ts Updates generated typings to remove configSrc from module config.
src/mono/browser/runtime/types/index.ts Removes withConfigSrc and configSrc from the public browser runtime typings.
src/mono/browser/runtime/dotnet.d.ts Mirrors public API removal in the .d.ts surface.
src/mono/browser/runtime/loader/run.ts Removes HostBuilder.withConfigSrc implementation.
src/mono/browser/runtime/types/internal.ts Adds configSrc to internal module typing so internal loader code can still use it.
src/mono/browser/runtime/startup.ts Updates comments to reflect removal of configSrc from public configuration.
src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets Stops copying public MSBuild properties into internal boot config selection logic.
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Removes the OverrideBootConfigName JS test scenario code path.
src/mono/wasm/testassets/WasmBasicTestApp/App/OverrideBootConfigNameTest.cs Deletes the managed test asset used only by the removed scenario.
src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs Removes the OverrideBootConfigName test.
src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs Removes passing WasmBootConfigFileName via test build options.
src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs Removes boot-config-name-dependent expectations in bundle assertions.
src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs Updates boot config assertion path resolution to no longer depend on BootConfigFileName.
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/MSBuildOptions.cs Removes BootConfigFileName from base build/publish option records.
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/BuildOptions.cs Removes BootConfigFileName from build options.
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/PublishOptions.cs Removes BootConfigFileName from publish options.

You can also share your feedback on Copilot code review. Take the survey.

maraf and others added 2 commits March 17, 2026 14:52
- Add GetDefaultBootConfigFileName that probes for blazor.boot.json
  (pre-net10) before defaulting to dotnet.js, fixing compatibility
  with older TFMs in WorkloadsTestPreviousVersions scenarios
- Fix comment grammar in startup.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 17, 2026 18:35
Copy link
Copy Markdown
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

Removes public knobs for overriding the WASM boot config file name (MSBuild properties and the withConfigSrc TypeScript API) to avoid unsupported/unstable scenarios (notably the OverrideBootConfigName timeout in #124947) and simplifies the related test infrastructure.

Changes:

  • Remove withConfigSrc from the browser runtime TypeScript API surface and move configSrc to internal-only types.
  • Stop flowing public MSBuild properties (WasmInlineBootConfig, WasmBootConfigFileName) into the SDK’s internal properties; keep internal defaults.
  • Remove the OverrideBootConfigName test case, related test asset code, and BootConfigFileName plumbing in WASM build tests.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/native/libs/Common/JavaScript/types/public-api.ts Removes configSrc from the public DotnetModuleConfig type and trims related doc text.
src/native/libs/Common/JavaScript/loader/host-builder.ts Drops the withConfigSrc API (previously throwing) from the host builder implementation.
src/native/libs/Common/JavaScript/loader/dotnet.d.ts Updates generated typings to remove configSrc from DotnetModuleConfig.
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Removes the OverrideBootConfigName JS scenario and associated output.
src/mono/wasm/testassets/WasmBasicTestApp/App/OverrideBootConfigNameTest.cs Deletes the managed test used by the removed scenario.
src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs Removes boot-config-name override expectations from bundle file checks.
src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs Removes passing -p:WasmBootConfigFileName=... from build/publish helpers.
src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs Switches boot config assertions to use a “default boot config filename” probe instead of BootConfigFileName options.
src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs Removes the OverrideBootConfigName test coverage.
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/PublishOptions.cs Removes BootConfigFileName from publish option records.
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/MSBuildOptions.cs Removes BootConfigFileName from the shared MSBuild options record.
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/BuildOptions.cs Removes BootConfigFileName from build option records.
src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets Stops honoring public WasmInlineBootConfig / WasmBootConfigFileName and relies on internal defaults.
src/mono/browser/runtime/types/internal.ts Moves configSrc to internal module typing (EmscriptenModuleInternal).
src/mono/browser/runtime/types/index.ts Removes withConfigSrc and configSrc from the public browser runtime types.
src/mono/browser/runtime/startup.ts Updates comments related to default startup sequence; minor text changes.
src/mono/browser/runtime/loader/run.ts Removes the withConfigSrc implementation that merged configSrc into the module.
src/mono/browser/runtime/dotnet.d.ts Updates generated typings to remove withConfigSrc and configSrc.

You can also share your feedback on Copilot code review. Take the survey.

maraf and others added 2 commits March 25, 2026 11:41
- Add missing dotnet.boot.js probe in GetDefaultBootConfigFileName so
  non-inline boot config layouts are detected correctly
- Fix typo: 'chaing' -> 'chaining' in startup.ts comment

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 25, 2026 11:44
@github-actions

This comment has been minimized.

Copilot stopped work on behalf of maraf due to an error March 25, 2026 13:02
Keep an empty/dummy withConfigSrc method with @deprecated JSDoc note
in both the Common JavaScript loader and Mono browser runtime hosts,
so that existing consumers get a deprecation warning instead of a
hard break.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maraf maraf enabled auto-merge (squash) March 25, 2026 13:17
@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings March 25, 2026 15:52
Copy link
Copy Markdown
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 16 out of 18 changed files in this pull request and generated 4 comments.

@github-actions

This comment has been minimized.

maraf and others added 2 commits March 25, 2026 19:00
The configSrc property was set but never consumed after the boot config
loading removal. Remove the default assignment in initRunArgs and the
--config-src CLI argument parsing in processArguments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove unused MonoConfig import from config.ts and suppress
no-unused-vars lint for the deprecated withConfigSrc parameter in
run.ts.

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

This comment has been minimized.

Copilot AI review requested due to automatic review settings March 26, 2026 11:43
Copy link
Copy Markdown
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 17 out of 19 changed files in this pull request and generated no new comments.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Copilot Code Review — PR #125645

Holistic Assessment

Motivation: The PR removes the configSrc mechanism (external boot config file loading) and related customization MSBuild properties, since boot config is now always inlined into dotnet.js for net10+. This is a natural simplification following the inline boot config architecture.

Approach: The approach is sound — deprecate withConfigSrc() as a no-op stub, remove internal loading logic, remove public MSBuild properties, and update tests. The removal is clean and thorough.

Summary: ⚠️ Needs Human Review. The code changes are correct and the removal is well-executed. However, there are a few behavioral concerns worth human evaluation: (1) the deprecated withConfigSrc() silently no-ops without a runtime warning, which may confuse users; (2) HTTP header-based dev tooling config (Blazor-Environment, DOTNET-MODIFIABLE-ASSEMBLIES, ASPNETCORE-BROWSER-TOOLS) is removed with no replacement in this codebase; and (3) the public MSBuild properties WasmBootConfigFileName and WasmInlineBootConfig are silently dropped. These may all be intentional and already handled elsewhere (e.g., in aspnetcore), but a maintainer familiar with the Blazor dev tooling pipeline should confirm.


Detailed Findings

✅ Clean configSrc Removal — Code is correct and thorough

The removal of loadBootConfig, readBootConfigResponse, and all configSrc field references from config.ts, run.ts, startup.ts, internal.ts, and test-main.mjs is clean. No functional references to configSrc remain — only deprecated withConfigSrc() stubs in both the mono and coreclr host builders. The BootModule type import is correctly removed. The makeURLAbsoluteWithApplicationBase and appendUniqueQuery imports removed from config.ts are still used elsewhere (assets.ts, libraryInitializers.ts), so no dead exports are created.

⚠️ Silent No-Op Deprecation — withConfigSrc() should log a warning

Both src/mono/browser/runtime/loader/run.ts and src/native/libs/Common/JavaScript/loader/host-builder.ts implement withConfigSrc() as a silent no-op:

withConfigSrc(_configSrc: string): DotnetHostBuilder {
    return this;
}

Users who were relying on withConfigSrc() to point the runtime at a custom boot config URL will now silently get broken behavior — the method appears to succeed but does nothing. A one-time console.warn("withConfigSrc is deprecated and no longer has any effect. Boot config is now embedded in dotnet.js.") would provide much better developer experience and help users discover they need to change their integration approach. (Flagged by both Claude and GPT-5.2)

⚠️ HTTP Header-Based Dev Tooling Config Removed

The deleted readBootConfigResponse function previously extracted dev tooling headers from the boot config HTTP response:

  • Blazor-Environment / DotNet-EnvironmentapplicationEnvironment
  • DOTNET-MODIFIABLE-ASSEMBLIES → hot reload env var
  • ASPNETCORE-BROWSER-TOOLS → browser tools env var

These header names no longer appear anywhere in the runtime codebase. With inline boot config (embedded in dotnet.js), there's no HTTP response to read headers from, so this removal is architecturally consistent. However, if Blazor's dev server tooling relies on these headers to configure hot reload / environment detection, this could be a regression for Blazor dev scenarios. A maintainer should confirm that these capabilities are already handled differently in the aspnetcore/Blazor pipeline for net10+.

⚠️ Public MSBuild Properties Silently Removed

The PR removes the ability for users to set two public MSBuild properties:

  1. WasmBootConfigFileName — previously forwarded to _WasmBootConfigFileName via <_WasmBootConfigFileName>$(WasmBootConfigFileName)</_WasmBootConfigFileName>, now that line is deleted.
  2. WasmInlineBootConfig — previously forwarded to _WasmInlineBootConfig, now removed. For net10+, _WasmInlineBootConfig is unconditionally set to true.

Users who set these properties in their .csproj files will find them silently ignored with no build warning. Since these properties were only introduced for net10 preview, this is less impactful than it would be for a stable release. Still, consider emitting a <Warning> if either property is set (similar to how the SDK handles other deprecated properties).

✅ Test Changes Are Appropriate

The OverrideBootConfigName test and its test asset (OverrideBootConfigNameTest.cs) are correctly removed since the feature no longer exists. The BootConfigFileName parameter removal from BuildOptions, PublishOptions, and MSBuildOptions is consistent. The test infrastructure in WasmSdkBasedProjectProvider.cs and WasmTemplateTestsBase.cs is cleaned up properly.

GetDefaultBootConfigFileName Probe Logic Is Correct

The new method in ProjectProviderBase.cs:

private static string GetDefaultBootConfigFileName(string binFrameworkDir)
{
    if (File.Exists(Path.Combine(binFrameworkDir, "blazor.boot.json")))
        return "blazor.boot.json";
    return "dotnet.js";
}

This correctly covers the two production scenarios: blazor.boot.json for pre-net10, and dotnet.js for net10+ (inline boot config). The MSBuild targets still have a dotnet.boot.js fallback condition (line 219), but this is effectively dead code since _WasmInlineBootConfig is always true for net10+ after this PR.

💡 withConfigSrc Added to CoreCLR Interface — Intentional alignment

In src/native/libs/Common/JavaScript/types/public-api.ts, withConfigSrc was not previously in the DotnetHostBuilder interface (though the implementation in host-builder.ts had it and threw "Not supported in this build"). The PR adds it as a deprecated method, aligning the interface definition with the mono version. The previous "throw" behavior is replaced with a no-op, which is more graceful. This is a reasonable approach to unify the two host builder interfaces while deprecating.

💡 Dead MSBuild Condition

Line 219 in Microsoft.NET.Sdk.WebAssembly.Browser.targets:

<_WasmBootConfigFileName Condition="'$(_WasmBootConfigFileName)' == '' and '$(_TargetingNET100OrLater)' == 'true'">dotnet.boot.js</_WasmBootConfigFileName>

This condition is unreachable for net10+ since _WasmInlineBootConfig is always true (and the previous condition on line 218 will always match first). It's harmless but could be cleaned up in a follow-up.


Review model: Claude Opus 4.6 (primary), with cross-validation from GPT-5.2. Gemini 3 Pro was attempted but returned an error.

Note

This review was generated by GitHub Copilot.

Generated by Code Review for issue #125645 ·

@maraf
Copy link
Copy Markdown
Member Author

maraf commented Mar 26, 2026

/ba-g Failures are timeouts

@maraf maraf merged commit 7602c30 into main Mar 26, 2026
121 of 136 checks passed
@maraf maraf deleted the maraf/BrowserWasmOverrideBootConfigName branch March 26, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[coreclr] OverrideBootConfigName timeouts in publish and build

3 participants