Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessagePack update #2

Merged
merged 259 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
259 commits
Select commit Hold shift + click to select a range
9b6882b
Partial solution of #1085: Dynamic #1091
pCYSl5EDgo Oct 27, 2020
4886309
Add HalfFormatter for .NET 5.0
neuecc Nov 11, 2020
1b8133a
remove using
neuecc Nov 11, 2020
ba463e6
support Half to ReadMe
neuecc Nov 11, 2020
851e392
Update .NET SDK to 5.0.100
AArnott Nov 11, 2020
07615dd
Merge pull request #1095 from pCYSl5EDgo/solution#1085
AArnott Nov 11, 2020
af2d4b3
Remove not supported target framework.
pCYSl5EDgo Nov 12, 2020
ca5ccdb
Merge pull request #1113 from pCYSl5EDgo/SG
AArnott Nov 12, 2020
0d1b60b
Merge pull request #1119 from neuecc/master
AArnott Nov 13, 2020
9e719ff
Remove VSIX and use dotnet build in AzP
AArnott Nov 13, 2020
bc4e38f
Merge pull request #1120 from AArnott/removeVsix
AArnott Nov 13, 2020
9ca9abc
SequencePool.Shared was changed to MessagePackSerializerOptions.Pool …
Nirklav Nov 16, 2020
b539b7b
XML comment was fixed;
Nirklav Nov 16, 2020
7de6921
Unify FormatterName
pCYSl5EDgo Nov 17, 2020
cd7b434
Multiple Target Frameworks
pCYSl5EDgo Nov 17, 2020
cc07ead
Revert "Multiple Target Frameworks"
pCYSl5EDgo Nov 17, 2020
081056f
Issue with mutable static was fixed;
Nirklav Nov 18, 2020
cf55ca9
Touch-up on API changes
AArnott Nov 19, 2020
e3db213
Merge pull request #1123 from pCYSl5EDgo/FormatterName
AArnott Nov 19, 2020
5e29bce
Update dotnet version
pCYSl5EDgo Nov 19, 2020
1caa774
Target net5.0
pCYSl5EDgo Nov 19, 2020
146d675
fix: nullable reference dir
pCYSl5EDgo Nov 19, 2020
604de7c
Merge pull request #1122 from Nirklav/develop
AArnott Nov 19, 2020
e03abbb
Merge pull request #1124 from pCYSl5EDgo/Multi
AArnott Nov 19, 2020
071d17c
Fix up PublicAPI for net5.0 unique type
AArnott Nov 19, 2020
583ebb8
Merge remote-tracking branch 'upstream/develop' into half
AArnott Nov 19, 2020
97b014e
Fix up compiler warnings
AArnott Nov 19, 2020
7efe772
Merge pull request #1108 from neuecc/half
AArnott Nov 19, 2020
010ed71
MPC: nullable enable and update language version to 9. (#1125)
pCYSl5EDgo Nov 20, 2020
1ff4ac6
Update StyleCop.Analyzers to support C# 9 syntax
AArnott Nov 22, 2020
d87428d
Add C# 9 records serialization tests
AArnott Nov 22, 2020
908ac7b
Add test for generic class containing property with `init` setter
AArnott Nov 22, 2020
4d36888
Merge pull request #1135 from AArnott/stylecop
AArnott Nov 23, 2020
15b2ab6
Merge pull request #1136 from AArnott/records
AArnott Nov 23, 2020
1076aff
Avoid `MissingMethodException` on generic classes with `init` propert…
AArnott Nov 23, 2020
7a4e983
Change namespace of BenchmarkProgram to Benchmark
JohannesDeml Dec 1, 2020
e67f88f
Fix small typo
JohannesDeml Dec 1, 2020
c51e969
Change use readable size conversion from BenchmarkDotNet
JohannesDeml Dec 1, 2020
66f1d7f
Fix deprecated methods and code styling
JohannesDeml Dec 2, 2020
0bd93df
Merge pull request #1144 from JohannesDeml/benchmark-cleanup
AArnott Dec 5, 2020
7db2ed6
Add ToString to all serializers
JohannesDeml Dec 8, 2020
25fe3f9
Change add namespaces and make naming consistent with their file names
JohannesDeml Dec 8, 2020
cc09f3c
Merge remote-tracking branch 'upstream/master' into benchmarkSerializ…
JohannesDeml Dec 14, 2020
78c29b3
Merge pull request #1149 from JohannesDeml/benchmarkSerializerNaming
AArnott Dec 20, 2020
6240389
Enable more tests on net472
AArnott Dec 21, 2020
ba1f54f
Merge remote-tracking branch 'upstream/develop' into docCtorPlusSette…
AArnott Dec 21, 2020
0edc912
Adapt `CtorParameterAndPropertySetterExists` test for v2.3 behavior
AArnott Dec 21, 2020
2efd330
Fallback to dynamic methods in buggy CLR case
AArnott Dec 22, 2020
ad90a59
Fix unity build
AArnott Dec 22, 2020
4ca7e42
Merge pull request #1156 from AArnott/docCtorPlusSetter_v2.3
AArnott Jan 2, 2021
ad47318
Merge remote-tracking branch 'upstream/develop' into fix1134
AArnott Jan 2, 2021
2ec0f13
Merge pull request #1137 from AArnott/fix1134
AArnott Jan 29, 2021
b5a757d
Merge pull request #1178 from neuecc/master
AArnott Jan 31, 2021
8e869d9
Add doc about how to consume CI builds
AArnott Jan 31, 2021
42a4b43
Implement #1176
hankovich Jan 31, 2021
b9e9b60
Define SPAN_BUILTIN for net5.0
AArnott Feb 15, 2021
de6a6d3
Merge pull request #1186 from AArnott/spanBuiltinFix
AArnott Feb 15, 2021
5819382
Enable serialization IEnumerable<T> and IReadOnlyDictionary<T> descen…
Alezy80 Feb 16, 2021
5659e42
Merge pull request #1179 from hankovich/develop
AArnott Feb 18, 2021
bd0c26a
Add new classes to PublicAPI
Alezy80 Feb 22, 2021
e2beaad
rename TempProject -> TempTargetProject in GeneratorTest
Feb 24, 2021
b75bdd2
Add TempReferencedProject in GeneratorTest
Feb 24, 2021
e4a7acb
add Test for #1111 GenericType referenced in project
Feb 24, 2021
29d7449
Fix #1111 GenericType referenced in project
Feb 24, 2021
c5cffb7
fix CI build error.
Feb 25, 2021
6f42a86
Remove assembly version info from generic type arguments
AArnott Mar 6, 2021
3b5fd07
Merge remote-tracking branch 'upstream/master' into develop
AArnott Mar 6, 2021
95326ac
Make cctor defer Reflection that fails in AOT
AArnott Mar 6, 2021
968797b
Update PublicAPI analyzers
AArnott Mar 6, 2021
a2cf871
Merge pull request #1204 from AArnott/develop
AArnott Mar 6, 2021
a6f2de9
Merge pull request #1205 from AArnott/publicApiAnalyzersUpdate
AArnott Mar 6, 2021
a541c3a
Fix code snippet bug
AArnott Mar 7, 2021
7226ee9
Add ReadArrayHeaderAsync() and ReadMapHeaderAsync() to MessagePackStr…
rmja Mar 16, 2021
454ec5e
Add ReadArrayHeaderAsync and ReadMapHeaderAsync to PublicAPI
rmja Mar 16, 2021
13c299a
Merge pull request #1202 from AArnott/fix1168
AArnott Mar 18, 2021
cd0bfa0
Merge pull request #1203 from AArnott/fix1190
AArnott Mar 19, 2021
a681d2c
Add `prepare_release.ps1` script
AArnott Mar 19, 2021
b07d0d1
Promote all APIs as shipped
AArnott Mar 19, 2021
580b988
Merge branch 'master' into develop
AArnott Mar 19, 2021
2f977b5
Merge branch 'develop' into stream-reader-headers
AArnott Mar 19, 2021
8920a17
Add new APIs to the extra files
AArnott Mar 19, 2021
62155ee
Merge pull request #1213 from rmja/stream-reader-headers
AArnott Mar 19, 2021
152d57f
Merge remote-tracking branch 'upstream/master' into develop
AArnott Mar 20, 2021
a6b2846
Stamp unity package version as 2.3.58-alpha
AArnott Mar 20, 2021
9f897b3
Merge pull request #1215 from AArnott/fix1195
AArnott Mar 20, 2021
8ca7fc2
Drop vsix artifact from github release
AArnott Mar 20, 2021
ffc1831
Merge pull request #1192 from gsino/fix_mpc_ignore_generic_type_defin…
AArnott Mar 21, 2021
2e6fd46
Fix for possible incorrect constructor search. Allow serialization ID…
Alezy80 Mar 22, 2021
048f743
Merge branch 'develop' into more-collections-serializer
Alezy80 Mar 22, 2021
f5e5bf9
Add new classes to PublicAPI
Alezy80 Mar 22, 2021
6334928
Bump Microsoft.AspNetCore.Mvc.Abstractions
dependabot[bot] Apr 5, 2021
1e337a2
Fix readme about mpc
kyubuns Apr 14, 2021
ff4ce58
Merge pull request #1223 from kyubuns/fix_readme_about_mpc
AArnott Apr 14, 2021
27230c7
Merge pull request #1225 from neuecc/master
AArnott Apr 17, 2021
827abd9
Update .NET SDK to 5.0.201
AArnott Apr 17, 2021
752022e
Add support for `IReadOnlySet<T>`
AArnott Apr 17, 2021
b652df8
Merge pull request #1219 from neuecc/dependabot/nuget/src/MessagePack…
AArnott Apr 17, 2021
7af6eea
Merge pull request #1229 from AArnott/fix1217
AArnott May 17, 2021
a77187e
Merge pull request #1187 from Alezy80/more-collections-serializer
AArnott May 17, 2021
db1f36e
allow the ContractlessStandardResolver to also honor explicitly marke…
pianomanjh May 18, 2021
e94dbb5
Allow deserializing `byte[]` from a msgpack array
AArnott May 29, 2021
83f7cb6
Add Odin Serializer to the benchmark (round 2) (#1248)
JesseTG May 29, 2021
bbda765
Update from Library.Template
AArnott May 30, 2021
b0bb0ac
Add Assert.Empty to unity xunit shim
AArnott May 30, 2021
0377091
Merge pull request #1254 from AArnott/fix1244
AArnott May 30, 2021
7ca890e
Merge remote-tracking branch 'upstream/master' into develop
AArnott May 31, 2021
b7839d5
If a object type has a custom formatter, dont require [MessagePackObj…
icanhasjonas Jun 3, 2021
fb3277d
check that `[MessagePackFormatter(typeof(SomeFormatter))]` is an actu…
icanhasjonas Jun 3, 2021
a602180
oups
icanhasjonas Jun 3, 2021
74ce9db
fixed style violations
icanhasjonas Jun 3, 2021
070f3a9
MsgPack006 diagnostic error is not properly located on the attribute …
icanhasjonas Jun 3, 2021
3878cd3
Merge pull request #1252 from AArnott/fix1251
AArnott Jun 6, 2021
af6d26a
Merge pull request #1259 from icanhasjonas/master
AArnott Jun 7, 2021
b6b1cf9
Suppress the only build warning we have
AArnott Jun 12, 2021
ef8abf3
Merge pull request #1262 from AArnott/fixWarning
AArnott Jun 12, 2021
b0db693
Use AssemblyBuilderAccess.RunAndCollect
piti6 Jun 13, 2021
dd880a6
Merge pull request #1263 from piti6/patch-1
AArnott Jun 13, 2021
412a1af
Clearly document unity scenarios that require AOT
AArnott Jun 13, 2021
5e6e3e9
Merge pull request #1265 from neuecc/master
AArnott Jun 13, 2021
09ab37c
Merge pull request #1241 from pianomanjh/bugfix/contractless-private-…
AArnott Jun 13, 2021
db29bea
Fix handling of readonly private fields
Alxandr Jun 14, 2021
615a0b5
Merge pull request #1267 from Alxandr/fix/1218
AArnott Jun 21, 2021
15d6851
Merge pull request #1264 from neuecc/fix471
AArnott Jun 21, 2021
0dc070a
Mapping intMembers to constructor parameters in ascending order.
seriousbox Jun 27, 2021
aeb2575
Exiting the loop, since the next iterations do not affect the result.
seriousbox Jun 27, 2021
c2a7583
Added a constructor test for an immutable type with missing keys.
seriousbox Jul 1, 2021
2c9a73d
Add string interning option
AArnott Jul 12, 2021
0f1a56b
Switch string interning to `Microsoft.NET.StringTools`
AArnott Jul 12, 2021
f5edd63
String interning on by default
AArnott Jul 13, 2021
1551f93
Merge pull request #1277 from seriousbox/fix-int-key-constructor-matc…
AArnott Jul 14, 2021
8a6a48f
Add C# 9 records test with `StandardResolverAllowPrivate`
AArnott Jul 14, 2021
a266ea2
Fix interning of empty strings
AArnott Jul 14, 2021
634f141
Skip serializing `EqualityContract` properties of C# records
AArnott Jul 14, 2021
66abae0
Merge pull request #1286 from AArnott/fix1232
AArnott Jul 15, 2021
4ff278b
Update mpc roslyn dependency to 3.10.0
AArnott Jul 15, 2021
3704099
Merge pull request #1288 from AArnott/fix1274
AArnott Jul 17, 2021
4d61d5d
Build stable v2.3 packages
AArnott Jul 29, 2021
847c581
Merge develop into master
AArnott Jul 29, 2021
013e3c3
Start building 2.4-alpha
AArnott Jul 29, 2021
cfdaeac
Add unit tests to run the generated code
mayuki Aug 3, 2021
8097901
Fix code generation for objects with getter-only props and parameteri…
mayuki Aug 3, 2021
b33f453
Fix code formatting
mayuki Aug 3, 2021
71f44c9
Refactory ObjectSerializationInfo.CreateOrNull
fredliex Aug 4, 2021
192ba3e
add unittest for DataContractSerializer compatibility
fredliex Aug 4, 2021
7cb857f
add braces
fredliex Aug 4, 2021
ab35db5
More reliable assembly load
AArnott Aug 21, 2021
d0b1409
Do not use extension method syntax
AArnott Aug 21, 2021
aa998e6
Merge pull request #1303 from fredliex/DataContractSerializer-compati…
AArnott Aug 21, 2021
4e5aaa7
Merge pull request #1300 from mayuki/hotfix/FixStringKeyedObjectCodeG…
AArnott Aug 21, 2021
9f64926
Add test for a DCS type with a private, readonly dictionary
AArnott Aug 21, 2021
14556ae
Merge pull request #1302 from fredliex/refactory-ObjectSerializationI…
AArnott Aug 21, 2021
c976635
Merge remote-tracking branch 'upstream/master' into fix1308
AArnott Aug 21, 2021
6e4fd8d
Remove string interning by default
AArnott Aug 22, 2021
6635df6
Document string interning
AArnott Aug 22, 2021
49fa946
Allows client code to avoid tripping over StandardResolver
AArnott Aug 22, 2021
4e6b915
Skip setting fields when the ctor already took the value
AArnott Aug 21, 2021
5dc5fee
Fix unity build
AArnott Aug 22, 2021
8563c84
Fixed typo in README.MD
marekott Aug 27, 2021
1bfa05d
Merge pull request #1317 from marekott/develop
AArnott Aug 31, 2021
b676113
Merge pull request #1314 from AArnott/fix1308
AArnott Sep 2, 2021
edbf65e
Merge pull request #1315 from AArnott/fix832
AArnott Sep 2, 2021
683d464
Merge pull request #1285 from AArnott/fix634
AArnott Sep 2, 2021
e2c83c4
Show build status of last build of master
AArnott Sep 20, 2021
14272ce
Use Ubuntu 18 instead of 16 in AzP
AArnott Nov 3, 2021
2153355
Drop netcoreapp2.1 support
AArnott Nov 3, 2021
5c0220e
Fix up build issues
AArnott Nov 3, 2021
96a5722
Demand an agent running Unity v2019.1
AArnott Nov 3, 2021
cb07354
Update to .NET SDK 5.0.401
AArnott Nov 3, 2021
e630a16
Install ASP.NET runtime
AArnott Nov 3, 2021
2119ae6
removing HashCode when Unity uses netstandard2.1
neuecc Nov 4, 2021
c388235
some dynamic test disable in Unity
neuecc Nov 4, 2021
770f341
add msgPack.dll reference to Unity's Tests.asmdef
neuecc Nov 4, 2021
27bee71
Fix up ASP.NET formatter to run on .NET Core 3.1
AArnott Nov 3, 2021
ae79dc6
Merge pull request #1345 from AArnott/dropUnsupportedPlatforms
AArnott Nov 5, 2021
5e3b107
Merge pull request #1347 from neuecc/master
AArnott Nov 5, 2021
791450b
Add support for the formatter singleton pattern to `MessagePackFormat…
AArnott Sep 22, 2021
8bffba2
Improve error message when the MessagePackFormatterAttribute formatte…
AArnott Sep 22, 2021
04cfbd7
Update generated code
AArnott Nov 5, 2021
b4fb2ed
Merge pull request #1330 from AArnott/fix1328
AArnott Nov 5, 2021
c22a7a2
Merge remote-tracking branch 'origin/master' into unity-netstandard21
neuecc Nov 8, 2021
69b8b5f
add dll references
neuecc Nov 9, 2021
d374efa
Merge pull request #1346 from neuecc/unity-netstandard21
AArnott Nov 9, 2021
1b22894
disable HashCode.cs if UNITY_2021_2_OR_NEWER
neuecc Dec 12, 2021
773e619
Merge pull request #1357 from neuecc/fix-nity2021-2-warning
neuecc Dec 13, 2021
e4fad53
Add CompressionMinLength parameter to MessagePackSerializerOptions
israellot Dec 15, 2021
c1e5f74
feat: Added DevelopmentDependency to MessagePackAnalyzer
HavenDV Dec 20, 2021
b2ab625
Fix cast bug (#1364)
pCYSl5EDgo Dec 25, 2021
76f3f65
Merge pull request #1361 from HavenDV/patch-1
AArnott Dec 25, 2021
11bdfed
Apply LZ4 minimum length to all compression types
AArnott Dec 25, 2021
0dc9c78
Merge pull request #1365 from neuecc/master
AArnott Dec 25, 2021
fed033d
.NET 6 Update (#1355)
pCYSl5EDgo Dec 25, 2021
5c8ab33
Promote Unshipped APIs to Shipped
AArnott Dec 25, 2021
1480c16
Merge remote-tracking branch 'upstream/develop' into promoteAPIs_develop
AArnott Dec 25, 2021
3e624b9
Merge pull request #1366 from AArnott/promoteAPIs
AArnott Dec 25, 2021
b30874c
Merge pull request #1367 from AArnott/promoteAPIs_develop
AArnott Dec 25, 2021
54b155f
Avoid C#10 global using name collisions (#1368)
pCYSl5EDgo Dec 27, 2021
1ce9b21
Global Using and File scoped namespace test
pCYSl5EDgo Dec 29, 2021
71a223a
Merge pull request #1371 from pCYSl5EDgo/test
AArnott Dec 29, 2021
c1090cc
Fix missing switch statement
steelywing Jan 21, 2022
cd75060
Merge pull request #1383 from steelywing/patch-1
AArnott Jan 26, 2022
7291fe6
Fix documented samples
AArnott Jan 26, 2022
4eca1e6
Added ResolverUtilitis.cs.meta, fix #1388
neuecc Jan 26, 2022
db187ed
Merge pull request #1389 from neuecc/fix-meta-missing
AArnott Jan 27, 2022
8da2ab0
Fix nullable annotation errorneous handling (#1395)
pCYSl5EDgo Feb 12, 2022
c9fad94
Fix for "System.NotImplementedException: byref delegate" in System.L…
Apr 1, 2022
e12b32f
update package.json to 2.3.85
neuecc Apr 12, 2022
270e04c
Merge pull request #1421 from neuecc/update-unity-packagejson
neuecc Apr 13, 2022
a70e019
Resolve merge conflicts with develop
AArnott May 12, 2022
5484c90
Update SDK to 6.0.300
AArnott May 24, 2022
c3fcd1d
Merge pull request #1436 from AArnott/sdkUpdate
AArnott May 24, 2022
50b549f
Update Nerdbank.Streams
AArnott May 24, 2022
c7ef724
Add built-in support for .NET 6 `DateOnly` and `TimeOnly` types
AArnott May 24, 2022
14ed43c
Workaround https://github.com/dotnet/roslyn/issues/61478
AArnott May 24, 2022
623aaf2
Merge pull request #1427 from AArnott/fix1240_dateonly
AArnott May 24, 2022
bf892e7
Suppress CS1591 warnings in generated code
AArnott Jun 7, 2022
9f5b506
Merge pull request #1440 from AArnott/fix1433
AArnott Jun 7, 2022
7e1629e
Merge branch 'master' into mergeMasterToDevelop
AArnott Jun 9, 2022
cf86d7c
Update package.json version to 2.3.112 to match latest release
AArnott Jun 9, 2022
69d190d
Merge pull request #1443 from AArnott/mergeMasterToDevelop
AArnott Jun 9, 2022
9a3eb9c
MessagePack.Generator RollForward to Major
neuecc Jun 10, 2022
c0e85a1
Build 2.4 as stable version
AArnott Jun 14, 2022
de58043
Merge branch 'master' into develop
AArnott Jun 14, 2022
a032406
Apply better workaround for https://github.com/dotnet/roslyn/issues/6…
AArnott Jun 14, 2022
a346d11
Drop net5.0 runtime targets
AArnott Jun 14, 2022
f1b42c0
Merge pull request #1445 from neuecc/generator-rollforward-major
AArnott Jun 14, 2022
888ecb2
Merge pull request #1448 from AArnott/dropNet5.0
AArnott Jun 16, 2022
c357cd8
Bump Newtonsoft.Json from 10.0.3 to 13.0.1 in /sandbox/Sandbox
dependabot[bot] Jun 22, 2022
0eeb64b
Bump Newtonsoft.Json in /benchmark/SerializerBenchmark
dependabot[bot] Jun 22, 2022
1e1c4cf
Merge pull request #1453 from neuecc/dependabot/nuget/benchmark/Seria…
AArnott Jun 23, 2022
3a7ef80
Merge pull request #1452 from neuecc/dependabot/nuget/sandbox/Sandbox…
AArnott Jun 23, 2022
3074ea9
add meta
neuecc Jun 23, 2022
9a2acd8
Add option to avoid large buffer allocations
AArnott Jun 23, 2022
f94fbf5
Merge pull request #1455 from neuecc/unity-meta
AArnott Jun 23, 2022
64ee45c
Merge pull request #1457 from AArnott/reduceLOHimpact
AArnott Jun 27, 2022
7a4a9ef
Several lines of code were deleted (which were not deleted in previou…
Jun 28, 2022
8ef5aec
Merge pull request #1 from neuecc/master
MaximMikhisor Jun 28, 2022
eab5122
Set unity package.json file for v2.4.35
AArnott Jun 28, 2022
ebb2040
Skip type collection if property has MessagePackFormatterAttribute
gllebede Jun 29, 2022
3cd5534
Changes to fixx issues to pass CI build pipeline.
Jul 3, 2022
287c4f7
Small bug fix
Jul 3, 2022
8fe5fc9
Merge pull request #1462 from gllebede/user/gllebede/skip_properties_…
AArnott Jul 23, 2022
eb6b93b
Revise the fix slightly
AArnott Jul 23, 2022
d75c56a
Merge pull request #3 from AArnott/pr1461
MaximMikhisor Jul 24, 2022
1092f85
Fix PerBenchmarkDotNet project
AArnott Aug 2, 2022
37e2dbc
Add non-generic serialize/deserialize perf tests
AArnott Aug 2, 2022
541ad7c
Merge pull request #1461 from LineSmarts/master
AArnott Aug 2, 2022
10955cc
Merge pull request #1478 from AArnott/nongenericperftests
AArnott Aug 2, 2022
0eccfe5
Bug with long & double is fixed.
ValkaVales Aug 12, 2022
94d8619
Merge pull request #1481 from ValkaVales/patch-1
AArnott Aug 12, 2022
3d1b75b
Scrub nuget.config
pranavkm Feb 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Visible="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.2.7-beta" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.5.124-alpha" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" PrivateAssets="all" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.244" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.0.64" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.261" PrivateAssets="all" />
</ItemGroup>

<Target Name="PrepareReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion">
Expand Down
16 changes: 16 additions & 0 deletions Directory.Build.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#------------------------------------------------------------------------------
# This file contains command-line options that MSBuild will process as part of
# every build, unless the "/noautoresponse" switch is specified.
#
# MSBuild processes the options in this file first, before processing the
# options on the command line. As a result, options on the command line can
# override the options in this file. However, depending on the options being
# set, the overriding can also result in conflicts.
#
# NOTE: The "/noautoresponse" switch cannot be specified in this file, nor in
# any response file that is referenced by this file.
#------------------------------------------------------------------------------
/nr:false
/m
/verbosity:minimal
/clp:Summary;ForceNoAlign
122 changes: 7 additions & 115 deletions MessagePack.sln

Large diffs are not rendered by default.

156 changes: 116 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Releases](https://img.shields.io/github/release/neuecc/MessagePack-CSharp.svg)][Releases]

[![Join the chat at https://gitter.im/MessagePack-CSharp/Lobby](https://badges.gitter.im/MessagePack-CSharp/Lobby.svg)](https://gitter.im/MessagePack-CSharp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://dev.azure.com/ils0086/MessagePack-CSharp/_apis/build/status/MessagePack-CSharp-CI)](https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2)
[![Build Status](https://dev.azure.com/ils0086/MessagePack-CSharp/_apis/build/status/MessagePack-CSharp-CI?branchName=master)](https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2&branchName=master)

The extremely fast [MessagePack](http://msgpack.org/) serializer for C#.
It is 10x faster than [MsgPack-Cli](https://github.com/msgpack/msgpack-cli) and outperforms other C# serializers. MessagePack for C# also ships with built-in support for LZ4 compression - an extremely fast compression algorithm. Performance is important, particularly in applications like games, distributed computing, microservices, or data caches.
Expand Down Expand Up @@ -34,6 +34,7 @@ MessagePack has a compact binary size and a full set of general purpose expressi
- [Security](#security)
- [Performance](#performance)
- [Deserialization Performance for different options](#deserialization-performance-for-different-options)
- [String interning](#string-interning)
- [LZ4 Compression](#lz4-compression)
- [Attributions](#attributions)
- [Comparison with protobuf, JSON, ZeroFormatter](#comparison-with-protobuf-json-zeroformatter)
Expand Down Expand Up @@ -184,7 +185,7 @@ These types can serialize by default:
* Primitives (`int`, `string`, etc...), `Enum`s, `Nullable<>`, `Lazy<>`
* `TimeSpan`, `DateTime`, `DateTimeOffset`
* `Guid`, `Uri`, `Version`, `StringBuilder`
* `BigInteger`, `Complex`
* `BigInteger`, `Complex`, `Half`
* `Array[]`, `Array[,]`, `Array[,,]`, `Array[,,,]`, `ArraySegment<>`, `BitArray`
* `KeyValuePair<,>`, `Tuple<,...>`, `ValueTuple<,...>`
* `ArrayList`, `Hashtable`
Expand Down Expand Up @@ -404,6 +405,8 @@ public struct Point
}
```

### C# 9 `record` types

C# 9.0 record with primary constructor is similar immutable object, also supports serialize/deserialize.

```csharp
Expand All @@ -412,8 +415,26 @@ C# 9.0 record with primary constructor is similar immutable object, also support

// use property: to set KeyAttribute
[MessagePackObject] public record Point([property:Key(0)] int X, [property: Key(1)] int Y);

// Or use explicit properties
[MessagePackObject]
public record Person
{
[Key(0)]
public string FirstName { get; init; }

[Key(1)]
public string LastName { get; init; }
}
```

### C# 9 `init` property setter limitations

When using `init` property setters in _generic_ classes, [a CLR bug](https://github.com/neuecc/MessagePack-CSharp/issues/1134) prevents our most efficient code generation from invoking the property setter.
As a result, you should avoid using `init` on property setters in generic classes when using the public-only `DynamicObjectResolver`/`StandardResolver`.

When using the `DynamicObjectResolverAllowPrivate`/`StandardResolverAllowPrivate` resolver the bug does not apply and you may use `init` without restriction.

## Serialization Callback

Objects implementing the `IMessagePackSerializationCallbackReceiver` interface will received `OnBeforeSerialize` and `OnAfterDeserialize` calls during serialization/deserialization.
Expand Down Expand Up @@ -679,7 +700,7 @@ Benchmarks comparing MessagePack For C# to other serializers were run on `Window
* Avoid string key decoding for lookup maps (string key and use automata based name lookup with inlined IL code generation, see: [AutomataDictionary](https://github.com/neuecc/MessagePack-CSharp/blob/bcedbce3fd98cb294210d6b4a22bdc4c75ccd916/src/MessagePack/Internal/AutomataDictionary.cs)
* To encode string keys, use pre-generated member name bytes and fixed sized byte array copies in IL, see: [UnsafeMemory.cs](https://github.com/neuecc/MessagePack-CSharp/blob/f17ddc5d107d3a2f66f60398b214ef87919ff892/src/MessagePack/Internal/UnsafeMemory.cs)

Before creating this library, I implemented a fast fast serializer with [ZeroFormatter#Performance](https://github.com/neuecc/ZeroFormatter#performance). This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections).
Before creating this library, I implemented a fast serializer with [ZeroFormatter#Performance](https://github.com/neuecc/ZeroFormatter#performance). This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections).

### <a name="deserialize-performance"></a>Deserialization Performance for different options

Expand Down Expand Up @@ -738,6 +759,49 @@ Extra note, this is serialization benchmark result.

Of course, `IntKey` is fastest but `StringKey` also performs reasonably well.

### <a name="string-interning"></a>String interning

The msgpack format does not provide for reusing strings in the data stream.
This naturally leads the deserializer to create a new `string` object for every string encountered,
even if it is equal to another string previously encountered.

When deserializing data that may contain the same strings repeatedly it can be worthwhile
to have the deserializer take a little extra time to check whether it has seen a given string before
and reuse it if it has.

To enable string interning on *all* string values, use a resolver that specifies `StringInterningFormatter`
before any of the standard ones, like this:

```cs
var options = MessagePackSerializerOptions.Standard.WithResolver(
CompositeResolver.Create(
new IMessagePackFormatter[] { new StringInterningFormatter() },
new IFormatterResolver[] { StandardResolver.Instance }));

MessagePackSerializer.Deserialize<ClassOfStrings>(data, options);
```

If you know which fields of a particular type are likely to contain duplicate strings,
you can apply the string interning formatter to just those fields so the deserializer only pays
for the interned string check where it matters most.
Note that this technique requires a `[MessagePackObject]` or `[DataContract]` class.

```cs
[MessagePackObject]
public class ClassOfStrings
{
[Key(0)]
[MessagePackFormatter(typeof(StringInterningFormatter))]
public string InternedString { get; set; }

[Key(1)]
public string OrdinaryString { get; set; }
}
```

If you are writing your own formatter for some type that contains strings,
you can call on the `StringInterningFormatter` directly from your formatter as well for the strings.

## LZ4 Compression

MessagePack is a fast and *compact* format but it is not compression. [LZ4](https://github.com/lz4/lz4) is an extremely fast compression algorithm, and using it MessagePack for C# can achieve extremely fast performance as well as extremely compact binary sizes!
Expand Down Expand Up @@ -1068,7 +1132,7 @@ Here is an example of such a custom formatter implementation. Note its use of th

```csharp
/// <summary>Serializes a <see cref="FileInfo" /> by its full path as a string.</summary>
public class FileInfoFormatter<T> : IMessagePackFormatter<FileInfo>
public class FileInfoFormatter : IMessagePackFormatter<FileInfo>
{
public void Serialize(
ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options)
Expand Down Expand Up @@ -1111,7 +1175,7 @@ you must precede it with a map or array header. You must read the entire map/arr
For example:

```csharp
public class MySpecialObjectFormatter<T> : IMessagePackFormatter<MySpecialObject>
public class MySpecialObjectFormatter : IMessagePackFormatter<MySpecialObject>
{
public void Serialize(
ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options)
Expand Down Expand Up @@ -1149,15 +1213,18 @@ public class MySpecialObjectFormatter<T> : IMessagePackFormatter<MySpecialObject
int count = reader.ReadArrayHeader();
for (int i = 0; i < count; i++)
{
case 0:
fullName = reader.ReadString();
break;
case 1:
age = reader.ReadInt32();
break;
default:
reader.Skip();
break;
switch (i)
{
case 0:
fullName = reader.ReadString();
break;
case 1:
age = reader.ReadInt32();
break;
default:
reader.Skip();
break;
}
}

reader.Depth--;
Expand Down Expand Up @@ -1342,12 +1409,6 @@ internal static class SampleCustomResolverGetFormatterHelper
return formatter;
}

// If target type is generics, use MakeGenericType.
if (t.IsGenericParameter && t.GetGenericTypeDefinition() == typeof(ValueTuple<,>))
{
return Activator.CreateInstance(typeof(ValueTupleFormatter<,>).MakeGenericType(t.GenericTypeArguments));
}

// If type can not get, must return null for fallback mechanism.
return null;
}
Expand Down Expand Up @@ -1435,30 +1496,44 @@ var resolver = MessagePack.Resolvers.CompositeResolver.Create(

## Reserved Extension Types

MessagePack for C# already used some MessagePack extension type codes, be careful to use same ext code.
MessagePack for C# already used some MessagePack extension type codes, be careful to avoid using the same ext code for other purposes.

Range | Reserved for
--|--
\[-128, -1\] | Reserved by the msgpack spec for predefined types
\[30, 120) | Reserved for this library's use to support common types in .NET

This leaves the following ranges for your use:

- \[0, 30)
- \[120, 127]

Within the *reserved* ranges, this library defines or implements extensions that use these type codes:

| Code | Type | Use by |
| --- | --- | --- |
| -1 | DateTime | MessagePack-spec reserved for timestamp |
| 30 | Vector2[] | for Unity, UnsafeBlitFormatter |
| 31 | Vector3[] | for Unity, UnsafeBlitFormatter |
| 32 | Vector4[] | for Unity, UnsafeBlitFormatter |
| 33 | Quaternion[] | for Unity, UnsafeBlitFormatter |
| 34 | Color[] | for Unity, UnsafeBlitFormatter |
| 35 | Bounds[] | for Unity, UnsafeBlitFormatter |
| 36 | Rect[] | for Unity, UnsafeBlitFormatter |
| 37 | Int[] | for Unity, UnsafeBlitFormatter |
| 38 | Float[] | for Unity, UnsafeBlitFormatter |
| 39 | Double[] | for Unity, UnsafeBlitFormatter |
| 98 | All | MessagePackCompression.Lz4BlockArray |
| 99 | All | MessagePackCompression.Lz4Block |
| 100 | object | TypelessFormatter |
| ---- | ---- | --- |
| -1 | DateTime | MessagePack-spec reserved for timestamp |
| 30 | Vector2[] | for Unity, UnsafeBlitFormatter |
| 31 | Vector3[] | for Unity, UnsafeBlitFormatter |
| 32 | Vector4[] | for Unity, UnsafeBlitFormatter |
| 33 | Quaternion[] | for Unity, UnsafeBlitFormatter |
| 34 | Color[] | for Unity, UnsafeBlitFormatter |
| 35 | Bounds[] | for Unity, UnsafeBlitFormatter |
| 36 | Rect[] | for Unity, UnsafeBlitFormatter |
| 37 | Int[] | for Unity, UnsafeBlitFormatter |
| 38 | Float[] | for Unity, UnsafeBlitFormatter |
| 39 | Double[] | for Unity, UnsafeBlitFormatter |
| 98 | All | MessagePackCompression.Lz4BlockArray |
| 99 | All | MessagePackCompression.Lz4Block |
| 100 | object | TypelessFormatter |

## Unity support

Unity lowest supported version is `2018.3`, API Compatibility Level supports both `.NET 4.x` and `.NET Standard 2.0`.

You can install the `unitypackage` from the [releases][Releases] page. If your build targets PC, you can use it as is, but if your build targets IL2CPP, you can not use `Dynamic***Resolver`, so it is required to use pre-code generation. Please see [pre-code generation section](#aot).
You can install the `unitypackage` from the [releases][Releases] page.
If your build targets .NET Framework 4.x and runs on mono, you can use it as is.
But if your build targets IL2CPP, you can not use `Dynamic***Resolver`, so it is required to use pre-code generation. Please see [pre-code generation section](#aot).

MessagePack for C# includes some additional `System.*.dll` libraries that originally provides in NuGet. They are located under `Plugins`. If other packages use these libraries (e.g. Unity Collections package using `System.Runtime.CompilerServices.Unsafe.dll`), to avoid conflicts, please delete the DLL under `Plugins`.

Expand Down Expand Up @@ -1504,7 +1579,8 @@ If you want to share a class between Unity and a server, you can use `SharedProj
By default, MessagePack for C# serializes custom objects by [generating IL](https://msdn.microsoft.com/en-us/library/system.reflection.emit.ilgenerator.aspx) on the fly at runtime to create custom, highly tuned formatters for each type. This code generation has a minor upfront performance cost.
Because strict-AOT environments such as Xamarin and Unity IL2CPP forbid runtime code generation, MessagePack provides a way for you to run a code generator ahead of time as well.

> Note: When Unity targets the PC it allows dynamic code generation, so AOT is not required.
> Note: When using Unity, dynamic code generation only works when targeting .NET Framework 4.x + mono runtime.
For all other Unity targets, AOT is required.

If you want to avoid the upfront dynamic generation cost or you need to run on Xamarin or Unity, you need AOT code generation. `mpc` (MessagePackCompiler) is the code generator of MessagePack for C#. mpc uses [Roslyn](https://github.com/dotnet/roslyn) to analyze source code.

Expand All @@ -1526,7 +1602,7 @@ Check in your `.config\dotnet-tools.json` file. On another machine you can "rest
Once you have the tool installed, simply invoke using `dotnet mpc` within your repo:

```
dotnet mpc -h
dotnet mpc --help
```

Alternatively, you can download mpc from the [releases][Releases] page, that includes platform native binaries (that don't require a separate dotnet runtime).
Expand All @@ -1535,7 +1611,7 @@ Alternatively, you can download mpc from the [releases][Releases] page, that inc
Usage: mpc [options...]

Options:
-i, -input <String> Input path of analyze csproj or directory, if input multiple csproj split with ','. (Required)
-i, -input <String> Input path to MSBuild project file or the directory containing Unity source files. (Required)
-o, -output <String> Output file path(.cs) or directory(multiple generate file). (Required)
-c, -conditionalSymbol <String> Conditional compiler symbols, split with ','. (Default: null)
-r, -resolverName <String> Set resolver name. (Default: GeneratedResolver)
Expand Down
14 changes: 8 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stages:
jobs:
- job: Windows
pool:
vmImage: windows-2019
vmImage: windows-2022
steps:
- checkout: self
clean: true
Expand All @@ -33,7 +33,9 @@ stages:
- job: Unity
pool:
name: CustomAgents
demands: UNITYHUB_EDITORS_FOLDER_LOCATION
demands:
- UNITYHUB_EDITORS_FOLDER_LOCATION
- UNITYVERSION -equals 2019.1
steps:
- checkout: self
clean: true
Expand All @@ -42,7 +44,7 @@ stages:

- job: Linux
pool:
vmImage: Ubuntu 16.04
vmImage: ubuntu-20.04
steps:
- checkout: self
clean: true
Expand All @@ -51,7 +53,7 @@ stages:

- job: macOS
pool:
vmImage: macOS-10.15
vmImage: macOS-11
steps:
- checkout: self
clean: true
Expand All @@ -62,7 +64,7 @@ stages:
# It also helps exercise mpc so bugs don't go unnoticed.
- job: codegen_diff
pool:
vmImage: ubuntu-latest
vmImage: ubuntu-20.04
steps:
- checkout: self
clean: true
Expand All @@ -82,7 +84,7 @@ stages:
jobs:
- job: push
pool:
vmImage: ubuntu-latest
vmImage: ubuntu-20.04
steps:
- download: current
artifact: nuget
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines/Get-TempToolsPath.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if ($env:AGENT_TOOLSDIRECTORY) {
$path = "$env:AGENT_TOOLSDIRECTORY\vs-platform\tools"
if ($env:AGENT_TEMPDIRECTORY) {
$path = "$env:AGENT_TEMPDIRECTORY\$env:BUILD_BUILDID"
} elseif ($env:localappdata) {
$path = "$env:localappdata\vs-platform\tools"
$path = "$env:localappdata\gitrepos\tools"
} else {
$path = "$PSScriptRoot\..\obj\tools"
}
Expand Down
6 changes: 1 addition & 5 deletions azure-pipelines/Get-nbgv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ if ($existingTool) {
return $existingTool.Path
}

if ($env:AGENT_TEMPDIRECTORY) {
$toolInstallDir = "$env:AGENT_TEMPDIRECTORY/$env:BUILD_BUILDID"
} else {
$toolInstallDir = "$PSScriptRoot/../obj/tools"
}
$toolInstallDir = & "$PSScriptRoot/Get-TempToolsPath.ps1"

$toolPath = "$toolInstallDir/nbgv"
if (!(Test-Path $toolInstallDir)) { New-Item -Path $toolInstallDir -ItemType Directory | Out-Null }
Expand Down
10 changes: 3 additions & 7 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
steps:
# Use VSBuild to pack because `dotnet pack` can't build VSIX projects.
- task: VSBuild@1
- task: DotNetCoreCLI@2
inputs:
vsVersion: 16.0
solution: MessagePack.sln
msbuildArgs: /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
command: build
arguments: --configuration $(BuildConfiguration) /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
displayName: Build MessagePack.sln

- task: DotNetCoreCLI@2
Expand Down
Loading