Skip to content

1.0.4

Latest

Choose a tag to compare

@z3r3d z3r3d released this 16 Aug 21:11
Immutable release. Only release title and notes can be modified.
dbc4fd0

Release Notes

Release Version 1.0.4 on 2026-08-16

👀 Overview

Version 1.0.4 brings improvements such like type safety for Collection and String handling, enhanced test coverage, and strengthened CI/CD infrastructure with code coverage reporting.


➕ Installation

dependencies: [
    .package(url: "https://github.com/gchriswill/OrSwift.git", from: "1.0.4")
]

✨ Features & Improvements

Type System Enhancements

  • Refined Collection Support: The .orEmpty computed property for collections now requires conformance to ExpressibleByArrayLiteral, providing better type safety and cleaner semantics for common collection types.
  • Improved String Handling: The .orEmpty property for optional strings now requires types to conform to both StringProtocol and RangeReplaceableCollection, ensuring broader compatibility with string-like types including String and Substring.
  • Better Documentation: Updated constraints documentation to clearly specify supported types and their requirements.

Substring Support

  • Enhanced support for handling optional Substring values with proper type constraints and error handling.
  • Tests updated to verify proper behavior with substring-based scenarios.

Code Quality & Documentation

  • Refined documentation comments for Optional extensions with improved clarity on supported types and constraints.
  • Updated section markers in code organization (e.g., // MARK: - Adoption) for better code navigation.
  • Improved Or class documentation emphasizing its role as a static namespace.
  • Corrected and consolidated examples in documentation blocks.

Testing

  • Expanded Test Coverage: Added comprehensive tests for custom collection types conforming to ExpressibleByArrayLiteral.
  • Test Improvements:
    • Replaced generic XCTAssertTrue assertions with more specific XCTAssertEqual for precise behavior verification.
    • Updated assertions to use XCTAssertFalse where applicable for better clarity.
    • Enhanced tests to ensure maximum coverage and proper type handling.
  • CI Test Execution: Tests now run in parallel mode for faster feedback during CI/CD.

CI/CD & Code Coverage

  • Codecov Integration: Integrated code coverage reporting with Codecov for continuous monitoring of test coverage metrics.
  • Workflow Improvements:
    • Enhanced xctest bundle detection logic for more reliable CI execution on different Swift versions.
    • Implemented proper CI workflow permissions following least-privilege principles.
    • Added dynamic xctest binary discovery for cross-platform compatibility.
  • Coverage Markers: Refined LCOV coverage exclusion annotations for better accuracy of coverage reports.

🐛 Bug Fixes

  • Fixed tests related to optional Substring error handling.
  • Corrected Or class instantiation test coverage (promoted internal test coverage).
  • Resolved xctest bundle discovery issues in CI workflows.

📚 Documentation Updates

  • Updated README.md with refined Supported Types section reflecting new constraints.
  • Clarified that Dictionary support is now available through the dedicated ExpressibleByDictionaryLiteral extension pattern.
  • Improved API documentation with better example usage and supported type lists.

🔄 Refactoring

  • Simplified .orEmpty implementation for collections using ExpressibleByArrayLiteral protocol.
  • Modernized initialization documentation for the Or namespace class.
  • Removed redundant code paths while maintaining full backward compatibility.

⚠️ Breaking Changes

None - This is a fully backward-compatible release.


📦 Dependencies

No changes to dependencies. The package remains dependency-free.


🧪 Test Coverage

  • Total test suite expanded with 80+ test cases covering:
    • All basic type defaults (.orEmpty, .orZero, .orTrue, .orFalse)
    • Collection types with ExpressibleByArrayLiteral
    • String and Substring handling
    • Custom type fallback via .or(_:) and Or.this(optional:default:)
    • Edge cases and type-specific behaviors

🎯 Known Limitations

  • The .orEmpty property for collections is optimized for types conforming to ExpressibleByArrayLiteral. Custom collection types outside this pattern may require using .or(_:) for explicit default values.
  • StringProtocol implementations that don't conform to RangeReplaceableCollection should use .or(_:) for custom fallback handling.

🙏 Contributors

Special thanks to all contributors and the Copilot Autofix powered by AI for code quality improvements and testing enhancements.
Special thanks to @gchriswill for all his great contributions since the very begining.


Previous Releases

1.0.3

Initial public release with core features:

  • .orEmpty for String and Collection types
  • .orZero for Numeric types
  • .orTrue and .orFalse for Boolean types
  • .or(_:) generic fallback method
  • Or.this(optional:default:) static helper

IMPORTANT NOTES 📢📢📢

As of August 5th, 2026, @gchriswill’s development contributions to this repository will be limited due to new employment. You can view his full commit history here: https://github.com/gchriswill/OrSwift/commits/main/?author=gchriswill. His last recorded contribution was made on July 25th, 2026.

Or in Swift project will continue to grow and be maintained by the open‑source community. While @gchriswill will remain involved as a limited administrator, his reduced development activity will not impact future development or maintenance cycles.

We wish @gchriswill the very best and look forward to seeing the great things he will accomplish at 🍎.


Full Changelog: 1.0.3...1.0.4