github Cysharp/MagicOnion 7.0.0

18 hours ago

What's New

πŸ“–New documentation site launched!

Until now, the only MagicOnion documentation available was the README file, but we have now launched a new documentation site.

https://cysharp.github.io/MagicOnion/

The new site has been updated and reorganized from the previous README file, making it easier to read.
This site has only just been launched, so we plan to continue updating and improving it.

In addition, the Japanese version of the documentation is also available.

General

void return value support for StreamingHub methods

StreamingHub method now supports void return value. This can be used for Fire-and-Forget pattern that does not require a return value from the server.

Client results

Added a mechanism to wait for the receiver's method call in StreamingHub and receive the processing result on the server. For more information, see Client Results.

Built-in heartbeat for StreamingHub

Added a built-in heartbeat feature to StreamingHub. For more information, see Heartbeat.

Upgrade to MessagePack v3

MessagePack has been upgraded to v3. This eliminates the need for using MessagePack Generator (mpc) in Unity and AOT environments. For more information, see the MessagePack-CSharp release.

Server

Refresh of the backend implementation of StreamingHub groups

Backends of StreamingHub groups have been refreshed to be based on Multicaster, allowing for more flexible group operations. This has resulted in changes to the group-related APIs.

  • InMemoryStorage API has been removed
  • Changes to the IGroup interface API
    • Changes to the API for getting group receivers
      • Added All, Single, Only, Except methods
      • Removed Broadcast methods in StreamingHubBase and CreateBroadcaster methods in Group

For more information, see Groups and Application-managed groups. For migration from v6, see the migration guide.

Introduction of MagicOnion.Server.JsonTranscoding and removal of MagicOnion.Server.HttpGateway

MagicOnion.Server.HttpGateway, which was used for Swagger support, has been removed. Instead, MagicOnion.Server.JsonTranscoding has been introduced, which encodes/decodes requests/responses in JSON. and its Swagger support has been added. For more information, see JSON Transcoding.

Other improvements

  • Suport for .NET 9
  • Call AddLogging and AddGrpc implicitly

Client

Introduce WaitForDisconnectAsync API

The WaitForDisconnectAsync method has been added to the StreamingHub client. This method waits for disconnection as before with WaitForDisconnect, but now returns the reason for disconnection. This allows you to get disconnection reasons such as timeouts due to heartbeats. For more information, see Disconnection.

Other improvements

  • Enable trimming warnings in the client library
  • Reduce allocations in StreamingHubClient

Breaking changes

Server

Removed support for .NET 7

We no longer support .NET 7 as its runtime support has ended. Please use .NET 8 or later.

StreamingHubContext is now reused

StreamingHubContext is now reused, so caching StreamingHubContext outside of Hub method calls may result in unexpected behavior. The context is only valid during the call.

Reworked the binding logic for gRPC methods

We have reworked the mechanism for registering MagicOnion methods as gRPC methods on the server. This changes the timing of registering MagicOnion Unary/StreamingHub services from application build to request pipeline/route construction.

AddMagicOnion was used to register Unary/StreamingHub services, but now you need to change it to register with MapMagicOnionService.

Client

Removed support for C-Core gRPC library

We have removed support for the C-core gRPC library in Unity. Please use grpc-dotnet and YetAnotherHttpHandler instead. For more information, see Using with Unity.

StreamingHub client now throws RpcException instead of ObjectDisposedException after disconnection

In previous versions, when a client called a method after being disconnected from StreamingHub, an ObjectDisposedException was thrown. Now, an RpcException is thrown. ObjectDisposedException is only thrown when it is disposed like a general class.

Migration guide from v6

Please refer to the documentation for migration instructions from v6.
https://cysharp.github.io/MagicOnion/release-notes/7.0#migration-guide

Full changes

Changes between 6.1.3 to 7.0.0

Breaking Changes

  • Removal of support for NET 7 by @mayuki in #771
  • Change the backend of HubGroup to Multicaster by @mayuki in #778
  • Throws RpcException instead of ObjectDisposedException when the client is disconnected. by @mayuki in #838
  • Remove support for C-Core gRPC library by @mayuki in #840
  • Use NuGetForUnity to install external dependencies by @mayuki in #841
  • Remove MagicOnion.Server.HttpGateway by @mayuki in #859
  • Rework gRPC method binding logic by @mayuki in #864
  • Drop .NET 6 support by @mayuki in #865
  • Upgrade to MessagePack v3 by @mayuki in #882
  • Expose MagicOnionClientGenerationAttribute from MagicOnion.Client by @mayuki in #889

Features

  • Implicitly call AddLogging and AddGrpc by @mayuki in #768
  • Add support for void as a return type for StreamingHub by @mayuki in #772
  • Object pooling on StreamingHub by @mayuki in #774
  • Client Results by @mayuki in #783
  • StreamingHub built-in heartbeat by @mayuki in #784
  • Reduce allocation on StreamingHubClient method calls by @mayuki in #786
  • Reduce allocation on StreamingHubClient broadcast events by @mayuki in #787
  • Reduce allocation on StreamingHubClient method calls by @mayuki in #793
  • Expose attributes lookup of Hub methods by @mayuki in #798
  • Enhance StreamingHub heartbeat from client by @mayuki in #800
  • Introduce WaitForDisconnectAsync by @mayuki in #837
  • Enable client library trim warnings by @mayuki in #849
  • Introduce MagicOnion.Server.JsonTranscoding by @mayuki in #871
  • Adopt to .NET 9 by @mayuki in #873
  • Hide internal filter method calls from stack trace by @mayuki in #886
  • Reuse SteramingHubContext by @mayuki in #885

Other Changes

  • Use Profiler API with PerformanceTest by @mayuki in #773
  • Refactor StreamingHub message handling by @mayuki in #775
  • Process requests outside the message loop by @mayuki in #776
  • Reduce allocations on StreamingHubClient method calls by @mayuki in #790
  • Expose server-side heartbeat properties and Unregister method by @mayuki in #808
  • Fix internal errors when IsReturnExceptionStackTraceInErrorDetail is enabled (#809) by @mayuki in #810
  • [main] Introduce PublicApiAnalyzers to Client, Abstractions and Shared by @mayuki in #819
  • Refactor the codes for binding services by @mayuki in #828
  • Add a callback when an Ack message is received from the client by @mayuki in #833
  • Use TimeProvider on Unity by @mayuki in #842
  • Remove NON_UNITY define constant and if directives by @mayuki in #843
  • Update NuGet packages for ChatApp by @mayuki in #844
  • chore(deps): bump MessagePack from 2.1.90 to 2.5.187 in /tests/MagicOnion.Tests by @dependabot in #858
  • Bump MessagePack to 2.5.187 by @mayuki in #860
  • Ignoring exceptions in the writer loop of the StreamingHub client by @mayuki in #862
  • Fixed typo 'destory' in README.md by @AldeRoberge in #868
  • Update package dependencies by @mayuki in #872
  • chore: Benchmark Adopt to .NET 9 by @guitarrapc in #875
  • chore: fix Benchmark package version when UseNuGetClient or UseNuGetServer is enabled by @guitarrapc in #877
  • Move types under Internal by @mayuki in #883
  • Handling when calling a non-implemented hub method by @mayuki in #884
  • Update ChatApp by @mayuki in #887
  • Update MessagePack to 3.1.1 by @mayuki in #888
  • Fix warnings in formatter's constructor by @mayuki in #890
  • Upgrade LangVersion by @mayuki in #891
  • Cleanup DynamicArgumentTuple by @mayuki in #892
  • Migrate to xUnit v3 by @mayuki in #893
  • Refactor UnaryResult by @mayuki in #894
  • Disable warnings in generated sources by @mayuki in #895
  • Remove Fluent Assertions by @mayuki in #897
  • Revert to generating resolvers and type-hints. by @mayuki in #898
  • Add unit tests for Native AOT by @mayuki in #899
  • Rename workflows by @mayuki in #901
  • Fix exception message when dynamic code generation is not supported by @mayuki in #902
  • Fix unit tests by @mayuki in #903
  • Renewal of documents by @mayuki in #904

New Contributors

Full Changelog: 6.1.3...7.0.0

Don't miss a new MagicOnion release

NewReleases is sending notifications on new releases.