Skip to content

Commit fa42e91

Browse files
authored
chore: Adjust invocations
1 parent 03744ca commit fa42e91

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ namespace Uno.WebAssembly.Bootstrap {
104104
.withRuntimeOptions(config.config.uno_runtime_options)
105105
.withConfig({ loadAllSatelliteResources: config.config.uno_load_all_satellite_resources });
106106

107-
var features = config.config.environmentVariables['UNO_BOOTSTRAP_MONO_RUNTIME_FEATURES'];
108-
109-
if (features && features.includes('threads')) {
110-
// m.dotnet
111-
// .withConfig({ jsThreadBlockingMode: "DangerousAllowBlockingWait" });
112-
}
113-
114107
const dotnetRuntime = await m.default(
115108
(context: DotnetPublicAPI) => {
116109
bootstrapper.configure(context);
@@ -145,7 +138,6 @@ namespace Uno.WebAssembly.Bootstrap {
145138
onConfigLoaded: this.onConfigLoaded,
146139
onDotnetReady: this.onDotnetReady,
147140
onAbort: this.onAbort,
148-
pthreadPoolInitialSize: 2,
149141
exports: ["IDBFS", "FS"].concat(this._unoConfig.emcc_exported_runtime_methods),
150142
onDownloadResourceProgress: (resourcesLoaded: number, totalResources: number) => this.reportDownloadResourceProgress(resourcesLoaded, totalResources),
151143
};
@@ -261,9 +253,9 @@ namespace Uno.WebAssembly.Bootstrap {
261253

262254
await this.setupHotReload();
263255

264-
//if (this._hotReloadSupport) {
265-
// await this._hotReloadSupport.initializeHotReload();
266-
//}
256+
if (this._hotReloadSupport) {
257+
await this._hotReloadSupport.initializeHotReload();
258+
}
267259

268260
this._runMain(this._unoConfig.uno_main, []);
269261

src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/HotReloadSupport.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ namespace Uno.WebAssembly.Bootstrap {
4040
if (!await HotReloadSupport._initializeMethod()) {
4141
console.warn("The application was compiled with the IL linker enabled, hot reload is disabled. See https://aka.platform.uno/wasm-il-linker for more details.");
4242
}
43+
4344
let capabilities = await HotReloadSupport._getApplyUpdateCapabilitiesMethod();
4445

4546
// Take the place of the internal .NET for WebAssembly APIs for metadata updates coming

src/Uno.Wasm.Tests.Shared/Runtime.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Runtime.InteropServices;
44
using System.Runtime.InteropServices.ComTypes;
55
using System.Runtime.InteropServices.JavaScript;
6-
using System.Threading.Tasks;
76

87
namespace WebAssembly
98
{
@@ -12,7 +11,7 @@ internal sealed class Runtime
1211
/// <summary>
1312
/// Invokes Javascript code in the hosting environment
1413
/// </summary>
15-
internal static Task<string> InvokeJS(string str)
14+
internal static string InvokeJS(string str)
1615
{
1716
Console.WriteLine($"Invoking {str}");
1817
return Interop.InvokeJS(str);
@@ -22,6 +21,6 @@ internal static Task<string> InvokeJS(string str)
2221
internal static partial class Interop
2322
{
2423
[JSImport("globalThis.Uno.WebAssembly.Bootstrap.Bootstrapper.invokeJS")]
25-
public static partial Task<string> InvokeJS(string value);
24+
public static partial string InvokeJS(string value);
2625
}
2726
}

src/Uno.Wasm.Threads.Shared/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static void Main()
4444
Console.WriteLine($"TID: {Thread.CurrentThread.ManagedThreadId}");
4545
Console.WriteLine($"SynchronizationContext: {_jsContext}");
4646

47-
_ = Runtime.InvokeJS("Interop.appendResult('Startup')");
47+
Runtime.InvokeJS("Interop.appendResult('Startup')");
4848

4949
Run();
5050

@@ -57,7 +57,7 @@ private static void OnTick(object state)
5757
if (_event.WaitOne(10) && _mainThreadInvoked)
5858
{
5959
var r = $"Done {_messages.Count} results (_mainThreadInvoked:{_mainThreadInvoked})";
60-
_ = Runtime.InvokeJS($"Interop.appendResult('{r}')");
60+
Runtime.InvokeJS($"Interop.appendResult('{r}')");
6161
Console.WriteLine($"[tid:{Thread.CurrentThread.ManagedThreadId}]: {r}");
6262
_timer.Dispose();
6363
}

0 commit comments

Comments
 (0)