Skip to content

Commit 594eee3

Browse files
Merge pull request #229 from TimeWarpEngineering/Cramer/2020-10-14/UpdateTypescriptProject
Update packages. And formatted all code
2 parents 4b6ab6f + b7659bf commit 594eee3

166 files changed

Lines changed: 6373 additions & 3318 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ indent_style = space
1414
tab_width = 4
1515

1616
# New line preferences
17-
end_of_line = crlf
17+
end_of_line = lf
1818
insert_final_newline = false
1919

2020
# Development files

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,5 @@ __pycache__/
298298
/source/AnyClone/
299299
/source/TypeSupport/
300300
/Source/BlazorState/wwwroot/blazorstate.js
301+
302+
/StatiqDocs/output

BlazorState.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp.EndToEnd.TestCafe.T
2727
EndProject
2828
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CFD8811F-C0A5-42E0-AF4D-29D3620CBA7D}"
2929
ProjectSection(SolutionItems) = preProject
30+
.editorconfig = .editorconfig
31+
.gitignore = .gitignore
3032
Build\BlazorStateMultiStage.yml = Build\BlazorStateMultiStage.yml
3133
Directory.Build.props = Directory.Build.props
3234
Build\documentation.yml = Build\documentation.yml

Build/BlazorStateMultiStage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ pr: none
55

66
variables:
77
Major: 3
8-
Minor: 2
9-
Patch: 4
10-
DotNetSdkVersion: 3.1.302
8+
Minor: 3
9+
Patch: 0
10+
DotNetSdkVersion: 3.1.402
1111

1212
stages:
1313
- stage: Test_Stage

Directory.Build.props

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@
3737
<SystemTextJsonVersion>4.7.2</SystemTextJsonVersion>
3838
<SystemConfigurationConfigurationManagerVersion>4.7.0</SystemConfigurationConfigurationManagerVersion>
3939

40-
<MicrosoftAspNetCoreVersion>3.1.6</MicrosoftAspNetCoreVersion>
41-
<MicrosoftAspNetCoreComponentsWebVersion>$(MicrosoftAspNetCoreVersion)</MicrosoftAspNetCoreComponentsWebVersion>
42-
<MicrosoftAspNetCoreMvcTestingVersion>$(MicrosoftAspNetCoreVersion)</MicrosoftAspNetCoreMvcTestingVersion>
43-
<MicrosoftAspNetCoreTestHostVersion>$(MicrosoftAspNetCoreVersion)</MicrosoftAspNetCoreTestHostVersion>
44-
<MicrosoftExtensionsFileProvidersEmbeddedVersion>$(MicrosoftAspNetCoreVersion)</MicrosoftExtensionsFileProvidersEmbeddedVersion>
45-
<MicrosoftExtensionsLoggingAbstractionsVersion>$(MicrosoftAspNetCoreVersion)</MicrosoftExtensionsLoggingAbstractionsVersion>
40+
<MicrosoftAspNetCoreComponentsWebVersion>3.1.9</MicrosoftAspNetCoreComponentsWebVersion>
41+
<MicrosoftAspNetCoreMvcTestingVersion>3.1.9</MicrosoftAspNetCoreMvcTestingVersion>
42+
<MicrosoftAspNetCoreTestHostVersion>3.1.9</MicrosoftAspNetCoreTestHostVersion>
43+
<MicrosoftExtensionsFileProvidersEmbeddedVersion>3.1.9</MicrosoftExtensionsFileProvidersEmbeddedVersion>
44+
<MicrosoftExtensionsLoggingAbstractionsVersion>3.1.9</MicrosoftExtensionsLoggingAbstractionsVersion>
4645

4746
<MicrosoftSourceLinkGitHubVersion>1.0.0</MicrosoftSourceLinkGitHubVersion>
4847

@@ -52,9 +51,9 @@
5251
<FixieVersion>2.2.1</FixieVersion>
5352
<FixieConsoleVersion>2.2.1</FixieConsoleVersion>
5453
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
55-
<MediatrExtensionsMicrosoftDependencyInjectionVersion>8.1.0</MediatrExtensionsMicrosoftDependencyInjectionVersion>
56-
<MediatrVersion>8.1.0</MediatrVersion>
57-
<ScrutorVersion>3.2.1</ScrutorVersion>
54+
<MediatrExtensionsMicrosoftDependencyInjectionVersion>9.0.0</MediatrExtensionsMicrosoftDependencyInjectionVersion>
55+
<MediatrVersion>9.0.0</MediatrVersion>
56+
<ScrutorVersion>3.2.2</ScrutorVersion>
5857
<SeleniumSupportVersion>3.141.0</SeleniumSupportVersion>
5958
<SeleniumWebDriverVersion>3.141.0</SeleniumWebDriverVersion>
6059
<ShouldlyVersion>3.0.2</ShouldlyVersion>

Source/BlazorState.Js/package-lock.json

Lines changed: 5461 additions & 2381 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/BlazorState.Js/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
},
1010
"devDependencies": {
1111
"@types/emscripten": "1.39.4",
12-
"ts-loader": "8.0.2",
13-
"typescript": "3.9.7",
14-
"webpack": "4.44.1",
15-
"webpack-cli": "3.3.12"
12+
"ts-loader": "8.0.5",
13+
"typescript": "4.0.3",
14+
"webpack": "5.1.0",
15+
"webpack-cli": "4.0.0"
1616
}
1717
}

Source/BlazorState/Base/Action.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
namespace BlazorState
1+
namespace BlazorState
22
{
33
using MediatR;
44

55
public interface IAction : IRequest { }
66

7-
}
7+
}
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
namespace BlazorState
2-
{
3-
using System.Threading;
4-
using System.Threading.Tasks;
5-
using MediatR;
6-
7-
public abstract class ActionHandler<TAction> : IRequestHandler<TAction>
8-
where TAction : IAction
9-
{
10-
public ActionHandler(IStore aStore)
11-
{
12-
Store = aStore;
13-
}
14-
15-
protected IStore Store { get; set; }
16-
17-
public abstract Task<Unit> Handle(TAction aAction, CancellationToken aCancellationToken);
18-
}
1+
namespace BlazorState
2+
{
3+
using MediatR;
4+
using System.Threading;
5+
using System.Threading.Tasks;
6+
7+
public abstract class ActionHandler<TAction> : IRequestHandler<TAction>
8+
where TAction : IAction
9+
{
10+
public ActionHandler(IStore aStore)
11+
{
12+
Store = aStore;
13+
}
14+
15+
protected IStore Store { get; set; }
16+
17+
public abstract Task<Unit> Handle(TAction aAction, CancellationToken aCancellationToken);
18+
}
1919
}
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
namespace BlazorState
2-
{
3-
using System;
4-
using System.Collections.Concurrent;
5-
using MediatR;
6-
using Microsoft.AspNetCore.Components;
7-
8-
/// <summary>
9-
/// A non required Base Class that injects Mediator and Store.
10-
/// And exposes StateHasChanged
11-
/// </summary>
12-
/// <remarks>Implements IBlazorStateComponent by Injecting</remarks>
13-
public class BlazorStateComponent : ComponentBase, IDisposable,
14-
IBlazorStateComponent
15-
{
16-
static readonly ConcurrentDictionary<string, int> s_InstanceCounts = new ConcurrentDictionary<string, int>();
17-
18-
public BlazorStateComponent()
19-
{
20-
string name = GetType().Name;
21-
int count = s_InstanceCounts.AddOrUpdate(name, 1, (aKey, aValue) => aValue + 1);
22-
23-
Id = $"{name}-{count}";
24-
}
25-
26-
/// <summary>
27-
/// A generated unique Id based on the Class name and number of times they have been created
28-
/// </summary>
29-
public string Id { get; }
30-
31-
/// <summary>
32-
/// Allows for the Assigning of a value one can use to select an element during automated testing.
33-
/// </summary>
34-
[Parameter] public string TestId { get; set; }
35-
36-
[Inject] public IMediator Mediator { get; set; }
37-
[Inject] public IStore Store { get; set; }
38-
39-
/// <summary>
40-
/// Maintains all components that subscribe to a State.
41-
/// Is updated by using the GetState method
42-
/// </summary>
43-
[Inject] public Subscriptions Subscriptions { get; set; }
44-
45-
/// <summary>
46-
/// Exposes StateHasChanged
47-
/// </summary>
48-
public void ReRender() => base.InvokeAsync(StateHasChanged);
49-
50-
/// <summary>
51-
/// Place a Subscription for the calling component
52-
/// And returns the requested state
53-
/// </summary>
54-
/// <typeparam name="T"></typeparam>
55-
/// <returns></returns>
56-
protected T GetState<T>()
57-
{
58-
Type stateType = typeof(T);
59-
Subscriptions.Add(stateType, this);
60-
return Store.GetState<T>();
61-
}
62-
63-
public void Dispose() => Subscriptions.Remove(this);
64-
}
1+
namespace BlazorState
2+
{
3+
using MediatR;
4+
using Microsoft.AspNetCore.Components;
5+
using System;
6+
using System.Collections.Concurrent;
7+
8+
/// <summary>
9+
/// A non required Base Class that injects Mediator and Store.
10+
/// And exposes StateHasChanged
11+
/// </summary>
12+
/// <remarks>Implements IBlazorStateComponent by Injecting</remarks>
13+
public class BlazorStateComponent : ComponentBase, IDisposable,
14+
IBlazorStateComponent
15+
{
16+
static readonly ConcurrentDictionary<string, int> s_InstanceCounts = new ConcurrentDictionary<string, int>();
17+
18+
public BlazorStateComponent()
19+
{
20+
string name = GetType().Name;
21+
int count = s_InstanceCounts.AddOrUpdate(name, 1, (aKey, aValue) => aValue + 1);
22+
23+
Id = $"{name}-{count}";
24+
}
25+
26+
/// <summary>
27+
/// A generated unique Id based on the Class name and number of times they have been created
28+
/// </summary>
29+
public string Id { get; }
30+
31+
/// <summary>
32+
/// Allows for the Assigning of a value one can use to select an element during automated testing.
33+
/// </summary>
34+
[Parameter] public string TestId { get; set; }
35+
36+
[Inject] public IMediator Mediator { get; set; }
37+
[Inject] public IStore Store { get; set; }
38+
39+
/// <summary>
40+
/// Maintains all components that subscribe to a State.
41+
/// Is updated by using the GetState method
42+
/// </summary>
43+
[Inject] public Subscriptions Subscriptions { get; set; }
44+
45+
/// <summary>
46+
/// Exposes StateHasChanged
47+
/// </summary>
48+
public void ReRender() => base.InvokeAsync(StateHasChanged);
49+
50+
/// <summary>
51+
/// Place a Subscription for the calling component
52+
/// And returns the requested state
53+
/// </summary>
54+
/// <typeparam name="T"></typeparam>
55+
/// <returns></returns>
56+
protected T GetState<T>()
57+
{
58+
Type stateType = typeof(T);
59+
Subscriptions.Add(stateType, this);
60+
return Store.GetState<T>();
61+
}
62+
63+
public void Dispose() => Subscriptions.Remove(this);
64+
}
6565
}

0 commit comments

Comments
 (0)