Skip to content

Commit

Permalink
Merge pull request #14046 from unoplatform/dev/jela/hr-wasm
Browse files Browse the repository at this point in the history
fix: Adjust HR for wasm
  • Loading branch information
jeromelaban authored Oct 21, 2023
2 parents 0c1ece4 + 2cab131 commit 553cbd9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class RemoteControlGenerator : ISourceGenerator
"DefineExplicitDefaults",
"Platform",
"RuntimeIdentifier",
"UnoRuntimeIdentifier",
"SolutionPath",
"SolutionName",
"VSIDEResolvedNonMSBuildProjectOutputs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private async Task<bool> ProcessSolutionChanged(CancellationToken cancellationTo
}
else
{
Console.WriteLine($"Got {diagnostics.Length} errors");
_reporter.Output($"Got {diagnostics.Length} errors");
}

// HotReloadEventSource.Log.HotReloadEnd(HotReloadEventSource.StartType.CompilationHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ private void InitializePartialReload()
|| targetFramework.Contains("-ios")
|| (unoRuntimeIdentifier?.Equals("WebAssembly", StringComparison.OrdinalIgnoreCase) ?? false));

if (this.Log().IsEnabled(LogLevel.Trace))
{
this.Log().Trace($"Partial Hot Reload: Enabled:{_supportsLightweightHotReload} unoRuntimeIdentifier:{unoRuntimeIdentifier} targetFramework:{targetFramework} buildingInsideVisualStudio:{targetFramework}");
}

_mappedTypes = _supportsLightweightHotReload
? BuildMappedTypes()
: new();
Expand Down Expand Up @@ -117,7 +122,13 @@ private async Task ObserveUpdateTypeMapping()
{
// Arbitrary delay to wait for VS to push updates to the app
// so we can discover which types have changed
// The scanning operation can take 500ms under wasm, keep the app
// running for longer to ensure we don't miss any updates
#if __WASM__
await Task.Delay(1000);
#else
await Task.Delay(250);
#endif

var mappedSw = Stopwatch.StartNew();

Expand Down

0 comments on commit 553cbd9

Please sign in to comment.