Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[browser] runtimeConfig via boot config - #115113

#115113
Merged
pavelsavara merged 5 commits into
dotnet:maindotnet/runtime:mainfrom
pavelsavara:browser_runtimeConfigpavelsavara/runtime:browser_runtimeConfigCopy head branch name to clipboard
May 15, 2025
Merged

[browser] runtimeConfig via boot config #115113
pavelsavara merged 5 commits into
dotnet:maindotnet/runtime:mainfrom
pavelsavara:browser_runtimeConfigpavelsavara/runtime:browser_runtimeConfigCopy head branch name to clipboard

Conversation

@pavelsavara

@pavelsavara pavelsavara commented Apr 28, 2025

Copy link
Copy Markdown
Member
  • extend BootJsonData with runtimeConfig which matches just the runtimeOptions.configProperties part of *.runtimeconfig.json
  • load RuntimeConfigJsonPath in GenerateWasmBootJson and in WasmAppBuilder
  • drop RuntimeConfigParserTask from browser and move it to WASI msbuild
  • convert from json to char** in startup.ts
  • library mode initialize_runtime() out of scope
export const config = /*json-start*/{
  "mainAssemblyName": "Wasm.Browser.Sample.dll",
  "debugLevel": -1,
  "globalizationMode": "sharded",
  ...
  "runtimeConfig": {
    "runtimeOptions": {
      "configProperties": {
        "System.Net.Http.WasmEnableStreamingResponse": true,
        "Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability": true,
        ...
      }
    }
  }
}/*json-end*/;

Fixes #97449
Fixes #112442
Together with dotnet/sdk#48916

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm labels Apr 28, 2025
@pavelsavara pavelsavara added this to the 10.0.0 milestone Apr 28, 2025
@pavelsavara pavelsavara self-assigned this Apr 28, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@pavelsavara
pavelsavara force-pushed the browser_runtimeConfig branch from 8c54cf7 to 3a1d153 Compare May 9, 2025 19:00
@pavelsavara
pavelsavara marked this pull request as ready for review May 13, 2025 16:26
Copilot AI review requested due to automatic review settings May 13, 2025 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the boot configuration for browser-based apps by adding support for runtime configuration properties, refactoring runtime config parsing, and updating related tests. Key changes include:

  • Adding the runtimeConfig property (and supporting types) to BootJsonData.
  • Refactoring the runtime configuration loading in startup.ts and driver.c.
  • Updating MSBuild targets and test projects to use the new runtime configuration mechanism.

Reviewed Changes

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

Show a summary per file
File Description
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs Added runtimeConfig property and new types for runtime configuration data.
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Added a new test case branch for HttpNoStreamingTest with runtime config access.
src/mono/wasm/testassets/WasmBasicTestApp/App/HttpTest.cs Introduced HttpNoStreamingTest logic using the runtime config switch.
src/mono/wasm/testassets/WasmBasicTestApp/App/EnvVariablesTest.cs Updated logging format in environment variable test output.
src/mono/wasm/build/* and src/mono/wasi/build/* Removed references to RuntimeConfigParserTask; updated targets to use ProjectRuntimeConfigFilePath.
src/mono/browser/runtime/* Updated types and startup logic to convert runtime config properties from JSON to char** arrays and adjust the native runtime initialization.
src/mono/browser/runtime/driver.c Updated the mono_wasm_load_runtime signature and initialization to reflect runtime config changes.
src/mono/browser/runtime/cwraps.ts Updated the function signature for mono_wasm_load_runtime.
Other test and project files Adjusted tests and project definitions to align with runtime config changes.

Comment thread src/mono/browser/runtime/driver.c
Comment thread src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js
@lewing

lewing commented May 14, 2025

Copy link
Copy Markdown
Member

test failures look relevant

Comment thread src/mono/browser/runtime/startup.ts
@pavelsavara
pavelsavara merged commit 9a83ba8 into dotnet:main May 15, 2025
@pavelsavara
pavelsavara deleted the browser_runtimeConfig branch May 15, 2025 18:43
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

Make modern http streaming apis easily consumable in WebAssembly [browser] Support AppContext switches on runtime

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.