Releases: Cysharp/MagicOnion
7.0.1
7.0.0
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 andCreateBroadcaster
methods in Group
- Added
- Changes to the API for getting group receivers
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
andAddGrpc
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 https://github.com/Cysharp/MagicOnion/...
6.1.6
6.1.5
What's Changed
Other Changes
- Introduce PublicApiAnalyzers to Client, Abstractions and Shared by @mayuki in #818
- Use NullabilityInfoContext to replace Type's nullable detection in release 6.x by @SmRiley in #855
New Contributors
Full Changelog: 6.1.4...6.1.5
6.1.4
6.1.3
What's Changed
Fixes
- Update MemoryPack to 1.21.1 by @mayuki in #764
- Fix method signature of MemoryPackFormatter for UNITY_2021_3_OR_NEWER by @0x5143 in #757
Housekeeping
- ci: include Directory.Build.props as release version update file by @guitarrapc in #752
- feat: change load secret from op by @guitarrapc in #759
- ci: add depndabot.yaml to update github-actions, by @guitarrapc in #758
- Update ChatApps to use MagicOnion v6 Structure by @guitarrapc in #753
- ci: change upload-artifact & download-artifact to Cysharp/Actions by @guitarrapc in #767
- Bump actions/checkout from 3 to 4 by @dependabot in #763
- Bump actions/download-artifact from 2 to 4 by @dependabot in #762
- Bump peaceiris/actions-gh-pages from 3 to 4 by @dependabot in #761
- Bump actions/upload-artifact from 1 to 4 by @dependabot in #760
- Use netstandard2.x instead of net46x. by @mayuki in #765
New Contributors
Full Changelog: 6.1.2...6.1.3
6.1.2
6.1.1
6.1.0
Features
Add StreamingHub OnConnected support by @riversdark0 in #745
Introduced the event OnConnected
after a connection is established with a client on the server's StreamingHub.
This differs from OnConnecting
in that the client is notified that the connection is complete and can then communicate via Broadcast.
Allow DynamicArgumentTuple as a reference type on Unity in #747
This PR allows DynamicArgumentTuple as a reference type on Unity.
Unity IL2CPP builds often have issues with the code size due to generics and value types.
MAGICONION_USE_REFTYPE_DYNAMICARGUMENTTUPLE
build constant allows DynamicArgumentTuple
to be treated as a reference type.
[Preview] Introduce IStreamingHubDiagnosticHandler in #746
This PR introduces an API for diagnosing and tracing the communication of StreamingHub. The API is in preview and may be subject to change in the future.
This API only supports the Source Generator at this moment and you need to set the EnableStreamingHubDiagnosticHandler
option to true
in the generation options. By setting this option, the StreamingHubDiagnosticHandler
property will be added to the generated class, allowing you to set a handler.
namespace MagicOnion.Client;
/// <summary>
/// [Preview] The interface of the handler for StreamingHub diagnostics. This API may change in the future.
/// </summary>
public interface IStreamingHubDiagnosticHandler
{
/// <summary>
/// The callback method at the beginning of a Hub method request. This API may change in the future.
/// </summary>
void OnRequestBegin<THub, TRequest>(THub hubInstance, Guid requestId, string methodName, TRequest request, bool isFireAndForget);
/// <summary>
/// [Preview] The callback method at the end of a Hub method request. This API may change in the future.
/// </summary>
void OnRequestEnd<THub, TResponse>(THub hubInstance, Guid requestId, string methodName, TResponse response);
/// <summary>
/// [Preview] The callback method when a method of HubReceiver is invoked. This API may change in the future.
/// </summary>
void OnBroadcastEvent<THub, T>(THub hubInstance, string methodName, T value);
}
What's Changed
Breaking Changes
Other Changes
- Update how share project in Unity by @neuecc in #733
- Mark GrpcChannelProvider(GrpcChannelOptions) as Obsolete by @mayuki in #734
- ci: Cysharp/Actions/.github/workflows/create-release.yaml by @guitarrapc in #737
- ci: remove Ver. prefix for release by @guitarrapc in #744
New Contributors
- @riversdark0 made their first contribution in #745
Full Changelog: 6.0.1...6.1.0