Skip to content

Netstandard20#28

Open
ghost1face wants to merge 12 commits intomainfrom
netstandard20
Open

Netstandard20#28
ghost1face wants to merge 12 commits intomainfrom
netstandard20

Conversation

@ghost1face
Copy link
Contributor

@ghost1face ghost1face commented Jan 20, 2026

Linked Issue

Closes #25 and #20

Description

This minimizes the surface area of impact by making this library netstandard2.0 compliant and using specific attributes for compatibility.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Changes Made

  • Adds .netstandard2.0 support
    • References System.Text.Json and System.Collections.Immutable for compatibility
    • Minor changes for APIs that do not exist in the netstandard20 world
    • Adds tests for net481 on windows machines for local development only
  • Updates documentation

SPEC Compliance

  • This PR implements/fixes spec compliance
  • Spec section(s) affected:
  • Spec version:

Testing

  • All existing tests pass
  • Added new tests for changes
  • Tests cover edge cases and spec compliance

Pre-submission Checklist

  • My code follows the project's coding standards
  • I have run code formatting/linting tools
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed
  • I have reviewed the TOON specification for relevant sections

Breaking Changes

  • No breaking changes
  • Breaking changes (describe migration path below)

Additional Context

@ghost1face ghost1face added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 20, 2026
@ghost1face ghost1face marked this pull request as ready for review January 20, 2026 21:37
@ghost1face ghost1face requested review from a team and johannschopplich as code owners January 20, 2026 21:37
@ghost1face ghost1face mentioned this pull request Jan 20, 2026
7 tasks
@ghost1face ghost1face requested a review from Copilot January 21, 2026 11:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds .NET Standard 2.0 support to the ToonFormat library, expanding compatibility to .NET Framework and earlier .NET Core versions while maintaining support for .NET 8.0, 9.0, and 10.0.

Changes:

  • Added .NET Standard 2.0 as a target framework with conditional compilation for API compatibility
  • Introduced polyfill attributes (RequiredMemberAttribute, CompilerFeatureRequiredAttribute, SetsRequiredMembersAttribute) for .NET Standard 2.0
  • Updated test framework configuration to support .NET Framework 4.8.1 on Windows for local development

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Directory.Build.props Defines target frameworks and conditional test framework selection based on CI/local and OS platform
src/ToonFormat/ToonFormat.csproj Adds conditional package references and unsafe blocks for .NET Standard 2.0
src/ToonFormat/ToonDecoder.cs Implements conditional StreamReader instantiation for .NET Standard 2.0 compatibility
src/ToonFormat/System.Runtime.CompilerServices/RequiredMemberAttribute.cs Polyfill attribute for .NET Standard 2.0
src/ToonFormat/System.Runtime.CompilerServices/CompilerFeatureRequiredAttribute.cs Polyfill attribute for .NET Standard 2.0
src/ToonFormat/System.Diagnostics.CodeAnalysis/SetsRequiredMembersAttribute.cs Polyfill attribute for .NET Standard 2.0
src/ToonFormat/Internal/Shared/NumericUtils.cs Adds IsFinite polyfills for float and double in .NET Standard 2.0
src/ToonFormat/Internal/Shared/FloatUtils.cs Implements unsafe pointer-based signed zero normalization for .NET Standard 2.0
src/ToonFormat/Internal/Encode/Primitives.cs Adds conditional string.EndsWith compatibility for .NET Standard 2.0
src/ToonFormat/Internal/Encode/Normalize.cs Updates to use NumericUtils.IsFinite and adds .NET Standard 2.0 compatibility
src/ToonFormat/Internal/Encode/Folding.cs Updates method signatures and adds conditional string.Join for .NET Standard 2.0
src/ToonFormat/Internal/Encode/Encoders.cs Changes parameter types from IReadOnlySet to IReadOnlyCollection
src/ToonFormat/Internal/Decode/Scanner.cs Replaces ReadOnlySpan constructor with ToString() for .NET Standard 2.0
src/ToonFormat/Internal/Decode/Parser.cs Adds conditional string.StartsWith compatibility for .NET Standard 2.0
tests/ToonFormat.Tests/ToonFormat.Tests.csproj Updates to use centralized test framework configuration
tests/ToonFormat.Tests/ManualTests/PerformanceBenchmark.cs Replaces TotalMicroseconds with Ticks-based calculation for .NET Standard 2.0
tests/ToonFormat.SpecGenerator/ToonFormat.SpecGenerator.csproj Removes redundant System.Text.Json package reference
README.md Updates documentation to reflect .NET Standard 2.0 support
CONTRIBUTING.md Updates contributor documentation with .NET Standard 2.0 information

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ghost1face and others added 6 commits January 21, 2026 06:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…RequiredAttribute.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ttribute.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…RequiredAttribute.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@johannschopplich johannschopplich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! You decide when to merge. Thanks for the effort! 🙏

@ghost1face
Copy link
Contributor Author

Coming back to this folks, can we get some eyes and approval for us to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for .NET Standard 2.0

5 participants