Releases: Cysharp/MagicOnion
Ver.4.5.2
Ver.4.5.1
What's Changed
Other Changes
- FIX: codegen system type fix by @gavar in #520
- Add support for known generic types to generator by @mayuki in #525
- Bump Newtonsoft.Json from 12.0.2 to 13.0.1 in /src/MagicOnion.Server.HttpGateway by @dependabot in #523
- Update README.md by @mayuki in #527
New Contributors
Full Changelog: 4.5.0...4.5.1
Ver.4.5.0
What's Changed
Breaking Changes
Reduce the maximum number of method parameters in #519
Limit the number of parameters allowed in a Unary/StreamingHub method for Blazor WebAssembly (AOT) to 15.
Other Changes
- Fix
using
when only Grpc.Net.Client is used on Unity in #518 - Annotate nullable properties not required in Swagger, fixes #456 by @AlexVallat in #515
New Contributors
- @AlexVallat made their first contribution in #515
Full Changelog: 4.4.1...4.5.0
Ver.4.4.1
What's Changed
Other Changes
- If a user leaves the room, another user joins the same room, and then the user who leaves the room disconnects, the shared data in the room will be deleted. by @taketoriokina in #494
- Update readme for Unity by @yucchiy in #511
New Contributors
- @taketoriokina made their first contribution in #494
- @yucchiy made their first contribution in #511
Full Changelog: 4.4.0...4.4.1
Ver.4.4.0
Breaking Changes
Remove MagicOnion.Server.Authentication in #483 #484
We will no longer provide and support MagicOnion.Server.Authentication (Preview package).
If your applicaiton requires authentication mechanism, this can be achieved on top of the standard authentication mechanism in ASP.NET Core.
See: Authentication and authorization in gRPC for ASP.NET Core
Features
- Add UnaryResult.FromResult(), UnaryResult.Nil in #463
- Make default(UnaryResult) awaitable in #466
- Target .NET 6 in #469 #470
- Introduce GenerateIfDirectiveAttribute in #493
Improvements
- Use RequestServices instead of a manually scoped ServiceProvider in #479
- Clarify the message when it fails to negotiate with the server in #480
- Pass attributes as metadata on binding gRPC method in #484
Other Changes
- Add code highlight hint to sample code for Filter by @bamchoh in #443
- feat: publish OpenTelemetry support to NuGet listed latest version. by @guitarrapc in #422
- MagicOnion.Unity: Grpc.Net.Client in #446 #447
- Symbols should not be cached across Compilation in #448
- Fix typos in README by @hankovich in #450
- Ignore PackageReference element if it does not have Include attribute in #454
- Update smple code "await foreach" by @NepPure in #468
- Ignore exception on disconnection by STREAM_RST in #475
- HttpGateway breaks if service uses explicit interface implementation feature by @bearpro in #473
- Ignore InvalidOperationException if the connection is completed in #478
- Fix warnings in #477
New Contributors
- @bamchoh made their first contribution in #443
- @hankovich made their first contribution in #450
- @NepPure made their first contribution in #468
- @bearpro made their first contribution in #473
Full Changelog: 4.3.1...4.4.0
Ver.4.3.1
Ver.4.3.0
Changes
Breaking changes
[Client] Use ChannelBase for channel abstraction #433
Use ChannelBase
(included in Grpc.Core.Api) for channel abstraction.
Remove overloads to receive IMagicOnionAwareGrpcChannel
, Channel
, GrpcChannel
from MagicOnionClient
and StreamingHubClient
.
MagicOnion now requires gRPC v1.27.0 (Grpc.Core.Api v2.27.0) or later.
You may need to remove following source codes from your Unity project.
- MagicOnionClient.CCore.cs
- MagicOnionClient.NetStandard.cs
- StreamingHubClient.CCore.cs
- StreamingHubClient.NetStandard.cs
API changes and deprecation
[Client.Unity] Make the method names of GrpcChannelx like the API of GrpcChannel #434
Because GrpcChannel has a method named ForAddress, GrpcChannelx follows it.
Following APIs are marked as deprecated:
GrpcChannelx.FromAddress(Uri)
GrpcChannelx.FromTarget(GrpcChannelTarget)
Use GrpcChannelx.ForAddress
or GrpcChannelx.ForTarget
instead.
Ver.4.2.0
New Features
Unity: Introduce gRPC channel management integration #414
Wraps gRPC channels and provides a mechanism to manage them with Unity's lifecycle.
This prevents your application and the Unity Editor from freezing by releasing channels and StreamingHub in one place.
The editor extension also provides the ability to display the communication status of channels.
NOTE: The data rate is calculated only for the message body of methods, and does not include Headers, Trailers, or Keep-alive pings.
New APIs
MagicOnion.GrpcChannelx
class
GrpcChannelx.FromTarget(GrpcChannelTarget)
methodGrpcChannelx.FromAddress(Uri)
method
MagicOnion.Unity.GrpcChannelProviderHost
class
GrpcChannelProviderHost.Initialize(IGrpcChannelProvider)
method
MagicOnion.Unity.IGrpcChannelProvider
interface
DefaultGrpcChannelProvider
classLoggingGrpcChannelProvider
class
Usages
1. Prepare to use GrpcChannelx
in your Unity project.
Before creating a channel in your application, you need to initialize the provider host to be managed.
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void OnRuntimeInitialize()
{
// Initialize gRPC channel provider when the application is loaded.
GrpcChannelProviderHost.Initialize(new DefaultGrpcChannelProvider(new []
{
// send keepalive ping every 5 second, default is 2 hours
new ChannelOption("grpc.keepalive_time_ms", 5000),
// keepalive ping time out after 5 seconds, default is 20 seconds
new ChannelOption("grpc.keepalive_timeout_ms", 5 * 1000),
}));
}
GrpcChannelProviderHost will be created as DontDestroyOnLoad and keeps existing while the application is running. DO NOT destory it.
2. Use GrpcChannelx.FromTarget
or GrpcChannelx.FromAddress
to create a channel.
Use GrpcChannelx.FromTarget
or GrpcChannelx.FromAddress
to create a channel instead of new Channel(...)
.
var channel = GrpcChannelx.FromTarget(new GrpcChannelTarget("localhost", 12345, ChannelCredentials.Insecure));
// or
var channel = GrpcChannelx.FromAddress(new Uri("http://localhost:12345"));
3. Use the channel instead of Grpc.Core.Channel
.
var channel = GrpcChannelx.FromAddress(new Uri("http://localhost:12345"));
var serviceClient = MagicOnionClient.Create<IGreeterService>(channel);
var hubClient = StreamingHubClient.ConnectAsync<IGreeterHub, IGreeterHubReceiver>(channel, this);
Extensions for Unity Editor (Editor Window & Inspector)
Improvements
- Improve StreamingHub's grouping writer #416
Fixes
- Fix handling of Generics for StreamingHub code generation #419