From ee940a6863df05ec2fd5c01d664371caa26ae646 Mon Sep 17 00:00:00 2001 From: Lennon Cork Date: Mon, 3 Nov 2025 13:08:46 -0800 Subject: [PATCH 1/6] Add .NET 8 targeting --- source/Handlebars.Test/Handlebars.Test.csproj | 2 +- source/Handlebars/Handlebars.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Handlebars.Test/Handlebars.Test.csproj b/source/Handlebars.Test/Handlebars.Test.csproj index 7205360e..019473a4 100644 --- a/source/Handlebars.Test/Handlebars.Test.csproj +++ b/source/Handlebars.Test/Handlebars.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net6 + netcoreapp3.1;net6;net8 $(TargetFrameworks);net452;net46;net461;net472 6BA232A6-8C4D-4C7D-BD75-1844FE9774AF HandlebarsDotNet.Test diff --git a/source/Handlebars/Handlebars.csproj b/source/Handlebars/Handlebars.csproj index df5c44d4..9d4cbbe0 100644 --- a/source/Handlebars/Handlebars.csproj +++ b/source/Handlebars/Handlebars.csproj @@ -3,7 +3,7 @@ Handlebars 9822C7B8-7E51-42BC-9A49-72A10491B202 - netstandard1.3;netstandard2.0;netstandard2.1;net6 + netstandard1.3;netstandard2.0;netstandard2.1;net6;net8 $(TargetFrameworks);net451 2.0.0 HandlebarsDotNet From d2d7197a581052141843afcfb0a40b91edc247c9 Mon Sep 17 00:00:00 2001 From: Lennon Cork Date: Mon, 3 Nov 2025 13:09:42 -0800 Subject: [PATCH 2/6] Update github scripts --- .github/workflows/ci.yml | 4 ++++ .github/workflows/pull_request.yml | 4 ++++ .github/workflows/release.yml | 1 + 3 files changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba54d7eb..cb6618f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -40,6 +41,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -61,6 +63,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - uses: actions/setup-java@v4 with: java-version: '21' # The JDK version to make available on the path. @@ -110,6 +113,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 25301f4b..47c33b60 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,6 +17,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -40,6 +41,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -61,6 +63,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - uses: actions/setup-java@v4 with: java-version: '21' # The JDK version to make available on the path. @@ -110,6 +113,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 338ea23b..f3ce2dae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: 2.1.x 3.1.x 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source From 11409de3085e9059ea3c67bc4e278afca922225b Mon Sep 17 00:00:00 2001 From: Lennon Cork Date: Mon, 3 Nov 2025 14:22:14 -0800 Subject: [PATCH 3/6] Switch windows-2019 to windows-latest --- .github/workflows/ci.yml | 6 +++--- .github/workflows/pull_request.yml | 6 +++--- .github/workflows/release.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb6618f8..fdabba29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: jobs: build: name: Build - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@master - name: Setup dotnet @@ -31,7 +31,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-latest, ubuntu-latest, windows-2019 ] + os: [ macos-latest, ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@master - name: Setup dotnet @@ -51,7 +51,7 @@ jobs: sonar-ci: name: SonarCloud - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 47c33b60..008a5ac1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -7,7 +7,7 @@ on: jobs: build: name: Build - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@master - name: Setup dotnet @@ -31,7 +31,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-latest, ubuntu-latest, windows-2019 ] + os: [ macos-latest, ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@master - name: Setup dotnet @@ -51,7 +51,7 @@ jobs: sonar-pr: name: SonarCloud - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3ce2dae..5d95ce3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: publish: name: Publish - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v2 From ba1acecab7400e6538e69744efc12c9f808bed0a Mon Sep 17 00:00:00 2001 From: Lennon Cork Date: Mon, 3 Nov 2025 14:23:52 -0800 Subject: [PATCH 4/6] Switch artifacts@v2 to artifact@v4 --- .github/workflows/ci.yml | 2 +- .github/workflows/pull_request.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdabba29..98fec7d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: fail-on-alert: false alert-comment-cc-users: '@zjklee' - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Benchmark path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/ diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 008a5ac1..f893f486 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -142,7 +142,7 @@ jobs: alert-comment-cc-users: '@zjklee' - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Benchmark path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/ From 913041c9e4b498a0ff29343d8f7ca13affd2495b Mon Sep 17 00:00:00 2001 From: Lennon Cork Date: Mon, 3 Nov 2025 14:25:34 -0800 Subject: [PATCH 5/6] Switch actions/cache@v1 to actions/cache@v4 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/pull_request.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98fec7d1..25ff5c8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,14 +72,14 @@ jobs: working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache SonarCloud scanner id: cache-sonar-scanner - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: .\.sonar\scanner key: ${{ runner.os }}-sonar-scanner diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f893f486..8a407de3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -72,14 +72,14 @@ jobs: working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache SonarCloud scanner id: cache-sonar-scanner - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: .\.sonar\scanner key: ${{ runner.os }}-sonar-scanner From d0349b1082c6e4f192ed308c551c8a323d4782bb Mon Sep 17 00:00:00 2001 From: Lennon Cork Date: Thu, 6 Nov 2025 22:55:15 -0800 Subject: [PATCH 6/6] Remove netcoreapp3.1, update dependencies --- .github/workflows/ci.yml | 20 +++++----------- .github/workflows/pull_request.yml | 24 +++++++------------ .github/workflows/release.yml | 6 ++--- .../Handlebars.Benchmark.csproj | 6 ++--- source/Handlebars.Benchmark/Program.cs | 2 +- source/Handlebars.Test/Handlebars.Test.csproj | 10 ++++---- source/Handlebars/Handlebars.csproj | 19 ++++----------- source/Handlebars/IO/EncodedTextWriter.cs | 4 ---- 8 files changed, 29 insertions(+), 62 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25ff5c8a..5ebd0e85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,6 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 @@ -38,10 +36,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -60,10 +56,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - uses: actions/setup-java@v4 with: java-version: '21' # The JDK version to make available on the path. @@ -110,10 +104,8 @@ jobs: - uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8a407de3..8aadbb12 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,10 +14,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -38,10 +36,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -60,10 +56,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - uses: actions/setup-java@v4 with: java-version: '21' # The JDK version to make available on the path. @@ -110,10 +104,8 @@ jobs: - uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source run: dotnet clean -c Release && dotnet nuget locals all --clear diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d95ce3a..032384de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 2.1.x - 3.1.x - 6.0.x - 8.0.x + 6.0.x + 8.0.x - name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155 working-directory: ./source diff --git a/source/Handlebars.Benchmark/Handlebars.Benchmark.csproj b/source/Handlebars.Benchmark/Handlebars.Benchmark.csproj index 1174d8a2..44480846 100644 --- a/source/Handlebars.Benchmark/Handlebars.Benchmark.csproj +++ b/source/Handlebars.Benchmark/Handlebars.Benchmark.csproj @@ -2,15 +2,15 @@ Exe - netcoreapp3.1 + net8.0 false false HandlebarsNet.Benchmark - - + + diff --git a/source/Handlebars.Benchmark/Program.cs b/source/Handlebars.Benchmark/Program.cs index 87715600..23c07f22 100644 --- a/source/Handlebars.Benchmark/Program.cs +++ b/source/Handlebars.Benchmark/Program.cs @@ -10,7 +10,7 @@ static class Program public static void Main(string[] args) { var job = Job.MediumRun - .WithToolchain(CsProjCoreToolchain.NetCoreApp31) + .WithToolchain(CsProjCoreToolchain.NetCoreApp80) .WithLaunchCount(1); var manualConfig = DefaultConfig.Instance diff --git a/source/Handlebars.Test/Handlebars.Test.csproj b/source/Handlebars.Test/Handlebars.Test.csproj index 019473a4..83aafd18 100644 --- a/source/Handlebars.Test/Handlebars.Test.csproj +++ b/source/Handlebars.Test/Handlebars.Test.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1;net6;net8 - $(TargetFrameworks);net452;net46;net461;net472 + net6;net8 + $(TargetFrameworks);net452;net462;net472;net481 6BA232A6-8C4D-4C7D-BD75-1844FE9774AF HandlebarsDotNet.Test false @@ -22,7 +22,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/source/Handlebars/Handlebars.csproj b/source/Handlebars/Handlebars.csproj index 9d4cbbe0..f9bb4876 100644 --- a/source/Handlebars/Handlebars.csproj +++ b/source/Handlebars/Handlebars.csproj @@ -3,7 +3,7 @@ Handlebars 9822C7B8-7E51-42BC-9A49-72A10491B202 - netstandard1.3;netstandard2.0;netstandard2.1;net6;net8 + netstandard2.0;netstandard2.1;net6;net8 $(TargetFrameworks);net451 2.0.0 HandlebarsDotNet @@ -36,27 +36,16 @@ - + - - - - - - - - - - - - + - + diff --git a/source/Handlebars/IO/EncodedTextWriter.cs b/source/Handlebars/IO/EncodedTextWriter.cs index 8bb0f102..7a6cbb46 100644 --- a/source/Handlebars/IO/EncodedTextWriter.cs +++ b/source/Handlebars/IO/EncodedTextWriter.cs @@ -138,11 +138,7 @@ public void Write(T value) private void WriteFormatted(T value) { var type = typeof(T); -#if NETSTANDARD1_3 - if (type.GetTypeInfo().IsClass) type = value.GetType(); -#else if (type.IsClass) type = value.GetType(); -#endif if (!_formatterProvider.TryCreateFormatter(type, out var formatter)) Throw.CannotResolveFormatter(type);