Add Mono-compat loader shims to browserhost (withRuntimeOptions + legacy default export) - #133705
Closed
pavelsavara wants to merge 4 commits into
Closed
pavelsavara wants to merge 4 commits into
pavelsavara wants to merge 4 commits into
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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.
🟡 Changes recommended
Merge DotnetModuleConfig.config into the loader configuration before creating the runtime.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds browserhost compatibility with Mono’s runtime-options API and legacy runtime entrypoint.
Changes:
- Adds internal
withRuntimeOptions. - Restores legacy runtime creation/export handling.
File summaries
| File | Summary |
|---|---|
src/native/libs/Common/JavaScript/loader/host-builder.ts |
Adds runtime-options configuration support. |
src/native/libs/Common/JavaScript/loader/dotnet.ts |
Adds legacy runtime creation support; config is not merged into loader configuration, so caller-supplied settings are ignored. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Sep 14, 2026
Closed
maraf
approved these changes
Sep 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.
Restores backward compatibility with the Mono loader's
DotnetHostBuilder/ legacy entrypoint surface in the CoreCLR browserhost loader, without adding any of it to the announced public TypeScript definitions.Changes
loader/host-builder.tswithRuntimeOptions(runtimeOptions: string[])method toHostBuilder, mirroring the Mono loader's method. It validates the argument is a string array and merges the options into the loader config.// internaland intentionally not added to the publicDotnetHostBuildertype, so it stays off the announced API surface.loader/dotnet.tsexport default legacyExport) matching the Mono loader'screateDotnetRuntime/createEmscriptensignature: it accepts aDotnetModuleConfigobject or a(api) => DotnetModuleConfigfactory, appliesconfigviawithConfig, assigns the module config ontoModule, and returnsdotnet.create(). This lets existing Mono-style consumers thatimport createDotnetRuntime from './dotnet.js'keep working.dotnetexport type fromDotnetHostBuilder | undefinedtoDotnetHostBuilder.Validation
npm run rollup:debugcompiles cleanly.Note
This PR description was generated with AI assistance.