diff --git a/Directory.Build.props b/Directory.Build.props index 9848fffe3..e196dbf71 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ Steven T. Cramer Blazor State - 11.0.0-beta.8+8.0.101 + 11.0.0-beta.9+8.0.101 https://timewarpengineering.github.io/blazor-state/ TimeWarp-State; TimeWarpState; BlazorState; Blazor; State; Blazor-State; MediatR; Mediator; Pipeline; Redux; Flux Logo.png diff --git a/Samples/01-StateActionsHandlers/Sample/Client/App.razor.cs b/Samples/01-StateActionsHandlers/Sample/Client/App.razor.cs index 3f91fda05..d5cbacf84 100644 --- a/Samples/01-StateActionsHandlers/Sample/Client/App.razor.cs +++ b/Samples/01-StateActionsHandlers/Sample/Client/App.razor.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using BlazorState.Pipeline.ReduxDevTools; -using BlazorState.Features.JavaScriptInterop; -using BlazorState.Features.Routing; +using TimeWarp.Features.JavaScriptInterop; +using TimeWarp.Features.Routing; using Microsoft.AspNetCore.Components; public partial class App : ComponentBase diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/Components/Counter.razor b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/Components/Counter.razor index 832f35f38..3b718bcfe 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/Components/Counter.razor +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/Components/Counter.razor @@ -1,4 +1,4 @@ -@using BlazorState.Features.Developer.Components +@using TimeWarp.Features.Developer.Components @inherits BlazorState.Pipeline.ReduxDevTools.BlazorStateDevToolsComponent

Counter

@RenderModeDisplay diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.LoadAction.cs b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.LoadAction.cs index 47427ceae..0fa8f984a 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.LoadAction.cs +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.LoadAction.cs @@ -1,8 +1,6 @@ namespace SampleDotNet8.Client.Features.Counter; -using BlazorState.Features.Persistence.Abstractions; -using BlazorState.Features.Persistence.Attributes; -using BlazorState.Services; +using TimeWarp.Features.Persistence.Abstractions; using System.Diagnostics.CodeAnalysis; public partial class CounterState diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.cs b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.cs index ce4522e96..39b255ee9 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.cs +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.cs @@ -1,6 +1,6 @@ namespace SampleDotNet8.Client.Features.Counter; -using BlazorState.Features.Persistence.Attributes; +using TimeWarp.Features.Persistence.Attributes; using System.Text.Json.Serialization; [PersistentState(PersistentStateMethod.LocalStorage)] diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.LoadAction.cs b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.LoadAction.cs index 1f2524e2b..b3bc72e24 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.LoadAction.cs +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.LoadAction.cs @@ -1,7 +1,7 @@ namespace SampleDotNet8.Client.Features.Counter2; -using BlazorState.Features.Persistence.Abstractions; -using BlazorState.Features.Persistence.Attributes; +using TimeWarp.Features.Persistence.Abstractions; +using TimeWarp.Features.Persistence.Attributes; using BlazorState.Services; using System.Diagnostics.CodeAnalysis; @@ -35,7 +35,7 @@ public override async Task Handle(Action aAction, CancellationToken aCancellatio } catch (Exception e) { - // if this is a JavaScript not avaailable exception then we are prerendering and just ignore it + // if this is a JavaScript not available exception then we are prerendering and just ignore it Console.WriteLine("**********************************"); Console.WriteLine(e); Console.WriteLine("**********************************"); diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.cs b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.cs index 00826ab8c..0a6257725 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.cs +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.cs @@ -1,6 +1,6 @@ namespace SampleDotNet8.Client.Features.Counter2; -using BlazorState.Features.Persistence.Attributes; +using TimeWarp.Features.Persistence.Attributes; using System.Text.Json.Serialization; [PersistentState(PersistentStateMethod.LocalStorage)] diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Pages/CounterPage.razor b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Pages/CounterPage.razor index a01f54308..bdf3aba60 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Pages/CounterPage.razor +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Pages/CounterPage.razor @@ -33,6 +33,6 @@ else } - - - + + + diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Program.cs b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Program.cs index 440a2d5e0..82cd501d2 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Program.cs +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Program.cs @@ -2,7 +2,7 @@ namespace SampleDotNet8.Client; using Blazored.LocalStorage; using TimeWarp.State.Plus.PersistentState; -using BlazorState.Features.Persistence.Abstractions; +using TimeWarp.Features.Persistence.Abstractions; public class Program { private static async Task Main(string[] args) diff --git a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8/Components/Pages/Weather.razor b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8/Components/Pages/Weather.razor index 1b854097e..ff8b514a1 100644 --- a/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8/Components/Pages/Weather.razor +++ b/Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8/Components/Pages/Weather.razor @@ -1,78 +1,78 @@ -@page "/weather" -@attribute [StreamRendering] - -Weather - -

Weather

- -

This component demonstrates showing data.

- -@if (System.OperatingSystem.IsBrowser()) -{ -

Render Mode: WebAssembly

-} -else -{ -

Render Mode: Server (Not Wasm)

-} - -@if (forecasts == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} - - - - - - -@code { - private WeatherForecast[]? forecasts; - - protected override async Task OnInitializedAsync() - { - // Simulate asynchronous loading to demonstrate streaming rendering - await Task.Delay(500); - - var startDate = DateOnly.FromDateTime(DateTime.Now); - var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; - forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = startDate.AddDays(index), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = summaries[Random.Shared.Next(summaries.Length)] - }).ToArray(); - } - - private class WeatherForecast - { - public DateOnly Date { get; set; } - public int TemperatureC { get; set; } - public string? Summary { get; set; } - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - } -} +@page "/weather" +@attribute [StreamRendering] + +Weather + +

Weather

+ +

This component demonstrates showing data.

+ +@if (System.OperatingSystem.IsBrowser()) +{ +

Render Mode: WebAssembly

+} +else +{ +

Render Mode: Server (Not Wasm)

+} + +@if (forecasts == null) +{ +

Loading...

+} +else +{ + + + + + + + + + + + @foreach (var forecast in forecasts) + { + + + + + + + } + +
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
+} + + + + + + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() + { + // Simulate asynchronous loading to demonstrate streaming rendering + await Task.Delay(500); + + var startDate = DateOnly.FromDateTime(DateTime.Now); + var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; + forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = startDate.AddDays(index), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = summaries[Random.Shared.Next(summaries.Length)] + }).ToArray(); + } + + private class WeatherForecast + { + public DateOnly Date { get; set; } + public int TemperatureC { get; set; } + public string? Summary { get; set; } + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + } +} diff --git a/Source/BlazorState/EventIds.cs b/Source/BlazorState/EventIds.cs index 8907f189f..ab8c34185 100644 --- a/Source/BlazorState/EventIds.cs +++ b/Source/BlazorState/EventIds.cs @@ -11,12 +11,12 @@ internal class EventIds public static readonly EventId JsonRequestOfInvalidType = new(203, nameof(JsonRequestOfInvalidType)); // Routing // Pipeline - Middleware - // CloneState - public static readonly EventId CloneStateBehavior_Initializing = new(400, nameof(CloneStateBehavior_Initializing)); - public static readonly EventId CloneStateBehavior_Cloning = new(401, nameof(CloneStateBehavior_Cloning)); - public static readonly EventId CloneStateBehavior_Ignoring = new(402, nameof(CloneStateBehavior_Ignoring)); - public static readonly EventId CloneStateBehavior_Exception = new(403, nameof(CloneStateBehavior_Exception)); - public static readonly EventId CloneStateBehavior_Restored = new(404, nameof(CloneStateBehavior_Restored)); + // StateTransaction + public static readonly EventId StateTransactionBehavior_Initializing = new(400, nameof(StateTransactionBehavior_Initializing)); + public static readonly EventId StateTransactionBehavior_Cloning = new(401, nameof(StateTransactionBehavior_Cloning)); + public static readonly EventId StateTransactionBehavior_Ignoring = new(402, nameof(StateTransactionBehavior_Ignoring)); + public static readonly EventId StateTransactionBehavior_Exception = new(403, nameof(StateTransactionBehavior_Exception)); + public static readonly EventId StateTransactionBehavior_Restored = new(404, nameof(StateTransactionBehavior_Restored)); // ReduxDevTools public static readonly EventId StartHandler_Initializing = new(500, nameof(StartHandler_Initializing)); diff --git a/Source/BlazorState/Extensions/BlazorStateOptions.cs b/Source/BlazorState/Extensions/BlazorStateOptions.cs index 6530325c2..13f475eda 100644 --- a/Source/BlazorState/Extensions/BlazorStateOptions.cs +++ b/Source/BlazorState/Extensions/BlazorStateOptions.cs @@ -7,7 +7,7 @@ public class BlazorStateOptions ///// public IEnumerable Assemblies { get; set; } - public bool UseCloneStateBehavior { get; set; } = true; + public bool UseStateTransactionBehavior { get; set; } = true; public bool UseRouting { get; set; } = true; diff --git a/Source/BlazorState/Extensions/ServiceCollectionExtensions.cs b/Source/BlazorState/Extensions/ServiceCollectionExtensions.cs index 12a312e94..669826978 100644 --- a/Source/BlazorState/Extensions/ServiceCollectionExtensions.cs +++ b/Source/BlazorState/Extensions/ServiceCollectionExtensions.cs @@ -38,9 +38,9 @@ public static IServiceCollection AddBlazorState EnsureStates(aServiceCollection, blazorStateOptions); EnsureMediator(aServiceCollection, blazorStateOptions); - if (blazorStateOptions.UseCloneStateBehavior) + if (blazorStateOptions.UseStateTransactionBehavior) { - aServiceCollection.AddScoped(typeof(IPipelineBehavior<,>), typeof(CloneStateBehavior<,>)); + aServiceCollection.AddScoped(typeof(IPipelineBehavior<,>), typeof(StateTransactionBehavior<,>)); } if (blazorStateOptions.UseRouting) @@ -59,8 +59,8 @@ private static void EnsureHttpClient(IServiceCollection aServiceCollection) { var blazorHostingLocation = new BlazorHostingLocation(); - // Test.App.Server Side Blazor doesn't register HttpClient by default - if (!blazorHostingLocation.IsServerSide) return; + // Test.App.Client Side Blazor registers HttpClient by default + if (blazorHostingLocation.IsClientSide) return; // Double check that nothing is registered. if (aServiceCollection.HasRegistrationFor(typeof(HttpClient))) return; diff --git a/Source/BlazorState/Pipeline/CloneState/CloneStateBehavior.cs b/Source/BlazorState/Features/CloneState/Pipeline/StateTransactionBehavior.cs similarity index 52% rename from Source/BlazorState/Pipeline/CloneState/CloneStateBehavior.cs rename to Source/BlazorState/Features/CloneState/Pipeline/StateTransactionBehavior.cs index 7f2b12980..930a06991 100644 --- a/Source/BlazorState/Pipeline/CloneState/CloneStateBehavior.cs +++ b/Source/BlazorState/Features/CloneState/Pipeline/StateTransactionBehavior.cs @@ -1,22 +1,37 @@ #nullable enable -namespace BlazorState.Pipeline.State; +namespace TimeWarp.Features.StateTransaction; -internal sealed class CloneStateBehavior : IPipelineBehavior +/// +/// Represents a pipeline behavior in BlazorState that clones the current state before processing a request. +/// This behavior ensures that the state can be reverted to its original form in case of an error during the request handling. +/// The cloning process is contingent upon the state implementing , allowing for a deep copy. +/// If the state does not implement , it falls back to a custom clone method. This behavior is +/// critical for maintaining application consistency and enables undo functionality. +/// +/// +/// This behavior is part of the BlazorState pipeline, intercepting actions (requests) to clone the relevant state before +/// proceeding. If an action fails, the system reverts to the cloned state, thus preventing partial state updates +/// from corrupting the application state. It uses MediatR's pipeline behavior feature to hook into the request handling +/// process. +/// +/// +/// +public sealed class StateTransactionBehavior : IPipelineBehavior where TRequest : notnull, IAction { private readonly ILogger Logger; private readonly IPublisher Publisher; private readonly IStore Store; - public CloneStateBehavior + public StateTransactionBehavior ( - ILogger> logger, + ILogger> logger, IStore store, IPublisher publisher ) { Logger = logger; - Logger.LogDebug(EventIds.CloneStateBehavior_Initializing, "constructing"); + Logger.LogDebug(EventIds.StateTransactionBehavior_Initializing, "constructing"); Store = store; Publisher = publisher; } @@ -43,7 +58,7 @@ CancellationToken aCancellationToken Logger.LogDebug ( - EventIds.CloneStateBehavior_Cloning, + EventIds.StateTransactionBehavior_Cloning, "Clone State of type {declaringType} originalState.Guid:{originalState_Guid} newState.Guid:{newState_Guid}", enclosingStateType, originalState.Guid, @@ -60,20 +75,20 @@ CancellationToken aCancellationToken catch (Exception exception) { // If something fails we restore system to previous state. - Logger.LogWarning(EventIds.CloneStateBehavior_Exception, exception, "Error cloning State"); + Logger.LogWarning(EventIds.StateTransactionBehavior_Exception, exception, "Error cloning State"); Store.SetState(originalState); Logger.LogWarning ( - EventIds.CloneStateBehavior_Restored, + EventIds.StateTransactionBehavior_Restored, "Restored State of type: {enclosingStateType}", enclosingStateType ); var exceptionNotification = new ExceptionNotification { - RequestName = nameof(CloneStateBehavior), + RequestName = nameof(StateTransactionBehavior), Exception = exception }; diff --git a/Source/BlazorState/Features/Developer/Components/ReduxDevTools.razor b/Source/BlazorState/Features/Developer/Components/ReduxDevTools.razor index 542ec7334..f82457774 100644 --- a/Source/BlazorState/Features/Developer/Components/ReduxDevTools.razor +++ b/Source/BlazorState/Features/Developer/Components/ReduxDevTools.razor @@ -1,4 +1,5 @@ -@code { +@namespace TimeWarp.Features.Developer +@code { [Inject] private ReduxDevToolsInterop ReduxDevToolsInterop { get; set; } diff --git a/Source/BlazorState/Features/Developer/Components/RenderModeDisplay.razor b/Source/BlazorState/Features/Developer/Components/RenderModeDisplay.razor index 33e524058..f08903eb7 100644 --- a/Source/BlazorState/Features/Developer/Components/RenderModeDisplay.razor +++ b/Source/BlazorState/Features/Developer/Components/RenderModeDisplay.razor @@ -1,3 +1,4 @@ +@namespace TimeWarp.Features.Developer
Current Render Mode: @CurrentRenderMode
Configured Render Mode: @ConfiguredRenderMode
diff --git a/Source/BlazorState/Features/JavaScriptInterop/Components/TimeWarpJavaScriptInterop.razor b/Source/BlazorState/Features/JavaScriptInterop/Components/TimeWarpJavaScriptInterop.razor index 250bfd0ec..51c967038 100644 --- a/Source/BlazorState/Features/JavaScriptInterop/Components/TimeWarpJavaScriptInterop.razor +++ b/Source/BlazorState/Features/JavaScriptInterop/Components/TimeWarpJavaScriptInterop.razor @@ -1,5 +1,4 @@ - -@using BlazorState.Features.JavaScriptInterop; +@namespace TimeWarp.Features.JavaScriptInterop @code { diff --git a/Source/BlazorState/Features/JavaScriptInterop/InvalidRequestTypeException.cs b/Source/BlazorState/Features/JavaScriptInterop/InvalidRequestTypeException.cs index 9b1dfb559..3399155af 100644 --- a/Source/BlazorState/Features/JavaScriptInterop/InvalidRequestTypeException.cs +++ b/Source/BlazorState/Features/JavaScriptInterop/InvalidRequestTypeException.cs @@ -1,6 +1,6 @@ #nullable enable -namespace BlazorState.Features.JavaScriptInterop; +namespace TimeWarp.Features.JavaScriptInterop; [Serializable] public class InvalidRequestTypeException : Exception diff --git a/Source/BlazorState/Features/JavaScriptInterop/JsonRequest.cs b/Source/BlazorState/Features/JavaScriptInterop/JsonRequest.cs index 11b243834..b2e0b83e9 100644 --- a/Source/BlazorState/Features/JavaScriptInterop/JsonRequest.cs +++ b/Source/BlazorState/Features/JavaScriptInterop/JsonRequest.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.JavaScriptInterop; +namespace TimeWarp.Features.JavaScriptInterop; public class BaseJsonRequest { diff --git a/Source/BlazorState/Features/JavaScriptInterop/JsonRequestHandler.cs b/Source/BlazorState/Features/JavaScriptInterop/JsonRequestHandler.cs index e133fd226..4b5cdb512 100644 --- a/Source/BlazorState/Features/JavaScriptInterop/JsonRequestHandler.cs +++ b/Source/BlazorState/Features/JavaScriptInterop/JsonRequestHandler.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.JavaScriptInterop; +namespace TimeWarp.Features.JavaScriptInterop; public class JsonRequestHandler { diff --git a/Source/BlazorState/Features/Persistence/Abstractions/IPersistenceService.cs b/Source/BlazorState/Features/Persistence/Abstractions/IPersistenceService.cs index 758932b0d..7b80183c6 100644 --- a/Source/BlazorState/Features/Persistence/Abstractions/IPersistenceService.cs +++ b/Source/BlazorState/Features/Persistence/Abstractions/IPersistenceService.cs @@ -1,5 +1,5 @@ #nullable enable -namespace BlazorState.Features.Persistence.Abstractions; +namespace TimeWarp.Features.Persistence.Abstractions; public interface IPersistenceService { diff --git a/Source/BlazorState/Features/Persistence/Attributes/PersistentStateAttribute.cs b/Source/BlazorState/Features/Persistence/Attributes/PersistentStateAttribute.cs index 27ff1b159..8676f569f 100644 --- a/Source/BlazorState/Features/Persistence/Attributes/PersistentStateAttribute.cs +++ b/Source/BlazorState/Features/Persistence/Attributes/PersistentStateAttribute.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Persistence.Attributes; +namespace TimeWarp.Features.Persistence.Attributes; [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class PersistentStateAttribute ( diff --git a/Source/BlazorState/Features/Persistence/PersistentStateMethod.cs b/Source/BlazorState/Features/Persistence/PersistentStateMethod.cs index b3a38cde9..81972e12c 100644 --- a/Source/BlazorState/Features/Persistence/PersistentStateMethod.cs +++ b/Source/BlazorState/Features/Persistence/PersistentStateMethod.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Persistence; +namespace TimeWarp.Features.Persistence; public enum PersistentStateMethod { diff --git a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/ChangeRouteHandler.cs b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/ChangeRouteHandler.cs index 184dde622..b36d40fae 100644 --- a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/ChangeRouteHandler.cs +++ b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/ChangeRouteHandler.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { diff --git a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackAction.cs b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackAction.cs index 6bdc5e96e..58a4e1ef5 100644 --- a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackAction.cs +++ b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackAction.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { diff --git a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackHandler.cs b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackHandler.cs index b8db5e210..3ab9d670b 100644 --- a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackHandler.cs +++ b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/GoBackHandler.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { diff --git a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/RouteState.ChangeRoute.cs b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/RouteState.ChangeRoute.cs index f9a21587e..2ee8258c3 100644 --- a/Source/BlazorState/Features/Routing/Actions/ChangeRoute/RouteState.ChangeRoute.cs +++ b/Source/BlazorState/Features/Routing/Actions/ChangeRoute/RouteState.ChangeRoute.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { diff --git a/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteAction.cs b/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteAction.cs index fc7806f5f..b09419b8c 100644 --- a/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteAction.cs +++ b/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteAction.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { diff --git a/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteHandler.cs b/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteHandler.cs index 0e49d56f8..0d23fde65 100644 --- a/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteHandler.cs +++ b/Source/BlazorState/Features/Routing/Actions/InitializeRoute/InitializeRouteHandler.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { internal class InitializeRouteHandler diff --git a/Source/BlazorState/Features/Routing/Components/TimeWarpNavigation.razor b/Source/BlazorState/Features/Routing/Components/TimeWarpNavigation.razor index d24e35edf..0e919ca42 100644 --- a/Source/BlazorState/Features/Routing/Components/TimeWarpNavigation.razor +++ b/Source/BlazorState/Features/Routing/Components/TimeWarpNavigation.razor @@ -1,3 +1,4 @@ -@code { +@namespace TimeWarp.Features.Routing +@code { [Inject] private TimeWarpNavigationManager TimeWarpNavigationManager { get; set; } } diff --git a/Source/BlazorState/Features/Routing/State/RouteState.Debug.cs b/Source/BlazorState/Features/Routing/State/RouteState.Debug.cs index 1d362e126..8965d1ed3 100644 --- a/Source/BlazorState/Features/Routing/State/RouteState.Debug.cs +++ b/Source/BlazorState/Features/Routing/State/RouteState.Debug.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; public partial class RouteState { diff --git a/Source/BlazorState/Features/Routing/State/RouteState.cs b/Source/BlazorState/Features/Routing/State/RouteState.cs index a870ee046..ac36c6f50 100644 --- a/Source/BlazorState/Features/Routing/State/RouteState.cs +++ b/Source/BlazorState/Features/Routing/State/RouteState.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; /// /// Maintain the Route in Blazor-State diff --git a/Source/BlazorState/Features/Routing/TimeWarpNavigationManager.cs b/Source/BlazorState/Features/Routing/TimeWarpNavigationManager.cs index f88c646b2..7b33d6a6e 100644 --- a/Source/BlazorState/Features/Routing/TimeWarpNavigationManager.cs +++ b/Source/BlazorState/Features/Routing/TimeWarpNavigationManager.cs @@ -1,4 +1,4 @@ -namespace BlazorState.Features.Routing; +namespace TimeWarp.Features.Routing; /// /// When constructed will attach a OnLocationChanged Handler diff --git a/Source/BlazorState/GlobalSuppressions.cs b/Source/BlazorState/GlobalSuppressions.cs index 2ae7e17cf..3a9d92366 100644 --- a/Source/BlazorState/GlobalSuppressions.cs +++ b/Source/BlazorState/GlobalSuppressions.cs @@ -1,4 +1,4 @@ -[assembly: SuppressMessage("Style", "IDE0007:Use implicit type", Justification = "", Scope = "member", Target = "~M:BlazorState.Pipeline.State.CloneStateBehavior`2.Handle(`0,MediatR.RequestHandlerDelegate{`1},System.Threading.CancellationToken)~System.Threading.Tasks.Task{`1}")] +[assembly: SuppressMessage("Style", "IDE0007:Use implicit type", Justification = "", Scope = "member", Target = "~M:BlazorState.Pipeline.State.StateTransactionBehavior`2.Handle(`0,MediatR.RequestHandlerDelegate{`1},System.Threading.CancellationToken)~System.Threading.Tasks.Task{`1}")] // This file is used by Code Analysis to maintain SuppressMessage // attributes that are applied to this project. // Project-level suppressions either have no target or are given diff --git a/Source/BlazorState/GlobalUsings.cs b/Source/BlazorState/GlobalUsings.cs index 95cc963b2..b3fce64bd 100644 --- a/Source/BlazorState/GlobalUsings.cs +++ b/Source/BlazorState/GlobalUsings.cs @@ -1,35 +1,36 @@ global using AnyClone; global using BlazorState.Extensions; -global using BlazorState.Features.JavaScriptInterop; -global using BlazorState.Features.Persistence.Attributes; -global using BlazorState.Features.Routing; +global using BlazorState.Pipeline.CloneState; global using BlazorState.Pipeline.ReduxDevTools; global using BlazorState.Pipeline.RenderSubscriptions; global using BlazorState.Pipeline.State; global using BlazorState.Services; global using BlazorState; -global using BlazorState.Features.Developer.Components; -global using BlazorState.Pipeline.CloneState; global using JetBrains.Annotations; global using MediatR.Pipeline; global using MediatR; +global using Microsoft.AspNetCore.Components.Forms; global using Microsoft.AspNetCore.Components.Routing; global using Microsoft.AspNetCore.Components; -global using Microsoft.AspNetCore.Components.Forms; global using Microsoft.Extensions.DependencyInjection.Extensions; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Logging.Abstractions; global using Microsoft.Extensions.Logging; global using Microsoft.JSInterop; -global using System; global using System.Collections.Concurrent; -global using static Microsoft.AspNetCore.Components.Web.RenderMode; global using System.Collections.Generic; -global using System.Diagnostics; global using System.Diagnostics.CodeAnalysis; +global using System.Diagnostics; global using System.Linq; global using System.Reflection; global using System.Runtime.Serialization; global using System.Text.Json; global using System.Text.RegularExpressions; global using System.Text; +global using System; +global using TimeWarp.Features.StateTransaction; +global using TimeWarp.Features.Developer; +global using TimeWarp.Features.JavaScriptInterop; +global using TimeWarp.Features.Persistence.Attributes; +global using TimeWarp.Features.Routing; +global using static Microsoft.AspNetCore.Components.Web.RenderMode; diff --git a/Source/BlazorState/Pipeline/ReduxDevTools/Components/BlazorStateDevToolsComponent.cs b/Source/BlazorState/Pipeline/ReduxDevTools/Components/BlazorStateDevToolsComponent.cs index 26f1beea7..923226802 100644 --- a/Source/BlazorState/Pipeline/ReduxDevTools/Components/BlazorStateDevToolsComponent.cs +++ b/Source/BlazorState/Pipeline/ReduxDevTools/Components/BlazorStateDevToolsComponent.cs @@ -25,8 +25,8 @@ protected BlazorStateDevToolsComponent() RenderModeDisplay = builder => { builder.OpenComponent(0); - builder.AddComponentParameter(0, nameof(BlazorState.Features.Developer.Components.RenderModeDisplay.CurrentRenderMode), CurrentRenderMode); - builder.AddComponentParameter(0, nameof(BlazorState.Features.Developer.Components.RenderModeDisplay.ConfiguredRenderMode), ConfiguredRenderMode); + builder.AddComponentParameter(0, nameof(TimeWarp.Features.Developer.RenderModeDisplay.CurrentRenderMode), CurrentRenderMode); + builder.AddComponentParameter(0, nameof(TimeWarp.Features.Developer.RenderModeDisplay.ConfiguredRenderMode), ConfiguredRenderMode); builder.CloseComponent(); }; } diff --git a/Source/TimeWarp.State.Plus/GlobalUsings.cs b/Source/TimeWarp.State.Plus/GlobalUsings.cs index da642c8ca..ce8f46291 100644 --- a/Source/TimeWarp.State.Plus/GlobalUsings.cs +++ b/Source/TimeWarp.State.Plus/GlobalUsings.cs @@ -1,9 +1,9 @@ global using Blazored.LocalStorage; global using Blazored.SessionStorage; global using BlazorState; -global using BlazorState.Features.Persistence; -global using BlazorState.Features.Persistence.Abstractions; -global using BlazorState.Features.Persistence.Attributes; +global using TimeWarp.Features.Persistence; +global using TimeWarp.Features.Persistence.Abstractions; +global using TimeWarp.Features.Persistence.Attributes; global using JetBrains.Annotations; global using MediatR; global using MediatR.Pipeline; diff --git a/Tests/Test.App/Test.App.Client/Features/CloneTest/Pages/ClonablePage.razor b/Tests/Test.App/Test.App.Client/Features/CloneTest/Pages/ClonablePage.razor index 5a8ff75e4..042d93119 100644 --- a/Tests/Test.App/Test.App.Client/Features/CloneTest/Pages/ClonablePage.razor +++ b/Tests/Test.App/Test.App.Client/Features/CloneTest/Pages/ClonablePage.razor @@ -8,7 +8,7 @@

- The CloneStateBehavior middleware in Blazor-State is designed to use ICloneable if it is implemented and Anyclone otherwise..
+ The StateTransactionBehavior middleware in Blazor-State is designed to use ICloneable if it is implemented and Anyclone otherwise..
This test is to verify that the IClonable interface is working as expected.
The clone method intentionally creates a new instance where the count is always 42.
And the Increment method increments the count by 1.
diff --git a/Tests/Test.App/Test.App.Client/GlobalUsings.cs b/Tests/Test.App/Test.App.Client/GlobalUsings.cs index cbde62b40..90cb3d262 100644 --- a/Tests/Test.App/Test.App.Client/GlobalUsings.cs +++ b/Tests/Test.App/Test.App.Client/GlobalUsings.cs @@ -3,10 +3,10 @@ global using Blazored.LocalStorage; global using Blazored.SessionStorage; global using BlazorState; -global using BlazorState.Features.Persistence; -global using BlazorState.Features.Persistence.Abstractions; -global using BlazorState.Features.Persistence.Attributes; -global using BlazorState.Features.Routing; +global using TimeWarp.Features.Persistence; +global using TimeWarp.Features.Persistence.Abstractions; +global using TimeWarp.Features.Persistence.Attributes; +global using TimeWarp.Features.Routing; global using BlazorState.Pipeline.ReduxDevTools; global using FluentAssertions; global using JetBrains.Annotations; diff --git a/Tests/Test.App/Test.App.Server/Components/Routes.razor b/Tests/Test.App/Test.App.Server/Components/Routes.razor index 901bc7a4b..258f348f5 100644 --- a/Tests/Test.App/Test.App.Server/Components/Routes.razor +++ b/Tests/Test.App/Test.App.Server/Components/Routes.razor @@ -1,6 +1,6 @@ -@using BlazorState.Features.Developer.Components -@using BlazorState.Features.JavaScriptInterop.Components -@using BlazorState.Features.Routing.Components +@using TimeWarp.Features.Developer +@using TimeWarp.Features.JavaScriptInterop +@using TimeWarp.Features.Routing diff --git a/Tests/Test.App/Test.App.Server/Components/_Imports.razor b/Tests/Test.App/Test.App.Server/Components/_Imports.razor index 8436d48f4..13088c9b0 100644 --- a/Tests/Test.App/Test.App.Server/Components/_Imports.razor +++ b/Tests/Test.App/Test.App.Server/Components/_Imports.razor @@ -7,7 +7,7 @@ @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.JSInterop @using BlazorState -@using BlazorState.Features.Routing +@using TimeWarp.Features.Routing @using Test.App @using Test.App.Client