Skip to content

Commit 99e71b6

Browse files
authored
Update Date, Fix T4 code to match current source in T4 templates (#233)
* Update Date, Fix T4 code to match current source in T4 templates * Lock Microsoft.CodeAnalysis version in project to 3.11.0 Lock FluentAssertions to 6.2.0 * Update Program.cs * Update * Update ci-build.yml * Revert Bemchmark * Update * Update StyleCop.Analyzers and minor code formatting Bump StyleCop.Analyzers to version 1.2.0-beta.556 in Directory.Build.props. Add a blank line for formatting in MemberFuncCacheKeyComparer.cs. * Add DistinctUntilChanged to two-way binding and update deps Introduces DistinctUntilChanged in the two-way binding implementation to prevent redundant updates. Also updates System.Reactive and ReactiveUI package versions across projects, and enables BindTwoWay usage in the sample. * Update NotifyPropertiesChangeExtensions.cs * Update Copyright year
1 parent e01b60f commit 99e71b6

File tree

96 files changed

+1326
-1268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1326
-1268
lines changed

.editorconfig

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ dotnet_diagnostic.SA1006.severity = error
296296
dotnet_diagnostic.SA1007.severity = error
297297
dotnet_diagnostic.SA1008.severity = error
298298
dotnet_diagnostic.SA1009.severity = error
299-
dotnet_diagnostic.SA1010.severity = error
299+
dotnet_diagnostic.SA1010.severity = none
300300
dotnet_diagnostic.SA1011.severity = error
301301
dotnet_diagnostic.SA1012.severity = error
302302
dotnet_diagnostic.SA1013.severity = error
@@ -469,10 +469,11 @@ dotnet_diagnostic.CA1825.severity=error
469469
dotnet_diagnostic.CA1812.severity=error
470470
dotnet_diagnostic.CA1805.severity=error
471471
dotnet_diagnostic.RCS1197.severity=error
472-
dotnet_diagnostic.RCS1198.severity=error
473-
dotnet_diagnostic.RCS1231.severity=error
472+
dotnet_diagnostic.RCS1198.severity=none
473+
dotnet_diagnostic.RCS1231.severity=suggestion
474474
dotnet_diagnostic.RCS1235.severity=error
475475
dotnet_diagnostic.RCS1242.severity=error
476+
dotnet_diagnostic.RCS1256.severity=none
476477
dotnet_diagnostic.CA2016.severity=warning
477478
dotnet_diagnostic.CA2014.severity=error
478479
dotnet_diagnostic.RCS1010.severity=error
@@ -489,6 +490,8 @@ dotnet_diagnostic.RCS1105.severity=error
489490
dotnet_diagnostic.RCS1112.severity=error
490491
dotnet_diagnostic.RCS1128.severity=error
491492
dotnet_diagnostic.RCS1143.severity=error
493+
dotnet_diagnostic.RCS1158.severity=none
494+
dotnet_diagnostic.RCS1163.severity=none
492495
dotnet_diagnostic.RCS1171.severity=error
493496
dotnet_diagnostic.RCS1173.severity=error
494497
dotnet_diagnostic.RCS1176.severity=error
@@ -525,3 +528,5 @@ indent_size = 2
525528
end_of_line = lf
526529
[*.{cmd, bat}]
527530
end_of_line = crlf
531+
532+
vsspell_dictionary_languages = en-US

.github/workflows/ci-build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212

1313
jobs:
1414
build:
15-
runs-on: windows-2022
15+
runs-on: windows-latest
1616
outputs:
1717
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
1818
steps:
@@ -22,12 +22,12 @@ jobs:
2222
fetch-depth: 0
2323
lfs: true
2424

25-
- name: Install .NET 6 and 7
25+
- name: Install .NET
2626
uses: actions/[email protected]
2727
with:
2828
dotnet-version: |
29-
6.0.x
30-
7.0.x
29+
8.0.x
30+
9.0.x
3131
3232
- uses: nuget/setup-nuget@v2
3333
name: Setup NuGet
@@ -56,6 +56,11 @@ jobs:
5656
- name: NuGet Restore
5757
run: nuget restore
5858
working-directory: src
59+
60+
- name: Build DotNet
61+
if: inputs.useUNO == false
62+
run: dotnet build --no-restore --configuration ${{ env.configuration }}
63+
working-directory: src
5964

6065
- name: Build
6166
run: msbuild /t:build,pack /nowarn:MSB4011 /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }}

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
- name: Install .NET 6
2626
uses: actions/[email protected]
2727
with:
28-
dotnet-version: 6.0.x
29-
include-prerelease: true
28+
dotnet-version: |
29+
6.0.x
30+
7.0.x
3031
3132
- uses: nuget/setup-nuget@v2
3233
name: Setup NuGet

src/Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Platform>AnyCPU</Platform>
55
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
66
<Authors>Glenn Watson</Authors>
7-
<Copyright>Copyright (c) 2021 ReactiveUI Association Incorporated</Copyright>
7+
<Copyright>Copyright (c) 2025 ReactiveUI Association Incorporated</Copyright>
88
<PackageIcon>logo.png</PackageIcon>
99
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1010
<PackageProjectUrl>https://github.com/reactivemarbles/PropertyChanged</PackageProjectUrl>
@@ -42,14 +42,15 @@
4242
<ItemGroup>
4343
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
4444
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\"/>
45+
<None Include="$(MSBuildThisFileDirectory)..\README.md" Pack="true" PackagePath="\"/>
4546
</ItemGroup>
4647

4748
<ItemGroup>
4849
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" PrivateAssets="all" />
4950
</ItemGroup>
5051

5152
<ItemGroup>
52-
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
53+
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
5354
<PackageReference Include="Roslynator.Analyzers" Version="4.14.0" PrivateAssets="All" />
5455
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" PrivateAssets="all" />
5556
</ItemGroup>

src/ReactiveMarbles.PropertyChanged.Benchmarks/BindBenchmarks.cs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
// Copyright (c) 2019-2020 ReactiveUI Association Incorporated. All rights reserved.
1+
// Copyright (c) 2019-2025 ReactiveUI Association Incorporated. All rights reserved.
22
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for full license information.
4+
// <auto-generated />
45

56
using System;
6-
77
using BenchmarkDotNet.Attributes;
88
using BenchmarkDotNet.Configs;
99
using BenchmarkDotNet.Jobs;
1010

1111
using ReactiveMarbles.PropertyChanged.Benchmarks.Moqs;
12-
13-
using New = ReactiveMarbles.PropertyChanged.BindExtensions;
14-
using Old = ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.BindExtensions;
1512
using UI = ReactiveUI.PropertyBindingMixins;
13+
using Old = ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.BindExtensions;
14+
using New = ReactiveMarbles.PropertyChanged.BindExtensions;
1615

1716
namespace ReactiveMarbles.PropertyChanged.Benchmarks
1817
{
1918
/// <summary>
2019
/// Benchmarks for binding.
2120
/// </summary>
22-
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
21+
[SimpleJob(RuntimeMoniker.Net60)]
2322
[MemoryDiagnoser]
2423
[MarkdownExporterAttribute.GitHub]
2524
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
@@ -59,11 +58,11 @@ public void Depth3Setup()
5958
public void PerformMutations(int depth)
6059
{
6160
// We loop through the changes, alternating mutations to the source and destination at every depth.
62-
int d2 = depth * 2;
63-
for (int i = 0; i < Changes; ++i)
61+
var d2 = depth * 2;
62+
for (var i = 0; i < Changes; ++i)
6463
{
65-
int a = i % d2;
66-
TestClass t = (a % 2) > 0 ? _to : _from;
64+
var a = i % d2;
65+
var t = (a % 2) > 0 ? _to : _from;
6766
t.Mutate(a / 2);
6867
}
6968
}
@@ -72,71 +71,71 @@ public void PerformMutations(int depth)
7271
[Benchmark(Baseline = true)]
7372
public void BindAndChange_Depth1_UI()
7473
{
75-
using ReactiveUI.IReactiveBinding<TestClass, (object view, bool isViewModel)> binding = UI.Bind(_from, _to, x => x.Value, x => x.Value);
74+
using var binding = UI.Bind(_from, _to, x => x.Value, x => x.Value);
7675
PerformMutations(1);
7776
}
7877

7978
[BenchmarkCategory("Bind and Change Depth 1")]
8079
[Benchmark]
8180
public void BindAndChange_Depth1_Old()
8281
{
83-
using IDisposable binding = Old.Bind(_from, _to, x => x.Value, x => x.Value);
82+
using var binding = Old.Bind(_from, _to, x => x.Value, x => x.Value);
8483
PerformMutations(1);
8584
}
8685

8786
[BenchmarkCategory("Bind and Change Depth 1")]
8887
[Benchmark]
8988
public void BindAndChange_Depth1_New()
9089
{
91-
using IDisposable binding = New.BindTwoWay(_from, _to, x => x.Value, x => x.Value);
90+
using var binding = New.BindTwoWay(_from, _to, x => x.Value, x => x.Value);
9291
PerformMutations(1);
9392
}
9493

9594
[BenchmarkCategory("Bind and Change Depth 2")]
9695
[Benchmark(Baseline = true)]
9796
public void BindAndChange_Depth2_UI()
9897
{
99-
using ReactiveUI.IReactiveBinding<TestClass, (object view, bool isViewModel)> binding = UI.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
98+
using var binding = UI.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
10099
PerformMutations(2);
101100
}
102101

103102
[BenchmarkCategory("Bind and Change Depth 2")]
104103
[Benchmark]
105104
public void BindAndChange_Depth2_Old()
106105
{
107-
using IDisposable binding = Old.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
106+
using var binding = Old.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
108107
PerformMutations(2);
109108
}
110109

111110
[BenchmarkCategory("Bind and Change Depth 2")]
112111
[Benchmark]
113112
public void BindAndChange_Depth2_New()
114113
{
115-
using IDisposable binding = New.BindTwoWay(_from, _to, x => x.Child.Value, x => x.Child.Value);
114+
using var binding = New.BindTwoWay(_from, _to, x => x.Child.Value, x => x.Child.Value);
116115
PerformMutations(2);
117116
}
118117

119118
[BenchmarkCategory("Bind and Change Depth 3")]
120119
[Benchmark(Baseline = true)]
121120
public void BindAndChange_Depth3_UI()
122121
{
123-
using ReactiveUI.IReactiveBinding<TestClass, (object view, bool isViewModel)> binding = UI.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
122+
using var binding = UI.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
124123
PerformMutations(3);
125124
}
126125

127126
[BenchmarkCategory("Bind and Change Depth 3")]
128127
[Benchmark]
129128
public void BindAndChange_Depth3_Old()
130129
{
131-
using IDisposable binding = Old.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
130+
using var binding = Old.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
132131
PerformMutations(3);
133132
}
134133

135134
[BenchmarkCategory("Bind and Change Depth 3")]
136135
[Benchmark]
137136
public void BindAndChange_Depth3_New()
138137
{
139-
using IDisposable binding = New.BindTwoWay(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
138+
using var binding = New.BindTwoWay(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
140139
PerformMutations(3);
141140
}
142141

src/ReactiveMarbles.PropertyChanged.Benchmarks/BindBenchmarks.tt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<#@ assembly name="System.Collections.dll" #>
44
<#@ import namespace="System.Linq" #>
55
<#@ output extension=".cs" #>
6-
// Copyright (c) 2019-2020 ReactiveUI Association Incorporated. All rights reserved.
6+
// Copyright (c) 2019-<#=DateTime.Now.Year#> ReactiveUI Association Incorporated. All rights reserved.
77
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
88
// See the LICENSE file in the project root for full license information.
9+
// <auto-generated />
910

1011
using System;
1112
using BenchmarkDotNet.Attributes;
@@ -19,7 +20,7 @@ var participants = new (string Alias, string MethodName, string FullClassName)[]
1920
{
2021
("UI", "Bind", "ReactiveUI.PropertyBindingMixins"),
2122
("Old", "Bind", "ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.BindExtensions"),
22-
("New", "Bind", "ReactiveMarbles.PropertyChanged.BindExtensions"),
23+
("New", "BindTwoWay", "ReactiveMarbles.PropertyChanged.BindExtensions"),
2324
};
2425
var depths = new[] { 1, 2, 3 };
2526
const string BindAndChange = "BindAndChange";
@@ -37,7 +38,7 @@ namespace ReactiveMarbles.PropertyChanged.Benchmarks
3738
/// <summary>
3839
/// Benchmarks for binding.
3940
/// </summary>
40-
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
41+
[SimpleJob(RuntimeMoniker.Net60)]
4142
[MemoryDiagnoser]
4243
[MarkdownExporterAttribute.GitHub]
4344
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]

src/ReactiveMarbles.PropertyChanged.Benchmarks/ReactiveMarbles.PropertyChanged.Benchmarks.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
77
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
12-
<PackageReference Include="reactiveui" Version="19.*" />
11+
<PackageReference Include="BenchmarkDotNet" Version="[0.13.5,)" />
12+
<PackageReference Include="reactiveui" Version="21.*" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/ReactiveMarbles.PropertyChanged.Benchmarks/WhenChangedBenchmarks.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
// Copyright (c) 2019-2021 ReactiveUI Association Incorporated. All rights reserved.
1+
// Copyright (c) 2019-2025 ReactiveUI Association Incorporated. All rights reserved.
22
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for full license information.
4+
// <auto-generated />
45

56
using System;
6-
77
using BenchmarkDotNet.Attributes;
88
using BenchmarkDotNet.Configs;
99
using BenchmarkDotNet.Jobs;
1010

1111
using ReactiveMarbles.PropertyChanged.Benchmarks.Moqs;
12-
13-
using SourceGen = NotifyPropertyExtensions;
12+
using SourceGen = ReactiveMarbles.PropertyChanged.NotifyPropertyChangedExtensions;
1413

1514
namespace ReactiveMarbles.PropertyChanged.Benchmarks
1615
{
1716
/// <summary>
1817
/// Benchmarks for the property changed.
1918
/// </summary>
20-
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
19+
[SimpleJob(RuntimeMoniker.Net60)]
2120
[MemoryDiagnoser]
2221
[MarkdownExporterAttribute.GitHub]
2322
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
@@ -54,7 +53,7 @@ public void Depth3Setup()
5453
public void PerformMutations(int depth)
5554
{
5655
// We loop through the changes, creating mutations at every depth.
57-
for (int i = 0; i < Changes; ++i)
56+
for (var i = 0; i < Changes; ++i)
5857
{
5958
_from.Mutate(i % depth);
6059
}

src/ReactiveMarbles.PropertyChanged.Benchmarks/WhenChangedBenchmarks.tt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<#@ assembly name="System.Collections.dll" #>
44
<#@ import namespace="System.Linq" #>
55
<#@ output extension=".cs" #>
6-
// Copyright (c) 2019-2020 ReactiveUI Association Incorporated. All rights reserved.
6+
// Copyright (c) 2019-<#=DateTime.Now.Year#> ReactiveUI Association Incorporated. All rights reserved.
77
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
88
// See the LICENSE file in the project root for full license information.
9+
// <auto-generated />
910

1011
using System;
1112
using BenchmarkDotNet.Attributes;
@@ -20,7 +21,7 @@ var participants = new (string Alias, string MethodName, string FullClassName)[]
2021
////("UI", "WhenAnyValue", "ReactiveUI.WhenAnyMixin"),
2122
////("Old", "WhenChanged", "ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.NotifyPropertyChangedExtensions"),
2223
////("New", "WhenChanged", "ReactiveMarbles.PropertyChanged.NotifyPropertyChangedExtensions"),
23-
("SourceGen", "WhenChanged", "NotifyPropertyChangedExtensions"),
24+
("SourceGen", "WhenChanged", "ReactiveMarbles.PropertyChanged.NotifyPropertyChangedExtensions"),
2425
};
2526
var depths = new[] { 1, 2, 3 };
2627
const string SubscribeAndChange = "SubscribeAndChange";
@@ -38,7 +39,7 @@ namespace ReactiveMarbles.PropertyChanged.Benchmarks
3839
/// <summary>
3940
/// Benchmarks for the property changed.
4041
/// </summary>
41-
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
42+
[SimpleJob(RuntimeMoniker.Net60)]
4243
[MemoryDiagnoser]
4344
[MarkdownExporterAttribute.GitHub]
4445
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]

0 commit comments

Comments
 (0)