-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support .Net Core 3.0 RTM + added Github actons
- Loading branch information
1 parent
027bdea
commit ee3ade4
Showing
8 changed files
with
149 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.0.100 | ||
- name: Build | ||
run: dotnet build --configuration Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.0.100 | ||
- name: Build | ||
run: dotnet build --configuration Release | ||
- name: Pack | ||
working-directory: src/Blazor.Extensions.SignalR | ||
run: dotnet pack --configuration Release | ||
- name: Push | ||
working-directory: src/Blazor.Extensions.SignalR/bin/Release | ||
run: | | ||
dotnet nuget push Blazor.Extensions.SignalR.*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json | ||
- name: Create Release | ||
uses: actions/create-release@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
[![Build status](https://dotnet-ci.visualstudio.com/DotnetCI/_apis/build/status/Blazor-Extensions-SignalR-CI?branch=master)](https://dotnet-ci.visualstudio.com/DotnetCI/_build/latest?definitionId=5&branch=master) | ||
[![Package Version](https://img.shields.io/nuget/v/Blazor.Extensions.SignalR.svg)](https://www.nuget.org/packages/Blazor.Extensions.SignalR) | ||
[![NuGet Downloads](https://img.shields.io/nuget/dt/Blazor.Extensions.SignalR.svg)](https://www.nuget.org/packages/Blazor.Extensions.SignalR) | ||
[![License](https://img.shields.io/github/license/BlazorExtensions/SignalR.svg)](https://github.com/BlazorExtensions/SignalR/blob/master/LICENSE) | ||
|
||
# Blazor Extensions | ||
|
||
Blazor Extensions is a set of packages with the goal of adding useful features to [Blazor](https://blazor.net). | ||
|
||
# Blazor Extensions SignalR | ||
|
||
This package adds a [Microsoft ASP.NET Core SignalR](https://github.com/aspnet/SignalR) client library for [Microsoft ASP.NET Blazor](https://github.com/aspnet/Blazor). | ||
|
||
The package aims to mimic the C# APIs of SignalR Client as much as possible and it is developed by wrapping the TypeScript client by using Blazor's interop capabilities. | ||
|
||
For more information about SignalR development, please check [SignalR documentation](https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-2.1). | ||
|
||
# Features | ||
|
||
This package implements all public features of SignalR Typescript client. | ||
|
||
> Note: The _Streaming_ APIs are not implemented yet. We will add it soon. | ||
# Sample usage | ||
|
||
The following snippet shows how to setup the client to send and receive messages using SignalR. | ||
|
||
The HubConnectionBuilder needs to get injected, which must be registered: | ||
```c# | ||
// in Startup.cs, ConfigureServices() | ||
services.AddTransient<HubConnectionBuilder>(); | ||
``` | ||
```c# | ||
// in Component class | ||
[Inject] | ||
private HubConnectionBuilder _hubConnectionBuilder { get; set; } | ||
``` | ||
```c# | ||
// in Component Initialization code | ||
var connection = _hubConnectionBuilder // the injected one from above. | ||
.WithUrl("/myHub", // The hub URL. If the Hub is hosted on the server where the blazor is hosted, you can just use the relative path. | ||
opt => | ||
{ | ||
opt.LogLevel = SignalRLogLevel.Trace; // Client log level | ||
opt.Transport = HttpTransportType.WebSockets; // Which transport you want to use for this connection | ||
}) | ||
.Build(); // Build the HubConnection | ||
connection.On("Receive", this.Handle); // Subscribe to messages sent from the Hub to the "Receive" method by passing a handle (Func<object, Task>) to process messages. | ||
await connection.StartAsync(); // Start the connection. | ||
await connection.InvokeAsync("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod" and pass parameters to it. | ||
var result = await connection.InvokeAsync<MyResult>("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod", pass parameters to it and get the result back. | ||
``` | ||
|
||
# Contributions and feedback | ||
|
||
Please feel free to use the component, open issues, fix bugs or provide feedback. | ||
|
||
# Contributors | ||
|
||
The following people are the maintainers of the Blazor Extensions projects: | ||
|
||
- [Attila Hajdrik](https://github.com/attilah) | ||
- [Gutemberg Ribiero](https://github.com/galvesribeiro) | ||
[![Build](https://github.com/BlazorExtensions/SignalR/workflows/CI/badge.svg)](https://github.com/BlazorExtensions/SignalR/actions) | ||
[![Package Version](https://img.shields.io/nuget/v/Blazor.Extensions.SignalR.svg)](https://www.nuget.org/packages/Blazor.Extensions.SignalR) | ||
[![NuGet Downloads](https://img.shields.io/nuget/dt/Blazor.Extensions.SignalR.svg)](https://www.nuget.org/packages/Blazor.Extensions.SignalR) | ||
[![License](https://img.shields.io/github/license/BlazorExtensions/SignalR.svg)](https://github.com/BlazorExtensions/SignalR/blob/master/LICENSE) | ||
|
||
# Blazor Extensions | ||
|
||
Blazor Extensions is a set of packages with the goal of adding useful features to [Blazor](https://blazor.net). | ||
|
||
# Blazor Extensions SignalR | ||
|
||
This package adds a [Microsoft ASP.NET Core SignalR](https://github.com/aspnet/SignalR) client library for [Microsoft ASP.NET Blazor](https://github.com/aspnet/Blazor). | ||
|
||
The package aims to mimic the C# APIs of SignalR Client as much as possible and it is developed by wrapping the TypeScript client by using Blazor's interop capabilities. | ||
|
||
For more information about SignalR development, please check [SignalR documentation](https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-2.1). | ||
|
||
# Features | ||
|
||
This package implements all public features of SignalR Typescript client. | ||
|
||
> Note: The _Streaming_ APIs are not implemented yet. We will add it soon. | ||
# Sample usage | ||
|
||
The following snippet shows how to setup the client to send and receive messages using SignalR. | ||
|
||
The HubConnectionBuilder needs to get injected, which must be registered: | ||
```c# | ||
// in Startup.cs, ConfigureServices() | ||
services.AddTransient<HubConnectionBuilder>(); | ||
``` | ||
```c# | ||
// in Component class | ||
[Inject] | ||
private HubConnectionBuilder _hubConnectionBuilder { get; set; } | ||
``` | ||
```c# | ||
// in Component Initialization code | ||
var connection = _hubConnectionBuilder // the injected one from above. | ||
.WithUrl("/myHub", // The hub URL. If the Hub is hosted on the server where the blazor is hosted, you can just use the relative path. | ||
opt => | ||
{ | ||
opt.LogLevel = SignalRLogLevel.Trace; // Client log level | ||
opt.Transport = HttpTransportType.WebSockets; // Which transport you want to use for this connection | ||
}) | ||
.Build(); // Build the HubConnection | ||
connection.On("Receive", this.Handle); // Subscribe to messages sent from the Hub to the "Receive" method by passing a handle (Func<object, Task>) to process messages. | ||
await connection.StartAsync(); // Start the connection. | ||
await connection.InvokeAsync("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod" and pass parameters to it. | ||
var result = await connection.InvokeAsync<MyResult>("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod", pass parameters to it and get the result back. | ||
``` | ||
|
||
# Contributions and feedback | ||
|
||
Please feel free to use the component, open issues, fix bugs or provide feedback. | ||
|
||
# Contributors | ||
|
||
The following people are the maintainers of the Blazor Extensions projects: | ||
|
||
- [Attila Hajdrik](https://github.com/attilah) | ||
- [Gutemberg Ribiero](https://github.com/galvesribeiro) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 22 additions & 22 deletions
44
test/Blazor.Extensions.SignalR.Test.Server/Blazor.Extensions.SignalR.Test.Server.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<RestoreAdditionalProjectSources> | ||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; | ||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json; | ||
</RestoreAdditionalProjectSources> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0-preview9.19424.4" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview9.19424.4" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview9.19424.4" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Blazor.Extensions.SignalR.Test.Client\Blazor.Extensions.SignalR.Test.Client.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<RestoreAdditionalProjectSources> | ||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; | ||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json; | ||
</RestoreAdditionalProjectSources> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview9.19465.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Blazor.Extensions.SignalR.Test.Client\Blazor.Extensions.SignalR.Test.Client.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |