Repository navigation
[browser] deprecate setEnvironmentVariable for mono, drop it for coreclr - #126087
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the setEnvironmentVariable runtime API from the CoreCLR browser (dotnet.js) surface area and deprecates it for the Mono browser runtime, steering callers toward host-builder-based environment configuration.
Changes:
- Removed
setEnvironmentVariablefrom the CoreCLR-facing JS/TS public API (RunAPIType) and generated.d.ts. - Removed the (unimplemented)
setEnvironmentVariablestub and wiring fromSystem.Native.Browserbrowser utils. - Updated the Mono browser runtime types to mark
setEnvironmentVariableas deprecated, and adjusted the browser-shutdown sample usage.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/System.Native.Browser/utils/index.ts | Stops importing/exposing setEnvironmentVariable via the BrowserUtils RuntimeAPI wiring. |
| src/native/libs/System.Native.Browser/utils/host.ts | Removes the unimplemented setEnvironmentVariable stub from browser utils host helpers. |
| src/native/libs/Common/JavaScript/types/public-api.ts | Drops setEnvironmentVariable from the CoreCLR RunAPIType public surface. |
| src/native/libs/Common/JavaScript/loader/dotnet.d.ts | Updates generated typings to match removal of setEnvironmentVariable in CoreCLR. |
| src/mono/sample/wasm/browser-shutdown/wwwroot/main.js | Removes sample usage of setEnvironmentVariable and related click handler. |
| src/mono/browser/runtime/types/index.ts | Deprecates setEnvironmentVariable in Mono RunAPIType docs in favor of withEnvironmentVariable(). |
| src/mono/browser/runtime/dotnet.d.ts | Mirrors Mono deprecation in the .d.ts documentation. |
maraf
approved these changes
Mar 25, 2026
This was referenced Mar 26, 2026
Open
pavelsavara
marked this pull request as ready for review
March 26, 2026 05:44
Member
Author
|
/ba-g unrelated infra issues |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
setEnvironmentVariableis injecting env variables into "running process" so to speak.There is no equivalent on other targets.
Contributes to #120226