Skip to content

Commit

Permalink
Merge pull request #404 from runceel/main
Browse files Browse the repository at this point in the history
Release pre-v9.0.0
  • Loading branch information
runceel authored Jan 5, 2023
2 parents fc9c056 + 1089673 commit 33fe761
Show file tree
Hide file tree
Showing 90 changed files with 4,853 additions and 722 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- 'docs/**'

env:
DOTNET_VERSION: 6.0.x
DOTNET_VERSION: 7.0.x

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core-unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ main ]

env:
DOTNET_VERSION: 6.0.x
DOTNET_VERSION: 7.0.x

jobs:
build:
Expand Down
71 changes: 71 additions & 0 deletions Benchmark/Benchmark.Current/BasicUsages.v9.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.Reactive.Subjects;
using BenchmarkDotNet.Attributes;
using Reactive.Bindings;
using Reactive.Bindings.Extensions;

namespace ReactivePropertyBenchmark;

public partial class BasicUsages
{
[Benchmark]
public ReactiveCommand CreateReactiveCommand() => new ReactiveCommand();

[Benchmark]
public ReactiveCommandSlim CreateReactiveCommandSlim() => new ReactiveCommandSlim();



[Benchmark]
public ReactiveCommand BasicUsecaseForReactiveCommand()
{
var subject = new Subject<bool>();
var cmd = subject.ToReactiveCommand();
cmd.Subscribe(x => { });
cmd.Execute();
subject.OnNext(true);
cmd.Execute();
return cmd;
}

[Benchmark]
public ReactiveCommandSlim BasicUsecaseForReactiveCommandSlim()
{
var subject = new Subject<bool>();
var cmd = subject.ToReactiveCommandSlim();
cmd.Subscribe(x => { });
cmd.Execute();
subject.OnNext(true);
cmd.Execute();
return cmd;
}

[Benchmark]
public ReactiveProperty<string> ReactivePropertyValidation()
{
var rp = new ReactiveProperty<string>("")
.SetValidateNotifyError(x => string.IsNullOrEmpty(x) ? "invalid" : null);
rp.Value = "xxx"; // valid
rp.Value = ""; // invalid
return rp;
}

[Benchmark]
public ValidatableReactiveProperty<string> ValidatableReactivePropertyValidation()
{
var rp = ValidatableReactiveProperty.CreateFromValidationLogic(
"",
x => string.IsNullOrEmpty(x) ? "invalid" : null);
rp.Value = "xxx"; // valid
rp.Value = ""; // invalid
return rp;
}

[Benchmark]
public IObservable<string> ObservePropertyLegacy()
{
var p = new Person();
return p.ObservePropertyLegacy(x => x.Name);
}

}
4 changes: 2 additions & 2 deletions Benchmark/Benchmark.Current/Benchmark.Current.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 13 additions & 3 deletions Benchmark/Benchmark.V6/BasicUsages.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reactive.Subjects;
using System.Runtime.CompilerServices;
using System.Text;
using BenchmarkDotNet.Attributes;
Expand All @@ -9,7 +10,7 @@

namespace ReactivePropertyBenchmark
{
public class BasicUsages
public partial class BasicUsages
{
[Benchmark]
public ReactiveProperty<string> CreateReactivePropertyInstance() => new ReactiveProperty<string>();
Expand All @@ -18,23 +19,25 @@ public class BasicUsages
public ReactivePropertySlim<string> CreateReactivePropertySlimInstance() => new ReactivePropertySlim<string>();

[Benchmark]
public void BasicForReactiveProperty()
public ReadOnlyReactiveProperty<string> BasicForReactiveProperty()
{
var rp = new ReactiveProperty<string>();
var rrp = rp.ToReadOnlyReactiveProperty();

rp.Value = "xxxx";
rp.Dispose();
return rrp;
}

[Benchmark]
public void BasicForReactivePropertySlim()
public ReadOnlyReactivePropertySlim<string> BasicForReactivePropertySlim()
{
var rp = new ReactivePropertySlim<string>();
var rrp = rp.ToReadOnlyReactivePropertySlim();

rp.Value = "xxxx";
rp.Dispose();
return rrp;
}

[Benchmark]
Expand All @@ -50,6 +53,13 @@ public ReactiveProperty<string> ToReactivePropertyAsSynchronized()
var p = new Person();
return p.ToReactivePropertyAsSynchronized(x => x.Name);
}

[Benchmark]
public ReactivePropertySlim<string> ToReactivePropertyAsSynchronizedSlim()
{
var p = new Person();
return p.ToReactivePropertySlimAsSynchronized(x => x.Name);
}
}

class Person : INotifyPropertyChanged
Expand Down
4 changes: 2 additions & 2 deletions Benchmark/Benchmark.V6/Benchmark.V6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<RootNamespace>ReactivePropertyBenchmark</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="ReactiveProperty" Version="6.2.0" />
</ItemGroup>

Expand Down
6 changes: 1 addition & 5 deletions Benchmark/Benchmark.V6/Program.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Running;

namespace ReactivePropertyBenchmark
{
class Program
{
static void Main(string[] args) =>
BenchmarkRunner.Run(typeof(Program).Assembly);

}
}
4 changes: 2 additions & 2 deletions Benchmark/Benchmark.V7/Benchmark.V7.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ReactiveProperty" Version="7.0.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
</ItemGroup>
<ItemGroup>
<Compile Include="../Benchmark.V6/**/*.cs" Exclude="../Benchmark.V6/bin/**/*.cs;../Benchmark.V6/obj/**/*.cs" />
Expand Down
4 changes: 2 additions & 2 deletions Benchmark/FromEventBenchmark.Rp/FromEventBenchmark.Rp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>FromEventBenchmark</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\ReactiveProperty.NETStandard\ReactiveProperty.NETStandard.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions Benchmark/FromEventBenchmark.Rx/FromEventBenchmark.Rx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>FromEventBenchmark</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="ReactiveProperty" Version="7.7.1" />
</ItemGroup>

Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ReactiveProperty

ReactiveProperty provides MVVM and asynchronous support features under Reactive Extensions. Target framework is .NET 6.0, .NET Core 3.1, .NET Framework 4.7.2 and .NET Standard 2.0.
ReactiveProperty provides MVVM and asynchronous support features under Reactive Extensions. Target framework is .NET 6.0+, .NET Framework 4.7.2 and .NET Standard 2.0.

![](https://img.shields.io/nuget/v/ReactiveProperty.svg)
![](https://img.shields.io/nuget/dt/ReactiveProperty.svg)
Expand Down Expand Up @@ -137,10 +137,15 @@ ReactiveProperty doesn't provide base class by ViewModel, which means that React

|Package Id|Version and downloads|Description|
|----|----|----|
|[ReactiveProperty](https://www.nuget.org/packages/ReactiveProperty/)|![](https://img.shields.io/nuget/v/ReactiveProperty.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.svg)|The package includes all core features, and the target platform is .NET Standard 2.0. It fits almost all situations.|
|[ReactiveProperty](https://www.nuget.org/packages/ReactiveProperty/)|![](https://img.shields.io/nuget/v/ReactiveProperty.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.svg)|The package includes all core features.|
|[ReactiveProperty.Core](https://www.nuget.org/packages/ReactiveProperty.Core/)|![](https://img.shields.io/nuget/v/ReactiveProperty.Core.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.Core.svg)|The package includes minimum classes such as `ReactivePropertySlim<T>` and `ReadOnlyReactivePropertySlim<T>`. And this doesn't have any dependency even System.Reactive. If you don't need Rx features, then it fits.|
|[ReactiveProperty.WPF](https://www.nuget.org/packages/ReactiveProperty.WPF/)|![](https://img.shields.io/nuget/v/ReactiveProperty.WPF.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.WPF.svg)|The package includes EventToReactiveProperty and EventToReactiveCommand for WPF. This is for .NET Core 3.0 or later and .NET Framework 4.7.2 or later.|
|[ReactiveProperty.WPF](https://www.nuget.org/packages/ReactiveProperty.WPF/)|![](https://img.shields.io/nuget/v/ReactiveProperty.WPF.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.WPF.svg)|The package includes EventToReactiveProperty and EventToReactiveCommand for WPF. This is for .NET 6 or later and .NET Framework 4.7.2 or later.|
|[ReactiveProperty.Blazor](https://www.nuget.org/packages/ReactiveProperty.Blazor/)|![](https://img.shields.io/nuget/v/ReactiveProperty.Blazor.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.Blazor.svg)|The package includes validation support for EditForm component of Blazor with ReactiveProperty validation feature. This is for .NET 6.0 or later. |

Following packages are maitanance phase.

|Package Id|Version and downloads|Description|
|----|----|----|
|[ReactiveProperty.UWP](https://www.nuget.org/packages/ReactiveProperty.UWP/)|![](https://img.shields.io/nuget/v/ReactiveProperty.UWP.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.UWP.svg)|The package includes EventToReactiveProperty and EventToReactiveCommand for UWP.|
|[ReactiveProperty.XamarinAndroid](https://www.nuget.org/packages/ReactiveProperty.XamarinAndroid/)|![](https://img.shields.io/nuget/v/ReactiveProperty.XamarinAndroid.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.XamarinAndroid.svg)|The package includes many extension methods to create IObservable from events for Xamarin.Android native.|
|[ReactiveProperty.XamariniOS](https://www.nuget.org/packages/ReactiveProperty.XamariniOS/)|![](https://img.shields.io/nuget/v/ReactiveProperty.XamariniOS.svg)![](https://img.shields.io/nuget/dt/ReactiveProperty.XamariniOS.svg)|The package includes many extension methods to bind ReactiveProperty and ReactiveCommand to Xamarin.iOS native controls.|
Expand Down
19 changes: 13 additions & 6 deletions ReactiveProperty-Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiUIThreadApp", "Samples
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blazor", "Blazor", "{FED0F033-DD46-4A15-9041-999813FECF73}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorServerApp", "Samples\Blazor\BlazorServerApp\BlazorServerApp.csproj", "{8DE66105-1318-4606-A702-70A78754E036}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorServerApp", "Samples\Blazor\BlazorServerApp\BlazorServerApp.csproj", "{8DE66105-1318-4606-A702-70A78754E036}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWasmApp", "Samples\Blazor\BlazorWasmApp\BlazorWasmApp.csproj", "{43DD55EB-1220-47D5-8F08-1F0989D8B0F6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWasmApp", "Samples\Blazor\BlazorWasmApp\BlazorWasmApp.csproj", "{43DD55EB-1220-47D5-8F08-1F0989D8B0F6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorSample.Shared", "Samples\Blazor\BlazorSample.Shared\BlazorSample.Shared.csproj", "{EE15634D-C8A7-40DD-B966-6695A2ECA1E1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorSample.Shared", "Samples\Blazor\BlazorSample.Shared\BlazorSample.Shared.csproj", "{EE15634D-C8A7-40DD-B966-6695A2ECA1E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveProperty.Platform.Blazor", "Source\ReactiveProperty.Platform.Blazor\ReactiveProperty.Platform.Blazor.csproj", "{3CF8E744-40E0-4874-B82D-1B3AD2523043}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactivePropertyCoreSample.WPF", "Samples\ReactivePropertyCoreSample.WPF\ReactivePropertyCoreSample.WPF.csproj", "{434764BE-10E5-46B2-AFC0-FE18F599D9D3}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Source\ReactiveProperty.Platform.Shared\ReactiveProperty.Platform.Shared.projitems*{ff52758c-f5fb-49c9-8dee-e4a7dfba4dc1}*SharedItemsImports = 5
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand Down Expand Up @@ -94,6 +93,10 @@ Global
{3CF8E744-40E0-4874-B82D-1B3AD2523043}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CF8E744-40E0-4874-B82D-1B3AD2523043}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CF8E744-40E0-4874-B82D-1B3AD2523043}.Release|Any CPU.Build.0 = Release|Any CPU
{434764BE-10E5-46B2-AFC0-FE18F599D9D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{434764BE-10E5-46B2-AFC0-FE18F599D9D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{434764BE-10E5-46B2-AFC0-FE18F599D9D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{434764BE-10E5-46B2-AFC0-FE18F599D9D3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -111,8 +114,12 @@ Global
{43DD55EB-1220-47D5-8F08-1F0989D8B0F6} = {FED0F033-DD46-4A15-9041-999813FECF73}
{EE15634D-C8A7-40DD-B966-6695A2ECA1E1} = {FED0F033-DD46-4A15-9041-999813FECF73}
{3CF8E744-40E0-4874-B82D-1B3AD2523043} = {69BB0C02-5C1E-4720-AC3E-61E25B9F0143}
{434764BE-10E5-46B2-AFC0-FE18F599D9D3} = {1C3E6F75-DD1A-4183-8DFD-38D307782FC3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C0F7AB85-D9AA-401B-9DAE-0C5394272D48}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Source\ReactiveProperty.Platform.Shared\ReactiveProperty.Platform.Shared.projitems*{ff52758c-f5fb-49c9-8dee-e4a7dfba4dc1}*SharedItemsImports = 5
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions ReactiveProperty.lutconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<LUTConfig Version="1.0">
<Repository />
<ParallelBuilds>true</ParallelBuilds>
<ParallelTestRuns>true</ParallelTestRuns>
<TestCaseTimeout>180000</TestCaseTimeout>
</LUTConfig>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Blazor/BlazorServerApp/BlazorServerApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions Samples/Blazor/BlazorWasmApp/BlazorWasmApp.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/MultiUIThreadApp/MultiUIThreadApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions Samples/Reactive.Todo.Main/Reactive.Todo.Main.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyName>Reactive.Todo.Main</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MahApps.Metro" Version="2.4.5" />
<PackageReference Include="Prism.Wpf" Version="8.0.0.1909" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="Prism.Wpf" Version="8.1.97" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\ReactiveProperty.Platform.WPF\ReactiveProperty.Platform.WPF.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions Samples/Reactive.Todo/Reactive.Todo.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyName>Reactive.Todo</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MahApps.Metro" Version="2.4.5" />
<PackageReference Include="Prism.Unity" Version="8.0.0.1909" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="Prism.Unity" Version="8.1.97" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\ReactiveProperty.Platform.WPF\ReactiveProperty.Platform.WPF.csproj" />
Expand Down
Loading

0 comments on commit 33fe761

Please sign in to comment.