Skip to content

Commit

Permalink
Release 5.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jun 20, 2024
1 parent f63a24c commit c3cf40e
Show file tree
Hide file tree
Showing 67 changed files with 1,911 additions and 367 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
obj/
.vs/
.vscode/
.idea/
.nuget/
logo.svg
favicon.ico
manifest.json
BenchmarkDotNet.Artifacts/
FodyWeavers.xsd
launchSettings.json
*.csproj.user
*.user
*.coverage
TestResults/
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
Release Notes
====

# 06-20-2024
<a href="https://www.nuget.org/packages/dotnext/5.7.0">DotNext 5.7.0</a>
* `Timestamp.ElapsedTicks` returns a value that is always greater than zero
* Fixed hidden copies of value types caused by **in** modifier
* Added support of [TimeProvider](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider) to `Timestamp` and `Timeout` types

<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.7.0">DotNext.Metaprogramming 5.7.0</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.unsafe/5.7.0">DotNext.Unsafe 5.7.0</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.threading/5.7.0">DotNext.Threading 5.7.0</a>
* Fixed [241](https://github.com/dotnet/dotNext/issues/241)
* Introduced API for implementing leases, see `DotNext.Threading.Leases` namespace

<a href="https://www.nuget.org/packages/dotnext.io/5.7.0">DotNext.IO 5.7.0</a>
* Various performance improvements

<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.7.0">DotNext.Net.Cluster 5.7.0</a>
* Fixed [242](https://github.com/dotnet/dotNext/issues/242)

<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.7.0">DotNext.AspNetCore.Cluster 5.7.0</a>
* Fixed [242](https://github.com/dotnet/dotNext/issues/242)

# 06-07-2024
<a href="https://www.nuget.org/packages/dotnext.threading/5.5.0">DotNext.Metaprogramming 5.5.0</a>
* Fixed [240](https://github.com/dotnet/dotNext/issues/240)
Expand Down
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,31 @@ All these things are implemented in 100% managed code on top of existing .NET AP
* [NuGet Packages](https://www.nuget.org/profiles/rvsakno)

# What's new
Release Date: 06-07-2024
Release Date: 06-20-2024

<a href="https://www.nuget.org/packages/dotnext.threading/5.5.0">DotNext.Metaprogramming 5.5.0</a>
* Fixed [240](https://github.com/dotnet/dotNext/issues/240)
<a href="https://www.nuget.org/packages/dotnext/5.7.0">DotNext 5.7.0</a>
* `Timestamp.ElapsedTicks` returns a value that is always greater than zero
* Fixed hidden copies of value types caused by **in** modifier
* Added support of [TimeProvider](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider) to `Timestamp` and `Timeout` types

<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.7.0">DotNext.Metaprogramming 5.7.0</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.unsafe/5.7.0">DotNext.Unsafe 5.7.0</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.threading/5.7.0">DotNext.Threading 5.7.0</a>
* Fixed [241](https://github.com/dotnet/dotNext/issues/241)
* Introduced API for implementing leases, see `DotNext.Threading.Leases` namespace

<a href="https://www.nuget.org/packages/dotnext.io/5.7.0">DotNext.IO 5.7.0</a>
* Various performance improvements

<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.7.0">DotNext.Net.Cluster 5.7.0</a>
* Fixed [242](https://github.com/dotnet/dotNext/issues/242)

<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.7.0">DotNext.AspNetCore.Cluster 5.7.0</a>
* Fixed [242](https://github.com/dotnet/dotNext/issues/242)

Changelog for previous versions located [here](./CHANGELOG.md).

Expand Down
1 change: 1 addition & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
root=true

[*.cs]
max_line_length = 150
dotnet_diagnostic.AD0001.severity = none
dotnet_diagnostic.CA1000.severity = none
dotnet_diagnostic.CA1001.severity = warning
Expand Down
7 changes: 1 addition & 6 deletions src/DotNext.Benchmarks/DotNext.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>DotNext</RootNamespace>
<StartupObject>DotNext.Program</StartupObject>
<IsPackable>false</IsPackable>
<Version>5.0.0</Version>
<Version>5.7.0</Version>
<Authors>.NET Foundation and Contributors</Authors>
<Product>.NEXT Family of Libraries</Product>
<Description>Various benchmarks demonstrating performance aspects of .NEXT extensions</Description>
Expand All @@ -32,11 +32,6 @@
<Optimize>true</Optimize>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Bench|AnyCPU'">
<Optimize>true</Optimize>
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
</PropertyGroup>

Expand Down
12 changes: 2 additions & 10 deletions src/DotNext.IO/DotNext.IO.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
Expand All @@ -11,7 +11,7 @@
<Authors>.NET Foundation and Contributors</Authors>
<Company />
<Product>.NEXT Family of Libraries</Product>
<VersionPrefix>5.4.0</VersionPrefix>
<VersionPrefix>5.7.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<AssemblyName>DotNext.IO</AssemblyName>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand All @@ -29,17 +29,9 @@

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Bench|AnyCPU'">
<Optimize>true</Optimize>
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<SignAssembly>true</SignAssembly>
Expand Down
12 changes: 6 additions & 6 deletions src/DotNext.IO/IO/TextStreamExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static TextWriter AsTextWriter<TWriter>(this TWriter writer, Encoding enc
/// <returns>A task that represents the asynchronous write operation.</returns>
public static ValueTask WriteAsync(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(allocator), nameof(provider))] ref PoolingInterpolatedStringHandler handler, CancellationToken token = default)
{
return WriteAsync(writer, InterpolatedString.Interpolate(allocator, provider, in handler), token);
return WriteAsync(writer, InterpolatedString.Interpolate(allocator, provider, ref handler), token);

[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder))]
static async ValueTask WriteAsync(TextWriter writer, MemoryOwner<char> buffer, CancellationToken token)
Expand Down Expand Up @@ -151,9 +151,9 @@ public static ValueTask WriteLineAsync(this TextWriter writer, MemoryAllocator<c
/// <param name="allocator">The allocator for the buffer used by string interpolation handler.</param>
/// <param name="provider">Optional formatting provider to be applied for each interpolated string argument.</param>
/// <param name="handler">The interpolated string handler.</param>
public static void Write(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(allocator))] in PoolingInterpolatedStringHandler handler)
public static void Write(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(allocator))] ref PoolingInterpolatedStringHandler handler)
{
using var buffer = InterpolatedString.Interpolate(allocator, provider, in handler);
using var buffer = InterpolatedString.Interpolate(allocator, provider, ref handler);
writer.Write(buffer.Span);
}

Expand All @@ -163,8 +163,8 @@ public static void Write(this TextWriter writer, MemoryAllocator<char>? allocato
/// <param name="writer">An output for the interpolated string.</param>
/// <param name="allocator">The allocator for the buffer used by string interpolation handler.</param>
/// <param name="handler">The interpolated string handler.</param>
public static void Write(this TextWriter writer, MemoryAllocator<char>? allocator, [InterpolatedStringHandlerArgument(nameof(allocator))] in PoolingInterpolatedStringHandler handler)
=> Write(writer, allocator, null, in handler);
public static void Write(this TextWriter writer, MemoryAllocator<char>? allocator, [InterpolatedStringHandlerArgument(nameof(allocator))] ref PoolingInterpolatedStringHandler handler)
=> Write(writer, allocator, null, ref handler);

/// <summary>
/// Writes interpolated string and appends a new line after it.
Expand All @@ -176,7 +176,7 @@ public static void Write(this TextWriter writer, MemoryAllocator<char>? allocato
public static void WriteLine(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(allocator))] ref PoolingInterpolatedStringHandler handler)
{
handler.AppendLiteral(Environment.NewLine);
using var buffer = InterpolatedString.Interpolate(allocator, provider, in handler);
using var buffer = InterpolatedString.Interpolate(allocator, provider, ref handler);
writer.Write(buffer.Span);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
Expand All @@ -27,15 +27,10 @@
<IncludeSourceRevisionInInformationalVersion>true</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Bench|AnyCPU'">
<Optimize>true</Optimize>
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>true</Optimize>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
12 changes: 2 additions & 10 deletions src/DotNext.Metaprogramming/DotNext.Metaprogramming.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>DotNext</RootNamespace>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<IsTrimmable>false</IsTrimmable>
<Features>nullablePublicOnly</Features>
<VersionPrefix>5.3.1</VersionPrefix>
<VersionPrefix>5.7.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>.NET Foundation</Authors>
<Product>.NEXT Family of Libraries</Product>
Expand All @@ -26,17 +26,9 @@

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Bench|AnyCPU'">
<Optimize>true</Optimize>
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<SignAssembly>true</SignAssembly>
Expand Down
6 changes: 6 additions & 0 deletions src/DotNext.Tests/DelegateHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,10 @@ public static void ActionWrapper()

void SetLocalValue(int value) => i = value;
}

[Fact]
public static void Identity()
{
Equal(42, Func.Identity<int>().Invoke(42));
}
}
4 changes: 2 additions & 2 deletions src/DotNext.Tests/DotNext.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>DotNext</RootNamespace>
<LangVersion>latest</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<Version>5.0.0</Version>
<Version>5.7.0</Version>
<IsPackable>false</IsPackable>
<Authors>.NET Foundation and Contributors</Authors>
<Product>.NEXT Family of Libraries</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,34 @@ public static async Task Overwrite(long? maxLogEntrySize)
}
}

[Fact]
public static async Task OverwriteUnsealed()
{
var entry1 = new TestLogEntry("SET A = 0 SET B=1 SET C=2 SET D=3 SET E=4 SET F=5") { Term = 42L };
var entry2 = new TestLogEntry("SET Y = 1") { Term = 43L };
Func<IReadOnlyList<IRaftLogEntry>, long?, CancellationToken, ValueTask<Missing>> checker;
var dir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
using (var state = new PersistentStateWithoutSnapshot(dir, RecordsPerPartition, new() { UseCaching = false }))
{
Equal(1L, await state.AppendAsync(entry1));
await state.AppendAsync(entry2, 1L);
}

//read again
using (var state = new PersistentStateWithoutSnapshot(dir, RecordsPerPartition, new() { UseCaching = false }))
{
checker = async (entries, snapshotIndex, token) =>
{
Null(snapshotIndex);
Single(entries);
False(entries[0].IsSnapshot);
Equal(entry2.Content, await entries[0].ToStringAsync(Encoding.UTF8));
return Missing.Value;
};
await state.As<IRaftLog>().ReadAsync(new LogEntryConsumer(checker), 1L, CancellationToken.None);
}
}

[Obsolete]
[Fact]
public static async Task LegacyOverwrite()
Expand Down
Loading

0 comments on commit c3cf40e

Please sign in to comment.