-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from akkadotnet/dev
Hyperion v0.10.1 Release
- Loading branch information
Showing
11 changed files
with
946 additions
and
30 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
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,2 @@ | ||
### 0.10.0 April 13 2021 #### | ||
* [Add a generic cross platform serialization support](https://github.com/akkadotnet/Hyperion/pull/208) | ||
|
||
# Cross platform serialization | ||
|
||
You can now address any cross platform package serialization differences by providing a list of package name transformation lambda function into the `SerializerOptions` constructor. The package name will be passed into the lambda function before it is deserialized, and the result of the string transformation is used for deserialization instead of the original package name. | ||
|
||
This short example shows how to address the change from `System.Drawing` in .NET Framework to `System.Drawing.Primitives` in .NET Core: | ||
|
||
``` | ||
Serializer serializer; | ||
#if NETFX | ||
serializer = new Serializer(new SerializerOptions( | ||
packageNameOverrides: new List<Func<string, string>> { | ||
str => str.Contains("System.Drawing.Primitives") ? str.Replace(".Primitives", "") : str | ||
})); | ||
#elif NETCOREAPP | ||
serializer = new Serializer(); | ||
#endif | ||
``` | ||
|
||
Note that only one package name transformation is allowed, any transform lambda function after the first applied transformation is ignored. | ||
### 0.10.1 April 20 2021 #### | ||
* [Fix SerializerOptions constructor backward compatibility issue with Akka.NET](https://github.com/akkadotnet/Hyperion/pull/214) |
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,40 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using ApprovalTests; | ||
using ApprovalTests.Reporters; | ||
using PublicApiGenerator; | ||
using Xunit; | ||
|
||
namespace Hyperion.API.Tests | ||
{ | ||
#if(DEBUG) | ||
[UseReporter(typeof(DiffReporter), typeof(AllFailingTestsClipboardReporter))] | ||
#else | ||
[UseReporter(typeof(DiffReporter))] | ||
#endif | ||
public class CoreApiSpec | ||
{ | ||
[Fact] | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public void ApproveApi() | ||
{ | ||
var publicApi = Filter(typeof(Serializer).Assembly.GeneratePublicApi()); | ||
Approvals.Verify(publicApi); | ||
} | ||
|
||
static string Filter(string text) | ||
{ | ||
return string.Join(Environment.NewLine, text.Split(new[] | ||
{ | ||
Environment.NewLine | ||
}, StringSplitOptions.RemoveEmptyEntries) | ||
.Where(l => | ||
!l.StartsWith("[assembly: ReleaseDateAttribute(") | ||
&& !l.StartsWith("[assembly: System.Security") | ||
&& !l.StartsWith("[assembly: System.Runtime.Versioning.TargetFramework(")) | ||
.Where(l => !string.IsNullOrWhiteSpace(l)) | ||
); | ||
} | ||
} | ||
} |
Oops, something went wrong.