Descent.RngKit.Serialization 0.1.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Descent.RngKit.Serialization --version 0.1.0
                    
NuGet\Install-Package Descent.RngKit.Serialization -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Descent.RngKit.Serialization" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Descent.RngKit.Serialization" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Descent.RngKit.Serialization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Descent.RngKit.Serialization --version 0.1.0
                    
#r "nuget: Descent.RngKit.Serialization, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Descent.RngKit.Serialization@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Descent.RngKit.Serialization&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Descent.RngKit.Serialization&version=0.1.0
                    
Install as a Cake Tool

Descent.RngKit.Serialization

Opt-in System.Text.Json serialization for Descent.RngKit — a zero-allocation, never-throw dice expression engine for high-concurrency virtual tabletops.

This package contains one type: RngKitJsonContext, the source-generated JsonSerializerContext for RngAuditPacket and the contracts it carries. It depends on Descent.RngKit.Abstractions and nothing depends on it.

dotnet add package Descent.RngKit.Serialization --version 0.1.0

Pre-1.0. Below 1.0.0 the public API is unstable by declaration — SemVer permits breaking changes in any 0.x minor release — so pin an exact version rather than a floating range.

Usage

using System.Text.Json;
using Descent.RngKit.Serialization;

string json   = JsonSerializer.Serialize(packet, RngKitJsonContext.Default.RngAuditPacket);
var    packet = JsonSerializer.Deserialize(json, RngKitJsonContext.Default.RngAuditPacket);

Source-generated rather than reflection-based, so it is Native AOT and trim safe: no IL2026/IL3050 warnings and no runtime code generation. Polymorphic IRngMetadata payloads round-trip through the [JsonPolymorphic] / [JsonDerivedType] discriminators declared on the interface in Descent.RngKit.Abstractions.

Why this is a separate package

Descent.RngKit.Abstractions describes what a roll result is. It takes no position on how you put it on a wire, so a host using MessagePack, protobuf, or any other format does not carry a JSON serializer in its contract layer.

Splitting it out took Descent.RngKit.Abstractions.dll from 261,632 to 100,864 bytes (−61.5%), both measured on the x64 Release build. That is worth having for NuGet download size, for framework-dependent deployments, and for hosts that map contract assemblies into per-plugin AssemblyLoadContext sandboxes, where each loaded assembly costs metadata.

It does not shrink a Native AOT image, and it was never going to. ILCompiler already strips an unreferenced JsonSerializerContext — it is an ordinary class, and nothing about [JsonSerializable] roots it. A non-serializing consumer measured byte-identical before and after the split: 3,880,448 bytes either way. The general point, since it is easy to get wrong: under Native AOT the unit of dead-code elimination is reachability, not assembly, so splitting a package is not a trimming strategy. The control experiment is recorded in §3.1a of the multi-angle review.

MIT © DescentVTT Team

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated