Major release (1.0.0): .NET 10 only and Position as a value type - #8
Merged
Conversation
BREAKING: target .NET 10 only, dropping the net8.0 multi-targeting from the previous minor release. CI updated to test net10.0 only and no longer installs the .NET 8 SDK. BREAKING: Position is now a `readonly record struct` (value type) instead of a `record` class. This removes a heap allocation per decoded position: a standalone Position is now 0 B (was 32 B), and a Class A position report drops from 2 allocations / 128 B to 1 allocation / 112 B. Bump to the 1.0 major version via GitVersion next-version, and document the breaking changes in PackageReleaseNotes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3BkmohCNRYGY1RBKbNaCx
There was a problem hiding this comment.
Pull request overview
This PR prepares the 1.0.0 major release of Ais.Net.Models by moving the repo to .NET 10 only and reworking the core Position model into a value type to eliminate per-message heap allocations on decode paths.
Changes:
- Drop multi-targeting and standardize projects/CI on net10.0 only.
- Change
Positionfrom a record class to areadonly record structand document the allocation rationale. - Update versioning (GitVersion) and refresh packaging/benchmarks to reflect the new runtime and type semantics.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/Position.cs | Converts Position to a readonly record struct and adds remarks explaining the allocation/perf motivation. |
| Solutions/Ais.Net.Models/Ais.Net.Models.csproj | Switches to single-target net10.0 and updates PackageReleaseNotes for the 1.0 breaking changes. |
| Solutions/Ais.Net.Models.Specs/packages.lock.json | Removes the net8.0 dependency set, leaving net10.0 as the sole locked framework. |
| Solutions/Ais.Net.Models.Specs/Ais.Net.Models.Specs.csproj | Switches the test project to single-target net10.0. |
| Solutions/Ais.Net.Models.Benchmarks/PositionBenchmarks.cs | Updates benchmarks to reflect the new Position value type and exercises factory creation. |
| GitVersion.yml | Updates next-version to 1.0 for the major release. |
| .github/workflows/build.yml | Updates CI to test only net10.0 and removes the .NET 8 SDK install. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Seal the seven leaf AIS message records. This expresses their leaf-type intent for the major release and lets the JIT devirtualise equality/interface calls. It is allocation-neutral (message construction cost is unchanged). - CleanVesselName now returns the input unchanged when it needs no '@'/space trimming and has no interior double-spaces to collapse, avoiding a string allocation for the common already-clean case (48 B -> 0 B, benchmark-confirmed). - Add an already-clean name parameter to VesselNameBenchmarks to cover the fast path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3BkmohCNRYGY1RBKbNaCx
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major release (1.0.0) — the breaking follow-up to the modernization PR. Now .NET 10 only, with
Positionreworked as a value type.Breaking changes
net8.0;net10.0; this dropsnet8.0. Consumers must be on .NET 10. CI now testsnet10.0only and no longer installs the .NET 8 SDK.Positionis now areadonly record struct(value type) instead of arecordclass. Value-based equality and thePosition?usages on the message records are unchanged, but this is a binary-breaking type change.Performance
Making
Positiona value type removes a heap allocation per decoded position (measured with BenchmarkDotNet /MemoryDiagnoser):PositionVersioning
Bumped to 1.0.0 via GitVersion (
next-version: 0.3→1.0).PackageReleaseNotesdocuments the breaking changes. The package ships a singlelib/net10.0/assembly with XML documentation.Verification
Ais.Net.Models.1.0.0.nupkg, singlelib/net10.0/target.🤖 Generated with Claude Code