Skip to content

[browser] Remove public WasmInlineBootConfig, WasmBootConfigFileName properties#125645

Open
maraf wants to merge 11 commits intomainfrom
maraf/BrowserWasmOverrideBootConfigName
Open

[browser] Remove public WasmInlineBootConfig, WasmBootConfigFileName properties#125645
maraf wants to merge 11 commits intomainfrom
maraf/BrowserWasmOverrideBootConfigName

Conversation

@maraf
Copy link
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
  • Remove 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
Contributor

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

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 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
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
Since withConfigSrc was the only way to set module.configSrc and it has
been removed, the field is always undefined on entry. Replace it with a
local variable in mono_wasm_load_config and pass it as a parameter to
loadBootConfig. Remove the field from EmscriptenModuleInternal.

Co-authored-by: Copilot <223556219+Copilot@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 removes previously public ways to override the WASM boot config source/name (MSBuild properties WasmInlineBootConfig/WasmBootConfigFileName and the withConfigSrc TypeScript API), aligning behavior around the default embedded boot config and deleting the associated test coverage that was timing out (Issue #124947).

Changes:

  • Remove withConfigSrc and configSrc from public TS APIs/types; keep configSrc as an internal module detail.
  • Remove public MSBuild property plumbing for overriding inline boot config / boot config file name; keep internal defaults.
  • Delete the OverrideBootConfigName test scenario, infrastructure hooks, and test asset code.

Reviewed changes

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

Show a summary per file
File Description
src/native/libs/Common/JavaScript/types/public-api.ts Removes configSrc from public module config typing and related doc text.
src/native/libs/Common/JavaScript/loader/host-builder.ts Drops the withConfigSrc stub that threw at runtime.
src/native/libs/Common/JavaScript/loader/dotnet.d.ts Mirrors public typing changes by removing configSrc from DotnetModuleConfig.
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Removes the OverrideBootConfigName scenario wiring.
src/mono/wasm/testassets/WasmBasicTestApp/App/OverrideBootConfigNameTest.cs Deletes the managed test entrypoint used only by the removed scenario.
src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs Removes bundle-assert logic that depended on an overrideable boot config filename.
src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs Removes passing -p:WasmBootConfigFileName=... from test builds.
src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs Switches boot config resolution for assertions to a “default filename” probe.
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 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 reading public MSBuild properties for boot config overrides; keeps internal defaults.
src/mono/browser/runtime/types/internal.ts Moves configSrc onto an internal module type surface.
src/mono/browser/runtime/types/index.ts Removes withConfigSrc and configSrc from the public runtime TS API/types.
src/mono/browser/runtime/startup.ts Updates comments to reflect removal of configSrc from public override points.
src/mono/browser/runtime/loader/run.ts Removes HostBuilder.withConfigSrc implementation.
src/mono/browser/runtime/dotnet.d.ts Updates public d.ts to remove withConfigSrc and configSrc.

maraf and others added 2 commits March 25, 2026 11:56
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Config is now always embedded (inline in dotnet.js), so the separate
file loading path (loadBootConfig, fetchBootConfig, readBootConfigResponse)
is dead code. Remove it along with the BootModule type import and unused
polyfill/asset imports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 25, 2026 12:05
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 16 out of 18 changed files in this pull request and generated no new comments.

@maraf maraf marked this pull request as ready for review March 25, 2026 12:12
@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
Copy link
Contributor

🤖 Copilot Code Review — PR #125645

Holistic Assessment

Motivation: This PR removes the separate boot config file loading mechanism (loadBootConfig, readBootConfigResponse) from the Mono WASM runtime loader, since config is now always embedded inline in dotnet.js. The cleanup is justified — the removed code is dead now that the architecture has shifted to inline config.

Approach: The approach is sound: remove the dead internal loading machinery, keep a deprecated no-op withConfigSrc() on the public DotnetHostBuilder interface for backward compatibility, and clean up the internal configSrc field. The deprecated stub prevents hard TypeScript compilation failures for existing consumers.

Summary: ⚠️ Needs Human Review. The code changes are correct and well-structured. However, there are two items that warrant human reviewer attention: (1) leftover dead configSrc code in test-main.mjs, and (2) whether the removal of HTTP header–based feature integrations (Blazor-Environment, DOTNET-MODIFIABLE-ASSEMBLIES, ASPNETCORE-BROWSER-TOOLS) is fully handled elsewhere in the Blazor/ASP.NET Core hosting stack.


Detailed Findings

✅ Dead Code Removal — Correct and complete

The removal of loadBootConfig(), fetchBootConfig(), and readBootConfigResponse() from config.ts is clean. I verified:

  • No remaining callers of these functions exist in the codebase.
  • BootModule type is correctly retained — it's still used in the LoadBootResourceCallback signature in types/index.ts and loader/assets.ts.
  • makeURLAbsoluteWithApplicationBase and appendUniqueQuery are correctly only removed from config.ts imports — both are still used in assets.ts and libraryInitializers.ts.
  • The configSrc field removal from EmscriptenModuleInternal is correct — no remaining consumers.

✅ Deprecated withConfigSrc Stub — Good backward compatibility

The deprecated no-op withConfigSrc() is added consistently across all four interface declarations (types/index.ts, dotnet.d.ts, public-api.ts in Common JS) and both implementations (run.ts in Mono browser, host-builder.ts in Common JS). The @deprecated JSDoc tag will surface warnings in IDEs.

Note: The generated dotnet.d.ts in src/native/libs/Common/JavaScript/loader/ does not include withConfigSrc, which is expected since it's auto-generated and marked "not considered public API."

✅ Test Helper Update — Correct

GetDefaultBootConfigFileName in ProjectProviderBase.cs correctly removes the dotnet.boot.js probe since boot config is no longer loaded from a separate file. The fallback chain (blazor.boot.json → dotnet.js) correctly covers pre-net10 and net10+ scenarios.

✅ Typo Fix — Good

The 'chaing''chaining' fix in startup.ts is correct.

⚠️ Dead configSrc Code in test-main.mjs — Should clean up

src/mono/browser/test-main.mjs still contains dead code related to configSrc:

  • Line 121: runArgs.configSrc = runArgs.configSrc === undefined ? './_framework/dotnet.boot.js' : runArgs.configSrc;
  • Line 177: Parses --config-src= CLI argument into runArgs.configSrc

This value is set but never consumed — it's not passed to withConfigSrc() or any other function. Since this PR removes the underlying configSrc support, this dead code should be cleaned up for consistency. (Not merge-blocking, but a follow-up item at minimum.)

⚠️ HTTP Header Feature Integrations Removed — Needs human verification

The removed readBootConfigResponse() function read several HTTP headers from the boot config fetch response:

  1. Blazor-Environment / DotNet-Environment → set applicationEnvironment
  2. DOTNET-MODIFIABLE-ASSEMBLIES → enabled hot reload in Development
  3. ASPNETCORE-BROWSER-TOOLS → enabled ASP.NET Core browser tools integration

With the config now embedded inline (no HTTP fetch), these header-based integrations can no longer function through this path. I found no remaining references to these header names anywhere in src/. A human reviewer should confirm that:

  • These features are handled through a different mechanism in the current Blazor/ASP.NET Core hosting model, OR
  • These features are intentionally being dropped for net10+ (with separate boot config being a pre-net10 concept)

This is the item I'm least confident about — it could be fully handled in the ASP.NET Core repo, but I can't verify that from this repo alone.

💡 No Runtime Warning on withConfigSrc Call — Consider adding

The deprecated withConfigSrc() silently does nothing. Other builder methods in the same class wrap their body in try/catch and call mono_exit(1, err) on failure. While the no-op is intentional, a console.warn() message would help developers discover that their withConfigSrc() call is being ignored. This is a minor suggestion — the @deprecated JSDoc is the primary signal and may be sufficient.

Generated by Code Review for issue #125645 ·

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