Skip to content

Commit

Permalink
Feature/v4 stabilisation (#93)
Browse files Browse the repository at this point in the history
* IJSRuntime Extension functional

* Removed useless dotnet config. Added configurable tracing output

* Remove commented code from ServiceCollectionHelper example

* Cleanup warning exceptions
  • Loading branch information
Tewr authored Jan 7, 2024
1 parent f37e8a0 commit 4ca0a74
Show file tree
Hide file tree
Showing 42 changed files with 492 additions and 387 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
<Configurations>Debug;Release;Nuget</Configurations>
</PropertyGroup>

<PropertyGroup>
<NoWarn>1701;1702;1591;CA1416</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<ProjectReference Include="..\BlazorWorker.Extensions.JSRuntime\BlazorWorker.Extensions.JSRuntime.csproj" />
<ProjectReference Include="..\BlazorWorker.WorkerCore\BlazorWorker.WorkerCore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="TG.Blazor.IndexedDB" Version="1.5.0-preview" />
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.JSInterop" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorWorker.Extensions.JSRuntime\BlazorWorker.Extensions.JSRuntime.csproj" />
<ProjectReference Include="..\BlazorWorker.WorkerCore\BlazorWorker.WorkerCore.csproj" />
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.JSInterop" Version="7.0.14" />
</ItemGroup>


</Project>
66 changes: 0 additions & 66 deletions src/BlazorWorker.Demo.IoCExample/MyIndexDBService.cs

This file was deleted.

36 changes: 0 additions & 36 deletions src/BlazorWorker.Demo.IoCExample/MyIndexDBServiceStartup.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/BlazorWorker.Demo.IoCExample/MyIocService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;
using TG.Blazor.IndexedDB;

namespace BlazorWorker.Demo.IoCExample
{
Expand All @@ -26,10 +25,10 @@ public MyIocService(

public async Task<int> Five()
{
await this.WorkerMessageService.PostMessageAsync($"aaaaaaa");
this.FiveCalled?.Invoke(this, FiveCalledCounter++);
try
{
Console.WriteLine($"MyIocService: Attempting JsRuntime InvokeAsync...");
var theNumberOfTheBeast = await this.JSRuntime.InvokeAsync<int>("eval",
"(function(){ console.log('Hello world invoke call from MyIocService'); return 666; })()");

Expand Down
6 changes: 4 additions & 2 deletions src/BlazorWorker.Demo.IoCExample/MyServiceStartup.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using BlazorWorker.Extensions.JSRuntime;
using BlazorWorker.WorkerCore;
using BlazorWorker.WorkerCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.JSInterop;
using System;

using BlazorWorker.Extensions.JSRuntime;

namespace BlazorWorker.Demo.IoCExample
{
public class MyServiceStartup
Expand Down
6 changes: 5 additions & 1 deletion src/BlazorWorker.Demo.IoCExample/ServiceCollectionHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.JSInterop;
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;

namespace BlazorWorker.Demo.IoCExample
{
Expand All @@ -11,7 +15,7 @@ public static IServiceProvider BuildServiceProviderFromMethod(Configure configur
{
var serviceCollection = new ServiceCollection();
configureMethod(serviceCollection);
return serviceCollection.BuildServiceProvider();
return serviceCollection.BuildServiceProvider();
}
}
}
37 changes: 0 additions & 37 deletions src/BlazorWorker.Demo.IoCExample/SetupIndexedDBExtensions.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.14" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@code {
private bool collapseNavMenu = true;

private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

private void ToggleNavMenu()
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@code {
private bool collapseNavMenu = true;

private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

private void ToggleNavMenu()
{
Expand Down
4 changes: 4 additions & 0 deletions src/BlazorWorker.Demo/Shared/BlazorWorker.Demo.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<Configurations>Debug;Release;Nuget</Configurations>
</PropertyGroup>

<PropertyGroup>
<NoWarn>1701;1702;1591;CA1416</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\BlazorWorker.WorkerCore\BlazorWorker.WorkerCore.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.14" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
Expand All @@ -19,6 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\BlazorWorker.Demo.IoCExample\BlazorWorker.Demo.IoCExample.csproj" />
<ProjectReference Include="..\..\BlazorWorker.ServiceFactory\BlazorWorker.BackgroundServiceFactory.csproj" />
<ProjectReference Include="..\..\BlazorWorker.WorkerBackgroundService\BlazorWorker.WorkerBackgroundService.csproj" />
<ProjectReference Include="..\..\BlazorWorker.WorkerCore\BlazorWorker.WorkerCore.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions src/BlazorWorker.Demo/SharedPages/Pages/CoreExample.razor
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@

backgroundService = worker.CreateCoreInstanceService();

handle = await backgroundService.CreateInstance<CoreMathsService>(options =>
handle = await backgroundService.CreateInstance<CoreMathsService>(/*options =>
options.AddConventionalAssemblyOfService()
#if NET5_0_OR_GREATER
.AddAssemblies("System.Text.RegularExpressions.dll")
#endif
);
*/);

output += $"{rn}{LogDate()} Background service created.";
StateHasChanged();
Expand Down
4 changes: 2 additions & 2 deletions src/BlazorWorker.Demo/SharedPages/Pages/Http.razor
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

sw.Start();
backgroundService = await worker.CreateBackgroundServiceAsync<WebCallerService>(
options => options
/*options => options
.AddConventionalAssemblyOfService()
.AddHttpClient()
.AddHttpClient()*/
);

sw.Stop();
Expand Down
Loading

0 comments on commit 4ca0a74

Please sign in to comment.