Skip to content

Commit

Permalink
Merge pull request #18644 from unoplatform/dev/cdb/hr-indicator-out
Browse files Browse the repository at this point in the history
Removed the Hot Reload Indicator from this project
  • Loading branch information
dr1rrb authored Nov 1, 2024
2 parents fe0c9cd + 70df9b0 commit 7d328cd
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 1,019 deletions.
2 changes: 1 addition & 1 deletion src/Uno.Foundation/Diagnostics/DiagnosticViewRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void Register(IDiagnosticView view, DiagnosticViewRegistrationMode

internal record DiagnosticViewRegistration(DiagnosticViewRegistrationMode Mode, IDiagnosticView View);

internal enum DiagnosticViewRegistrationMode
public enum DiagnosticViewRegistrationMode
{
/// <summary>
/// Diagnostic is being display on at least one window.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ public partial class ClientHotReloadProcessor
/// <summary>
/// Raised when the status of the hot-reload engine changes.
/// </summary>
internal EventHandler<Status>? StatusChanged;
public EventHandler<Status>? StatusChanged;

/// <summary>
/// The current status of the hot-reload engine.
/// </summary>
internal Status CurrentStatus => _status.Current;
public Status CurrentStatus => _status.Current;

private readonly StatusSink _status;

internal enum HotReloadSource
public enum HotReloadSource
{
Runtime,
DevServer,
Manual
}

internal enum HotReloadClientResult
public enum HotReloadClientResult
{
/// <summary>
/// Successful hot-reload.
Expand All @@ -63,17 +63,13 @@ internal enum HotReloadClientResult
/// <param name="State">The global state of the hot-reload engine (combining server and client state).</param>
/// <param name="Server">State and history of all hot-reload operations detected on the server.</param>
/// <param name="Local">State and history of all hot-reload operation received by this client.</param>
internal record Status(
public record Status(
HotReloadState State,
(HotReloadState State, IImmutableList<HotReloadServerOperationData> Operations) Server,
(HotReloadState State, IImmutableList<HotReloadClientOperation> Operations) Local);

private class StatusSink(ClientHotReloadProcessor owner)
{
#if HAS_UNO_WINUI
private readonly DiagnosticView<HotReloadStatusView, Status> _view = DiagnosticView.Register<HotReloadStatusView, Status>("Hot reload", ctx => new HotReloadStatusView(ctx), static (view, status) => view.OnHotReloadStatusChanged(status));
#endif

private HotReloadState? _serverState;
private bool _isFinalServerState;
private ImmutableDictionary<long, HotReloadServerOperationData> _serverOperations = ImmutableDictionary<long, HotReloadServerOperationData>.Empty;
Expand Down Expand Up @@ -142,9 +138,6 @@ private void NotifyStatusChanged()
var status = BuildStatus();

Current = status;
#if HAS_UNO_WINUI
_view.Update(status);
#endif
owner.StatusChanged?.Invoke(this, status);
}

Expand All @@ -163,22 +156,22 @@ private Status BuildStatus()
}
}

internal class HotReloadClientOperation
public class HotReloadClientOperation
{
#region Current
[ThreadStatic]
private static HotReloadClientOperation? _opForCurrentUiThread;

public static HotReloadClientOperation? GetForCurrentThread()
internal static HotReloadClientOperation? GetForCurrentThread()
=> _opForCurrentUiThread;

public void SetCurrent()
internal void SetCurrent()
{
Debug.Assert(_opForCurrentUiThread == null, "Only one operation should be active at once for a given UI thread.");
_opForCurrentUiThread = this;
}

public void ResignCurrent()
internal void ResignCurrent()
{
Debug.Assert(_opForCurrentUiThread == this, "Another operation has been started for teh current UI thread.");
_opForCurrentUiThread = null;
Expand Down Expand Up @@ -208,7 +201,7 @@ internal HotReloadClientOperation(HotReloadSource source, Type[] types, Action o

public Type[] Types { get; private set; }

internal string[] CuratedTypes => _curatedTypes ??= GetCuratedTypes();
public string[] CuratedTypes => _curatedTypes ??= GetCuratedTypes();

private string[] GetCuratedTypes()
{
Expand Down
215 changes: 0 additions & 215 deletions src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.Entries.cs

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7d328cd

Please sign in to comment.