Skip to content

Commit cac6aef

Browse files
committed
wip
1 parent 2e17200 commit cac6aef

File tree

108 files changed

+2186
-2033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2186
-2033
lines changed

eng/liveBuilds.targets

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,13 @@
195195
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser'"
196196
Include="
197197
$(LibrariesNativeArtifactsPath)dotnet.js;
198+
$(LibrariesNativeArtifactsPath)dotnet.native.js;
199+
$(LibrariesNativeArtifactsPath)dotnet.runtime.js;
198200
$(LibrariesNativeArtifactsPath)dotnet.d.ts;
199201
$(LibrariesNativeArtifactsPath)dotnet-legacy.d.ts;
200202
$(LibrariesNativeArtifactsPath)package.json;
201-
$(LibrariesNativeArtifactsPath)dotnet.wasm;
202-
$(LibrariesNativeArtifactsPath)dotnet.js.symbols;
203+
$(LibrariesNativeArtifactsPath)dotnet.native.wasm;
204+
$(LibrariesNativeArtifactsPath)dotnet.native.js.symbols;
203205
$(LibrariesNativeArtifactsPath)*.dat;"
204206
IsNative="true" />
205207
<!-- for threaded wasm -->
@@ -231,7 +233,7 @@
231233
<ItemGroup Label="Wasi" Condition="'$(TargetOS)' == 'wasi'">
232234
<LibrariesRuntimeFiles
233235
Include="
234-
$(LibrariesNativeArtifactsPath)dotnet.wasm;
236+
$(LibrariesNativeArtifactsPath)dotnet.native.wasm;
235237
$(LibrariesNativeArtifactsPath)*.dat;"
236238
IsNative="true" />
237239

eng/testing/tests.browser.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)</_XHarnessArgs>
106106
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)</_XHarnessArgs>
107107
<_XHarnessArgs Condition="('$(WasmEnableThreads)' == 'true' or '$(WasmEnablePerfTracing)' == 'true') and '$(_XHarnessArs.Contains(&quot;--web-server-use-cop&quot;)' != 'true'">$(_XHarnessArgs) --web-server-use-cop</_XHarnessArgs>
108-
<_XHarnessArgs >$(_XHarnessArgs) -s dotnet.js.symbols</_XHarnessArgs>
108+
<_XHarnessArgs >$(_XHarnessArgs) -s dotnet.native.js.symbols</_XHarnessArgs>
109109
<_XHarnessArgs Condition="'$(_UseWasmSymbolicator)' == 'true'" >$(_XHarnessArgs) --symbol-patterns wasm-symbol-patterns.txt</_XHarnessArgs>
110110
<_XHarnessArgs Condition="'$(_UseWasmSymbolicator)' == 'true'" >$(_XHarnessArgs) --symbolicator WasmSymbolicator.dll,Microsoft.WebAssembly.Internal.SymbolicatorWrapperForXHarness</_XHarnessArgs>
111111
<_XHarnessArgs Condition="'$(_WasmBrowserPathForTests)' != ''" >$(_XHarnessArgs) &quot;--browser-path=$(_WasmBrowserPathForTests)&quot;</_XHarnessArgs>

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,13 @@
237237
<PlatformManifestFileEntry Include="libmono-wasm-eh-wasm.a" IsNative="true" />
238238
<PlatformManifestFileEntry Include="wasm-bundled-timezones.a" IsNative="true" />
239239
<PlatformManifestFileEntry Include="dotnet.js" IsNative="true" />
240-
<PlatformManifestFileEntry Include="dotnet.worker.js" IsNative="true" />
241-
<PlatformManifestFileEntry Include="dotnet.js.symbols" IsNative="true" />
240+
<PlatformManifestFileEntry Include="dotnet.runtime.js" IsNative="true" />
241+
<PlatformManifestFileEntry Include="dotnet.native.js" IsNative="true" />
242+
<PlatformManifestFileEntry Include="dotnet.native.worker.js" IsNative="true" />
243+
<PlatformManifestFileEntry Include="dotnet.native.js.symbols" IsNative="true" />
242244
<PlatformManifestFileEntry Include="dotnet.d.ts" IsNative="true" />
243245
<PlatformManifestFileEntry Include="dotnet-legacy.d.ts" IsNative="true" />
244-
<PlatformManifestFileEntry Include="dotnet.wasm" IsNative="true" />
246+
<PlatformManifestFileEntry Include="dotnet.native.wasm" IsNative="true" />
245247
<PlatformManifestFileEntry Include="icudt.dat" IsNative="true" />
246248
<PlatformManifestFileEntry Include="icudt_no_CJK.dat" IsNative="true" />
247249
<PlatformManifestFileEntry Include="icudt_CJK.dat" IsNative="true" />
@@ -250,7 +252,6 @@
250252
<PlatformManifestFileEntry Include="icudt_optimal_no_CJK.dat" IsNative="true" />
251253
<PlatformManifestFileEntry Include="package.json" IsNative="true" />
252254
<PlatformManifestFileEntry Include="pal_random.lib.js" IsNative="true" />
253-
<PlatformManifestFileEntry Include="runtime.es6.iffe.js" IsNative="true" />
254255
<PlatformManifestFileEntry Include="dotnet.es6.pre.js" IsNative="true" />
255256
<PlatformManifestFileEntry Include="dotnet.es6.lib.js" IsNative="true" />
256257
<PlatformManifestFileEntry Include="dotnet.es6.extpost.js" IsNative="true" />
@@ -271,6 +272,7 @@
271272
<PlatformManifestFileEntry Include="driver.h" IsNative="true" />
272273
<PlatformManifestFileEntry Include="stubs.c" IsNative="true" />
273274
<PlatformManifestFileEntry Include="synthetic-pthread.c" IsNative="true" />
275+
<PlatformManifestFileEntry Include="dotnet.wasm" IsNative="true" />
274276
<!-- ICU-specific files -->
275277
<PlatformManifestFileEntry Include="libicudata.a" IsNative="true" />
276278
<PlatformManifestFileEntry Include="libicui18n.a" IsNative="true" />

src/mono/sample/wasm/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
$(TargetFileName)
3232
"
3333
Outputs="
34-
bin/$(Configuration)/AppBundle/dotnet.wasm;
34+
bin/$(Configuration)/AppBundle/dotnet.native.wasm;
3535
bin/$(Configuration)/AppBundle/$(_WasmMainJSFileName);
3636
">
3737
<PropertyGroup>

src/mono/sample/wasm/browser-advanced/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<script type='module' src="./main.js"></script>
1111
<script type='module' src="./dotnet.js"></script>
1212
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
13-
<link rel="prefetch" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
13+
<link rel="prefetch" href="./dotnet.native.js" as="fetch" crossorigin="anonymous">
14+
<link rel="prefetch" href="./dotnet.runtime.js" as="fetch" crossorigin="anonymous">
15+
<link rel="prefetch" href="./dotnet.native.wasm" as="fetch" crossorigin="anonymous">
1416
<!-- users should consider if they optimize for the first load or subsequent load from memory snapshot -->
1517
<link rel="prefetch" href="./icudt.dat" as="fetch" crossorigin="anonymous">
1618
<link rel="prefetch" href="./managed/System.Private.CoreLib.webcil" as="fetch" crossorigin="anonymous">

src/mono/sample/wasm/browser-bench/appstart-frame.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<script type="module" src="./frame-main.js"></script>
1111
<script type='module' src="./dotnet.js"></script>
1212
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
13-
<link rel="prefetch" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
13+
<link rel="prefetch" href="./dotnet.native.js" as="fetch" crossorigin="anonymous">
14+
<link rel="prefetch" href="./dotnet.runtime.js" as="fetch" crossorigin="anonymous">
15+
<link rel="prefetch" href="./dotnet.native.wasm" as="fetch" crossorigin="anonymous">
1416
<!-- users should consider if they optimize for the first load or subsequent load from memory snapshot -->
1517
<link rel="prefetch" href="./managed/System.Private.CoreLib.dll" as="fetch" crossorigin="anonymous">
1618
</head>

src/mono/sample/wasm/browser-webpack/Wasm.Browser.WebPack.Sample.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010

1111

1212
<Target Name="CopyRelinkedPackage" AfterTargets="WasmBuildApp" DependsOnTargets="Build" Inputs="$(WasmAppDir)/dotnet.js;
13-
$(WasmAppDir)/dotnet.wasm;
13+
$(WasmAppDir)/dotnet.runtime.js;
14+
$(WasmAppDir)/dotnet.native.js;
15+
$(WasmAppDir)/dotnet.native.wasm;
1416
$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet.d.ts;
1517
$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet-legacy.d.ts;
1618
$(MicrosoftNetCoreAppRuntimePackNativeDir)/package.json;" Outputs="bin/dotnet-runtime/.npm-stamp">
1719
<ItemGroup>
1820
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.js"/>
19-
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.wasm"/>
21+
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.runtime.js"/>
22+
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.native.js"/>
23+
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.native.wasm"/>
2024
<NpmPackageFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet.d.ts"/>
2125
<NpmPackageFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet-legacy.d.ts"/>
2226
<NpmPackageFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)/package.json"/>

src/mono/sample/wasm/node-webpack/Wasm.Node.WebPack.Sample.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
</PropertyGroup>
66

77
<Target Name="CopyRelinkedPackage" AfterTargets="WasmBuildApp" DependsOnTargets="Build" Inputs="$(WasmAppDir)/dotnet.js;
8-
$(WasmAppDir)/dotnet.wasm;
8+
$(WasmAppDir)/dotnet.runtime.js;
9+
$(WasmAppDir)/dotnet.native.js;
10+
$(WasmAppDir)/dotnet.native.wasm;
911
$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet.d.ts;
1012
$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet-legacy.d.ts;
1113
$(MicrosoftNetCoreAppRuntimePackNativeDir)/package.json;" Outputs="bin/dotnet-runtime/.npm-stamp">
1214
<ItemGroup>
1315
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.js"/>
14-
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.wasm"/>
16+
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.runtime.js"/>
17+
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.native.js"/>
18+
<NpmPackageFiles Include="$(WasmAppDir)/dotnet.native.wasm"/>
1519
<NpmPackageFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet.d.ts"/>
1620
<NpmPackageFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)/dotnet-legacy.d.ts"/>
1721
<NpmPackageFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)/package.json"/>

src/mono/wasm/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ The wrapper script used to actually run these tests, accepts:
133133

134134
Exceptions thrown after the runtime starts get symbolicating from js itself. Exceptions before that, like asserts containing native traces get symbolicated by xharness using `src/mono/wasm/symbolicator`.
135135

136-
If you need to symbolicate some traces manually, then you need the corresponding `dotnet.js.symbols` file. Then:
136+
If you need to symbolicate some traces manually, then you need the corresponding `dotnet.native.js.symbols` file. Then:
137137

138138
```console
139-
src/mono/wasm/symbolicator$ dotnet run /path/to/dotnet.js.symbols /path/to/file/with/traces
139+
src/mono/wasm/symbolicator$ dotnet run /path/to/dotnet.native.js.symbols /path/to/file/with/traces
140140
```
141141

142-
When not relinking, or not building with AOT, you can find `dotnet.js.symbols` in the runtime pack.
142+
When not relinking, or not building with AOT, you can find `dotnet.native.js.symbols` in the runtime pack.
143143

144144
## Debugger tests on macOS
145145

src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ protected void AssertDotNetNativeFiles(NativeFilesType type, string config, bool
621621
_ => throw new ArgumentOutOfRangeException(nameof(type))
622622
};
623623

624-
AssertSameFile(Path.Combine(srcDir, "dotnet.wasm"), Path.Combine(binFrameworkDir, "dotnet.wasm"), label);
624+
AssertSameFile(Path.Combine(srcDir, "dotnet.native.wasm"), Path.Combine(binFrameworkDir, "dotnet.native.wasm"), label);
625625

626626
// find dotnet*js
627627
string? dotnetJsPath = Directory.EnumerateFiles(binFrameworkDir)
@@ -630,13 +630,13 @@ protected void AssertDotNetNativeFiles(NativeFilesType type, string config, bool
630630
.SingleOrDefault();
631631

632632
Assert.True(!string.IsNullOrEmpty(dotnetJsPath), $"[{label}] Expected to find dotnet*js in {binFrameworkDir}");
633-
AssertSameFile(Path.Combine(srcDir, "dotnet.js"), dotnetJsPath!, label);
633+
AssertSameFile(Path.Combine(srcDir, "dotnet.native.js"), dotnetJsPath!, label);
634634

635635
if (type != NativeFilesType.FromRuntimePack)
636636
{
637637
// check that the files are *not* from runtime pack
638-
AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.wasm"), Path.Combine(binFrameworkDir, "dotnet.wasm"), label);
639-
AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.js"), dotnetJsPath!, label);
638+
AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.wasm"), Path.Combine(binFrameworkDir, "dotnet.native.wasm"), label);
639+
AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.js"), dotnetJsPath!, label);
640640
}
641641
}
642642

@@ -667,9 +667,11 @@ protected static void AssertBasicAppBundle(string bundleDir,
667667
var filesToExist = new List<string>()
668668
{
669669
mainJS,
670-
"dotnet.wasm",
670+
"dotnet.native.wasm",
671671
"mono-config.json",
672-
"dotnet.js"
672+
"dotnet.js",
673+
"dotnet.native.js",
674+
"dotnet.runtime.js"
673675
};
674676

675677
if (isBrowserProject)
@@ -751,20 +753,20 @@ void AssertIcuAssets()
751753

752754
protected static void AssertDotNetWasmJs(string bundleDir, bool fromRuntimePack, string targetFramework)
753755
{
754-
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.wasm"),
755-
Path.Combine(bundleDir, "dotnet.wasm"),
756-
"Expected dotnet.wasm to be same as the runtime pack",
756+
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.wasm"),
757+
Path.Combine(bundleDir, "dotnet.native.wasm"),
758+
"Expected dotnet.native.wasm to be same as the runtime pack",
757759
same: fromRuntimePack);
758760

759-
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.js"),
760-
Path.Combine(bundleDir, "dotnet.js"),
761-
"Expected dotnet.js to be same as the runtime pack",
761+
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.js"),
762+
Path.Combine(bundleDir, "dotnet.native.js"),
763+
"Expected dotnet.native.js to be same as the runtime pack",
762764
same: fromRuntimePack);
763765
}
764766

765767
protected static void AssertDotNetJsSymbols(string bundleDir, bool fromRuntimePack, string targetFramework)
766-
=> AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.js.symbols"),
767-
Path.Combine(bundleDir, "dotnet.js.symbols"),
768+
=> AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.js.symbols"),
769+
Path.Combine(bundleDir, "dotnet.native.js.symbols"),
768770
same: fromRuntimePack);
769771

770772
protected static void AssertFilesDontExist(string dir, string[] filenames, string? label = null)
@@ -820,17 +822,17 @@ protected void AssertBlazorBundle(string config, bool isPublish, bool dotnetWasm
820822
binFrameworkDir ??= FindBlazorBinFrameworkDir(config, isPublish, targetFramework);
821823

822824
AssertBlazorBootJson(config, isPublish, targetFramework, binFrameworkDir: binFrameworkDir);
823-
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.wasm"),
824-
Path.Combine(binFrameworkDir, "dotnet.wasm"),
825-
"Expected dotnet.wasm to be same as the runtime pack",
825+
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.wasm"),
826+
Path.Combine(binFrameworkDir, "dotnet.native.wasm"),
827+
"Expected dotnet.native.wasm to be same as the runtime pack",
826828
same: dotnetWasmFromRuntimePack);
827829

828830
string? dotnetJsPath = Directory.EnumerateFiles(binFrameworkDir, "dotnet.*.js").FirstOrDefault();
829831
Assert.True(dotnetJsPath != null, $"Could not find blazor's dotnet*js in {binFrameworkDir}");
830832

831-
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.js"),
833+
AssertFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.native.js"),
832834
dotnetJsPath!,
833-
"Expected dotnet.js to be same as the runtime pack",
835+
"Expected dotnet.native.js to be same as the runtime pack",
834836
same: dotnetWasmFromRuntimePack);
835837
}
836838

@@ -847,7 +849,7 @@ protected void AssertBlazorBootJson(string config, bool isPublish, string target
847849
Assert.NotNull(runtimeObj);
848850

849851
string msgPrefix=$"[{( isPublish ? "publish" : "build" )}]";
850-
Assert.True(runtimeObj!.Where(kvp => kvp.Key == "dotnet.wasm").Any(), $"{msgPrefix} Could not find dotnet.wasm entry in blazor.boot.json");
852+
Assert.True(runtimeObj!.Where(kvp => kvp.Key == "dotnet.native.wasm").Any(), $"{msgPrefix} Could not find dotnet.native.wasm entry in blazor.boot.json");
851853
Assert.True(runtimeObj!.Where(kvp => kvp.Key.StartsWith("dotnet.", StringComparison.OrdinalIgnoreCase) &&
852854
kvp.Key.EndsWith(".js", StringComparison.OrdinalIgnoreCase)).Any(),
853855
$"{msgPrefix} Could not find dotnet.*js in {bootJson}");

0 commit comments

Comments
 (0)