Commit 9649380
committed
- modularized
- By using emcc options `MODULARIZE` and `EXPORT_ES6`, depending on `WasmEnableES6` to produce ES6 or CommonJS modules respectively.
- `WasmEnableES6` enables `WasmBuildNative` because `dotnet.js` need to be re-linked
- CommonJS version is able to be loaded into global namespace and behaves as before this change.
- Added new `modularize-dotnet.*.js` files which are included in `dotnet.js` creation.
- it exports `createDotnetRuntime` method instead of global `Module`
- `createDotnetRuntime` takes function which creates `Module`-like config `(exports) => EmscriptenModuleConfig` .
- `createDotnetRuntime` returns `Promise<{MONO, INTERNAL, BINDING, Module}>` exports.
- New `Module` extension `EmscriptenModuleConfig` has following new fields
- `EmscriptenModuleConfig.disableDotNet6Compatibility` - when `true` and if runtime script is loaded as module, it would not polute global namespace.
- `EmscriptenModuleConfig.configSrc` - location of `mono-config.json` as defined by `MonoConfig` .ts type
- `EmscriptenModuleConfig.onConfigLoaded` - callback called early during runtime init, when `MonoConfig` was loaded but runtime didn't start yet.
- `EmscriptenModuleConfig.onDotNetReady` - callback called when runtime is ready and all artifacts were loaded form `MonoConfig`. Or not called at all when `onRuntimeInitialized` is overriden in Blazor.
- Removed legacy `--testing` argument and simplified `is_testing` logic in the the samples.
- Added `browser-es6` sample app, which uses `WasmEnableES6=true` to compile `dotnet.js` as ES6 module.
- Added `browser-legacy` sample, which uses `dotnet.js` CommonJS module and loads it into global namespace.
- Improved `dotnet.d.ts`
- Attempt to fix In-Tree `_WasmSelectRuntimeComponentsForLinking` when `WasmBuildNative`dotnet.js
1 parent 3c67145 commit 9649380
File tree
33 files changed
+575
-297
lines changed- eng/testing
- src
- installer/pkg/sfx/Microsoft.NETCore.App
- libraries
- mono
- sample/wasm
- browser-bench
- browser-es6
- browser-legacy
- browser-profile
- browser
- wasm
- build
- runtime
- types
- tests/FunctionalTests/WebAssembly/Browser
- HotReload
- RuntimeConfig
33 files changed
+575
-297
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
| 504 | + | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 15 | | |
23 | 16 | | |
24 | 17 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 18 | + | |
29 | 19 | | |
30 | 20 | | |
31 | 21 | | |
| |||
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
60 | | - | |
61 | 50 | | |
62 | | - | |
63 | 51 | | |
64 | 52 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments