Skip to content

Commit 948d84d

Browse files
committed
Preview8 support
1 parent 9963c20 commit 948d84d

File tree

7 files changed

+105
-105
lines changed

7 files changed

+105
-105
lines changed

.vsts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77
- task: DotNetCoreInstaller@0
88
inputs:
99
packageType: 'sdk'
10-
version: 3.0.100-preview7-012821
10+
version: 3.0.100-preview8-013656
1111

1212
- task: Npm@1
1313
displayName: 'Install NPM dependencies'

.vsts-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77
- task: DotNetCoreInstaller@0
88
inputs:
99
packageType: 'sdk'
10-
version: 3.0.100-preview7-012821
10+
version: 3.0.100-preview8-013656
1111

1212
- task: Npm@1
1313
displayName: 'Install NPM dependencies'

src/Blazor.Extensions.Storage/Blazor.Extensions.Storage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview7.19365.7" />
18+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0-preview8.19405.7" />
1919
</ItemGroup>
2020

2121
<ItemGroup>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<!--
2-
Configuring this here is temporary. Later we'll move the app config
3-
into Program.cs, and it won't be necessary to specify AppAssembly.
4-
-->
5-
<Router AppAssembly=typeof(Program).Assembly />
1+
<!--
2+
Configuring this here is temporary. Later we'll move the app config
3+
into Program.cs, and it won't be necessary to specify AppAssembly.
4+
-->
5+
<Router AppAssembly="typeof(Program).Assembly" />

test/Blazor.Extensions.Storage.Test/Blazor.Extensions.Storage.Test.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview7.19365.7" />
11-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview7.19365.7" PrivateAssets="all" />
12-
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview7.19365.7" PrivateAssets="all" />
10+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview8.19405.7" />
11+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
12+
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
13+
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview8.19405.7" />
1314
</ItemGroup>
1415

1516
<ItemGroup>
Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
1-
@page "/"
2-
@inject SessionStorage SessionStorage
3-
@inject LocalStorage LocalStorage
4-
@inject HttpClient Http
5-
@inject InteropStorage InteropStorage
6-
@inject IJSRuntime JSRuntime
7-
@using Blazor.Extensions.Storage.Test.Interop
8-
9-
<h1>Test logging output: (See debugger log for full output)</h1>
10-
11-
<div>
12-
@foreach (var message in log)
13-
{
14-
<div>@message</div>
15-
}
16-
</div>
17-
18-
@functions {
19-
private WeatherForecast[] forecasts;
20-
21-
private List<string> log = new List<string>();
22-
23-
private async void LogInformation(object message)
24-
{
25-
log.Add(message.ToString());
26-
var _ = await JSRuntime.InvokeAsync<object>("console.info", message);
27-
}
28-
29-
private async void LogError(object message)
30-
{
31-
log.Add($"ERROR: {message.ToString()}");
32-
var _ = await JSRuntime.InvokeAsync<object>("console.error", message);
33-
}
34-
35-
protected override async Task OnInitAsync()
36-
{
37-
forecasts = (await Http.GetJsonAsync<WeatherForecast[]>("weather.json"));
38-
var key = "forecasts";
39-
try
40-
{
41-
await SessionStorage.SetItem<WeatherForecast[]>(key, forecasts);
42-
await LocalStorage.SetItem<WeatherForecast[]>(key, forecasts);
43-
44-
var fromIopSession = await InteropStorage.GetSessionStorage(key);
45-
var fromIopLocal = await InteropStorage.GetLocalStorage(key);
46-
47-
var iopSessionHasQuotes = fromIopSession.StartsWith("\"") || fromIopSession.EndsWith("\"");
48-
var iopLocalHasQuotes = fromIopLocal.StartsWith("\"") || fromIopLocal.EndsWith("\"");
49-
50-
LogInformation($"Interop get from session storage contains extra quotes: {iopSessionHasQuotes}");
51-
LogInformation(fromIopSession);
52-
LogInformation($"Interop get from local storage contains extra quotes: {iopLocalHasQuotes}");
53-
LogInformation(fromIopLocal);
54-
55-
var fromSession = await SessionStorage.GetItem<WeatherForecast[]>(key);
56-
var fromLocal = await LocalStorage.GetItem<WeatherForecast[]>(key);
57-
58-
LogInformation("From session storage:");
59-
LogInformation(fromSession);
60-
LogInformation("From local storage:");
61-
LogInformation(fromLocal);
62-
63-
LogInformation($"Total in session: {await SessionStorage.Length()}");
64-
LogInformation($"Total in local: {await LocalStorage.Length()}");
65-
66-
LogInformation("Removing from session storage...");
67-
await SessionStorage.RemoveItem(key);
68-
LogInformation("Removing from local storage...");
69-
await LocalStorage.RemoveItem(key);
70-
71-
LogInformation($"Total in session: {await SessionStorage.Length()}");
72-
LogInformation($"Total in local: {await SessionStorage.Length()}");
73-
}
74-
catch (Exception ex)
75-
{
76-
LogError(ex);
77-
}
78-
}
79-
80-
class WeatherForecast
81-
{
82-
public DateTime Date { get; set; }
83-
public int TemperatureC { get; set; }
84-
public int TemperatureF { get; set; }
85-
public string Summary { get; set; }
86-
}
87-
}
1+
@page "/"
2+
@inject SessionStorage SessionStorage
3+
@inject LocalStorage LocalStorage
4+
@inject HttpClient Http
5+
@inject InteropStorage InteropStorage
6+
@inject IJSRuntime JSRuntime
7+
@using Blazor.Extensions.Storage.Test.Interop
8+
9+
<h1>Test logging output: (See debugger log for full output)</h1>
10+
11+
<div>
12+
@foreach (var message in log)
13+
{
14+
<div>@message</div>
15+
}
16+
</div>
17+
18+
@functions {
19+
private WeatherForecast[] forecasts;
20+
21+
private List<string> log = new List<string>();
22+
23+
private async void LogInformation(object message)
24+
{
25+
log.Add(message.ToString());
26+
var _ = await JSRuntime.InvokeAsync<object>("console.info", message);
27+
}
28+
29+
private async void LogError(object message)
30+
{
31+
log.Add($"ERROR: {message.ToString()}");
32+
var _ = await JSRuntime.InvokeAsync<object>("console.error", message);
33+
}
34+
35+
protected override async Task OnInitializedAsync()
36+
{
37+
forecasts = (await Http.GetJsonAsync<WeatherForecast[]>("weather.json"));
38+
var key = "forecasts";
39+
try
40+
{
41+
await SessionStorage.SetItem<WeatherForecast[]>(key, forecasts);
42+
await LocalStorage.SetItem<WeatherForecast[]>(key, forecasts);
43+
44+
var fromIopSession = await InteropStorage.GetSessionStorage(key);
45+
var fromIopLocal = await InteropStorage.GetLocalStorage(key);
46+
47+
var iopSessionHasQuotes = fromIopSession.StartsWith("\"") || fromIopSession.EndsWith("\"");
48+
var iopLocalHasQuotes = fromIopLocal.StartsWith("\"") || fromIopLocal.EndsWith("\"");
49+
50+
LogInformation($"Interop get from session storage contains extra quotes: {iopSessionHasQuotes}");
51+
LogInformation(fromIopSession);
52+
LogInformation($"Interop get from local storage contains extra quotes: {iopLocalHasQuotes}");
53+
LogInformation(fromIopLocal);
54+
55+
var fromSession = await SessionStorage.GetItem<WeatherForecast[]>(key);
56+
var fromLocal = await LocalStorage.GetItem<WeatherForecast[]>(key);
57+
58+
LogInformation("From session storage:");
59+
LogInformation(fromSession);
60+
LogInformation("From local storage:");
61+
LogInformation(fromLocal);
62+
63+
LogInformation($"Total in session: {await SessionStorage.Length()}");
64+
LogInformation($"Total in local: {await LocalStorage.Length()}");
65+
66+
LogInformation("Removing from session storage...");
67+
await SessionStorage.RemoveItem(key);
68+
LogInformation("Removing from local storage...");
69+
await LocalStorage.RemoveItem(key);
70+
71+
LogInformation($"Total in session: {await SessionStorage.Length()}");
72+
LogInformation($"Total in local: {await SessionStorage.Length()}");
73+
}
74+
catch (Exception ex)
75+
{
76+
LogError(ex);
77+
}
78+
}
79+
80+
class WeatherForecast
81+
{
82+
public DateTime Date { get; set; }
83+
public int TemperatureC { get; set; }
84+
public int TemperatureF { get; set; }
85+
public string Summary { get; set; }
86+
}
87+
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
@using System.Net.Http
2-
@using Microsoft.AspNetCore.Components.Layouts
3-
@using Microsoft.AspNetCore.Components.Routing
4-
@using Microsoft.JSInterop
5-
@using Blazor.Extensions.Storage
6-
@using Blazor.Extensions.Storage.Test
7-
@using Blazor.Extensions.Storage.Test.Shared
1+
@using System.Net.Http
2+
@using Microsoft.AspNetCore.Components.Routing
3+
@using Microsoft.JSInterop
4+
@using Blazor.Extensions.Storage
5+
@using Blazor.Extensions.Storage.Test
6+
@using Blazor.Extensions.Storage.Test.Shared

0 commit comments

Comments
 (0)