Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the browserhost loader/host JavaScript/TypeScript sources into src/native/libs/Common/JavaScript to enable reuse across runtime flavors (prepping for Mono), while updating the native build (Rollup + CMake/MSBuild wiring) to consume the new locations and pass runtime flavor information.
Changes:
- Repoint Rollup inputs (dotnet loader + libBrowserHost) and generated
.d.tsoutput paths tolibs/Common/JavaScript/*. - Introduce
RuntimeFlavorplumbed from MSBuild → CMake → Rollup environment for flavor-aware bundling. - Add the relocated loader/host source set under
src/native/libs/Common/JavaScript/{loader,host}and update internal imports accordingly.
Reviewed changes
Copilot reviewed 15 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/rollup.config.js | Updates Rollup inputs to new Common/JavaScript paths; imports runtimeFlavor. |
| src/native/rollup.config.defines.js | Adds runtimeFlavor env define and logs it; exposes it to consts plugin. |
| src/native/package.json | Updates local rollup scripts to pass RuntimeFlavor. |
| src/native/libs/Common/JavaScript/types/exchange.ts | Rewrites type-only imports to new relative loader/host paths. |
| src/native/libs/Common/JavaScript/loader/types.ts | Re-exports shared public types for loader. |
| src/native/libs/Common/JavaScript/loader/run.ts | Adds relocated runtime creation/startup orchestration. |
| src/native/libs/Common/JavaScript/loader/promise-completion-source.ts | Adds relocated promise completion source utilities. |
| src/native/libs/Common/JavaScript/loader/polyfills.ts | Adds relocated polyfills (fetch/fs/url/crypto/perf). |
| src/native/libs/Common/JavaScript/loader/per-module.ts | Adjusts re-export path for per-module constants. |
| src/native/libs/Common/JavaScript/loader/logging.ts | Adds relocated logging + exception normalization. |
| src/native/libs/Common/JavaScript/loader/lib-initializers.ts | Adds loader entrypoint for library initializers (currently stubbed). |
| src/native/libs/Common/JavaScript/loader/index.ts | Sets up dotnetInitializeModule and wires loader exports/tables. |
| src/native/libs/Common/JavaScript/loader/icu.ts | Adds ICU resource selection logic (missing standard header). |
| src/native/libs/Common/JavaScript/loader/host-builder.ts | Adds HostBuilder for configuring/starting/running runtime. |
| src/native/libs/Common/JavaScript/loader/exit.ts | Adds runtime exit handling and integration with Emscripten hooks. |
| src/native/libs/Common/JavaScript/loader/dotnet.ts | New root ES module for dotnet.js with top-level init and exports. |
| src/native/libs/Common/JavaScript/loader/dotnet.d.ts | Generated type surface now located under Common/JavaScript/loader. |
| src/native/libs/Common/JavaScript/loader/cross-module.ts | Adjusts re-export path for cross-module exchange. |
| src/native/libs/Common/JavaScript/loader/config.ts | Adds loader config normalization/merge/validation logic. |
| src/native/libs/Common/JavaScript/loader/bootstrap.ts | Adds WASM feature checks and locateFile helpers. |
| src/native/libs/Common/JavaScript/loader/assets.ts | Adds relocated asset/module loading, throttling, and fetch logic. |
| src/native/libs/Common/JavaScript/host/types.ts | Re-exports shared public types for host. |
| src/native/libs/Common/JavaScript/host/per-module.ts | Adjusts re-export path for per-module constants. |
| src/native/libs/Common/JavaScript/host/index.ts | Updates ems-ambient import path for host module. |
| src/native/libs/Common/JavaScript/host/host.ts | Updates imports to shared Common/JavaScript paths. |
| src/native/libs/Common/JavaScript/host/cross-module.ts | Adjusts re-export path for cross-module exchange. |
| src/native/libs/Common/JavaScript/host/assets.ts | Updates imports to shared Common/JavaScript paths. |
| src/native/libs/Common/JavaScript/CMakeLists.txt | Switches Rollup TS source list to new Common/JavaScript sources; passes runtime flavor; CoreCLR-only outputs for libBrowserHost. |
| src/native/.eslintignore | Updates ignored generated .d.ts path to new location. |
| eng/native.wasm.targets | Passes -DCMAKE_BUILD_RUNTIME_FLAVOR=$(RuntimeFlavor) into native CMake args. |
| .gitattributes | Updates LF normalization entry for moved dotnet.d.ts. |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
This was referenced Feb 19, 2026
Open
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.
Preparation for code reuse with Mono