Skip to content

[RELEASE] 3.0#1070

Draft
mtmk wants to merge 15 commits intomainfrom
release/3.0
Draft

[RELEASE] 3.0#1070
mtmk wants to merge 15 commits intomainfrom
release/3.0

Conversation

@mtmk
Copy link
Copy Markdown
Member

@mtmk mtmk commented Feb 18, 2026

mtmk and others added 2 commits February 18, 2026 11:19
- Initial release with .NET 10 target
- Also dropped .NET 6 target
@mtmk mtmk added this to the Release 3.0 milestone Feb 19, 2026
@mtmk mtmk mentioned this pull request Feb 19, 2026
4 tasks
@mtmk mtmk self-assigned this Feb 24, 2026
@mtmk mtmk changed the title Release 3.0 Line [RELEASE[ 3.0 Feb 25, 2026
@mtmk mtmk changed the title [RELEASE[ 3.0 [RELEASE] 3.0 Feb 25, 2026
mtmk added 2 commits February 27, 2026 08:56
* Clean up NET6 and optimize NETSTANDARD

- Remove .NET 5/6/7 from `#if` directives and build
- Delete commented-out file
- Optimize NETSTANDARD encoding polyfills used in hot paths
  to eliminate intermediate array allocations
- Fix `PeriodicTimer` CancellationTokenRegistration leak
- Add encoding polyfill benchmark

* Fix `PeriodicTimer` cancellation to prevent leak

- Ensure static lambda used to avoid allocation.
Switch project dependency from `NATS.Net` to `NATS.Client.Simplified` for better modularity. Add `NATS.Extensions.Microsoft.DependencyInjection` to `NATS.Net` dependencies. Update documentation to include comparisons between `NATS.Extensions.Microsoft.DependencyInjection` and `NATS.Client.Hosting`, clarifying usage scenarios. Add new DI guide to advanced docs.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 27, 2026

mtmk and others added 10 commits March 4, 2026 12:37
# Conflicts:
#	src/NATS.Client.Core/NATS.Client.Core.csproj
# Conflicts:
#	version.txt
# Conflicts:
#	src/NATS.Client.Core/NATS.Client.Core.csproj
#	src/NATS.Client.Core/NKeyPair.cs
#	version.txt
* Add support for optional NATS headers in serialization/deserialization

* Make `Serialize` method header-aware and add unit tests for header serialization logic

* Add recursion guard to prevent infinite loops in default interface methods for `Serialize`/`Deserialize`, update tests and examples accordingly

* Fix `Content-Type` header deserialization by updating to use `StringValues`

* Fix NuidTests flap

* Improve NuidTests stability

* Remove old default methods

* Remove `IDictionary` implementation from `NatsHeaders`

* Add INatsSerializeWithHeaders

* serializer: remove unnecessary obsolete warning pragmas

The CS0618 suppressions were leftover from the DIM approach
where interface members were marked obsolete. No longer needed
with the separate interface design.

* tests: add serialization extension and ABI checks

Add unit tests for NatsSerializationExtensions covering both
the header-aware path and the fallback path for serialize and
deserialize. Make the ABI check program assert correctness
instead of just printing, including the new WithHeaders
interfaces.

* serializer: replace WithHeaders with WithContext interfaces

Replace INatsSerializeWithHeaders<T>/INatsDeserializeWithHeaders<T>
with INatsSerializeWithContext<T>/INatsDeserializeWithContext<T>,
passing a NatsMsgContext struct that carries Subject, ReplyTo, and
Headers.

This gives serializers access to the full message envelope, enabling
subject-based dispatch and reply-to inspection without requiring
further interface changes in the future.

Also fixes the null-headers asymmetry in the extension methods:
both Serialize and Deserialize now always dispatch to the context
overload when the interface is implemented, regardless of whether
Headers is null.

* Revert "Improve NuidTests stability"

This reverts commit 42b8cbd.

* Revert "Fix NuidTests flap"

This reverts commit dcc3588.

* docs: fix stale DIM references and update serialization docs

Remove incorrect DIM claims from serialization docs, rewrite the
headers section to describe the WithContext interface design. Clean
up NativeAot example that had leftover INatsHeaders parameter
overloads from the old DIM approach. Restore dropped <returns>
doc comment on INatsDeserialize<T>.Deserialize.

* headers: drop read-only state

The read-only flag was set on NatsHeaders before passing to publish to
catch accidental mutation after publish. It was a weak guarantee since
headers are copied to a byte buffer synchronously inside CommandWriter,
so post-publish mutation cannot affect wire data anyway.

Removing it lets serializers implementing INatsSerializeWithContext<T>
mutate headers (e.g. set Content-Type) during serialization, which was
otherwise blocked by ThrowIfReadOnly. Telemetry's SetOverrideReadOnly
escape hatch is no longer needed and uses the normal indexer instead.

* tests: add net10.0 TFM and improve ABI checks

Add net10.0 target to CoreUnit, Core, and Core2 test projects.
Add CheckAbiOld control project that runs against the old NuGet
version to prove type forwarding works by contrasting assembly
versions. Centralize the old NuGet version in Directory.Build.props
and make the run script assert loaded assembly versions.

* tests: fix NU1510 package pruning errors on net10.0

Condition System.Net.Http and System.Text.RegularExpressions
package references to net481 only, where they are actually needed.
On net10.0 these are built-in and NuGet's package pruning treats
the unnecessary references as errors.

* serializers: address context review feedback

- NatsMsgContext: require Subject via constructor; drop init setters so
  netstandard shim for IsExternalInit is no longer needed.
- Add INatsSerializerWithContext<T> as a combined interface mirroring
  INatsSerializer<T>, simplifying class declarations for context-aware
  serializer+deserializer pairs.
- Built-in NatsUtf8PrimitivesSerializer, NatsRawSerializer and
  NatsJsonContextSerializer now implement INatsSerializerWithContext<T>
  and propagate the context through _next when delegating. Without this,
  chaining a built-in with a context-aware leaf silently dropped context
  at the leaf.
- Document NatsHeaders thread-safety: not safe to share across concurrent
  publishes, since readonly-locking was removed.
- Document that header-mutating serializers must get non-null headers
  from the caller; the library does not allocate on their behalf.
- Add chain-propagation tests for serialize and deserialize paths.

* sln: remove x64/x86 platform noise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant