Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-26
xcode-version: "26.6" # Swift 6.3.3
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Xcode
uses: OpenSwiftUIProject/setup-xcode@v2
with:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-26
xcode-version: "26.6" # Swift 6.3.3
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Xcode
uses: OpenSwiftUIProject/setup-xcode@v2
with:
Expand All @@ -43,13 +43,12 @@ jobs:
-Xswiftc -warnings-as-errors \
--build-path .build-test-debug-sanitize-thread
- name: Build and run tests in release mode
if: ${{ matrix.xcode-version != '14.3.1' }} # error: no input files specified. See llvm-profdata merge -help
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-release
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v7
with:
verbose: true
28 changes: 15 additions & 13 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ on:
paths:
- ".github/workflows/swiftlint.yml"
- ".swiftlint.yml"
- "Tests/.swiftlint.yml"
- "utils/lint.sh"
- "**/*.swift"

jobs:
SwiftLint:
runs-on: ubuntu-22.04
runs-on: macos-26
steps:
- uses: actions/checkout@v4
# Fetch current versions of files
- name: Fetch base ref
run: |
git fetch --prune --no-tags --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/heads/${{ github.base_ref }}
# Diff pull request to current files, then SwiftLint changed files
- name: GitHub Action for SwiftLint
uses: mayk-it/action-swiftlint@3.2.2
env:
DIFF_BASE: ${{ github.base_ref }}
DIFF_HEAD: HEAD
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Xcode
uses: OpenSwiftUIProject/setup-xcode@v2
with:
args: --strict
xcode-version: "26.6"
- name: Install SwiftLint
run: brew install swiftlint
- name: Check new SwiftLint violations
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: bash utils/lint.sh "$BASE_SHA"
16 changes: 10 additions & 6 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ["5.9.2"]
os: [ubuntu-20.04, ubuntu-22.04]
swift_version: ["6.3.3"]
os: [ubuntu-22.04, ubuntu-24.04]
include:
- os: ubuntu-20.04
os_name: focal
- os: ubuntu-22.04
os_name: jammy
- os: ubuntu-24.04
os_name: noble
runs-on: ${{ matrix.os }}
container: swift:${{ matrix.swift_version }}-${{ matrix.os_name }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: Install coverage upload dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends curl
- name: Building and running tests in debug mode with coverage
run: |
swift test \
Expand All @@ -46,6 +50,6 @@ jobs:
-c release \
-Xswiftc -warnings-as-errors \
--build-path .build-test-release
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v7
with:
verbose: true
26 changes: 10 additions & 16 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ on:
branches: [main]

jobs:
wasmer_test:
wasm_test:
name: Execute tests on WASM
strategy:
fail-fast: false
matrix:
swift_version: ["wasm-5.9.1-RELEASE", "wasm-5.10-SNAPSHOT-2024-01-13-a"]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-24.04
container: swift:6.3.3-noble
steps:
- uses: actions/checkout@v4
- uses: swiftwasm/setup-swiftwasm@v1
with:
swift-version: ${{ matrix.swift_version }}
- name: build
- uses: actions/checkout@v6
- name: Install Swift SDK for WebAssembly
run: |
swift build
- name: test
run: |
swift test
swift sdk install \
https://download.swift.org/swift-6.3.3-release/wasm-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_wasm.artifactbundle.tar.gz \
--checksum cabfa08b73bb8ac783927ecd15fa386e99d0c139c5f232445067bcf58379cae7
- name: Build and run tests on WebAssembly
run: swift test --swift-sdk swift-6.3.3-RELEASE_wasm
10 changes: 5 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-2019
swift_version: "5.9.2"
- os: windows-2025
swift_version: "6.3.3"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: compnerd/gha-setup-swift@main
with:
branch: swift-${{ matrix.swift_version }}-release
tag: ${{ matrix.swift_version }}-RELEASE
swift-version: swift-${{ matrix.swift_version }}-release
swift-build: ${{ matrix.swift_version }}-RELEASE
- name: Building and running tests in debug mode
run: swift test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/Packages
/*.xcodeproj
/.swiftpm
Tests/LinuxMain.swift

# Created by https://www.gitignore.io/api/Xcode
# Edit at https://www.gitignore.io/?templates=Xcode
Expand Down
2 changes: 1 addition & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1
builder:
configs:
- swift_version: 5.9
- swift_version: 6.3
documentation_targets: [OpenCombine, OpenCombineDispatch, OpenCombineFoundation]
4 changes: 3 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ opt_in_rules:
- toggle_bool
- unneeded_parentheses_in_closure_argument
- untyped_error_in_catch
- unused_import
- vertical_parameter_alignment_on_call
- vertical_whitespace_closing_braces
- yoda_condition

analyzer_rules:
- unused_import

implicit_return:
included:
- closure
Expand Down
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Contributing

In order to work on this project you will need Xcode 10.2 and Swift 5.0 or later.
Use Swift 6.3 or later. On Apple platforms, use Xcode 26.6 or later.
The package uses Swift 5 language mode.

Please refer to the [issue #1](https://github.com/OpenCombine/OpenCombine/issues/1) for the list of operators that remain unimplemented, as well as the [RemainingCombineInterface.swift](https://github.com/OpenCombine/OpenCombine/blob/master/RemainingCombineInterface.swift) file. The latter contains the generated interface of Apple's Combine from the latest Xcode version. When the functionality is implemented in OpenCombine, it should be removed from the RemainingCombineInterface.swift file.

You can refer to [this repo](https://github.com/OpenCombine/combine-interfaces) to observe Apple's Combine API and documentation changes between different Xcode (beta) versions.

You can run compatibility tests against Apple's Combine. In order to do that you will need either macOS 10.14 with iOS 13 simulator installed (since the only way we can get Apple's Combine on macOS 10.14 is using the simulator), or macOS 10.15 (Apple's Combine is bundled with the OS). Execute the following command from the root of the package:
You can run compatibility tests against Apple's Combine on macOS with Xcode 26.6 or later. Execute the following command from the root of the package:

```
$ make test-compatibility
Expand All @@ -16,6 +17,9 @@ Or enable the `-DOPENCOMBINE_COMPATIBILITY_TEST` compiler flag in Xcode's build

> NOTE: Before starting to work on some feature, please consult the [GitHub project](https://github.com/OpenCombine/OpenCombine/projects/2) to make sure that nobody's already making progress on the same feature! If not, then please create a draft PR to indicate that you're beginning your work.

Run `bash utils/lint.sh origin/main` to check SwiftLint violations introduced by your changes.
The script uses the base revision as a temporary baseline for existing violations.

#### Releasing a new version

1. Create a new branch from master and call it `release/<major>.<minor>.<patch>`.
Expand Down
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:6.3

import Foundation
import PackageDescription
Expand Down Expand Up @@ -91,6 +91,7 @@ let package = Package(
openCombineDispatchTarget,
openCombineTestsTarget,
],
swiftLanguageModes: [.v5],
cxxLanguageStandard: .cxx17
)

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ The documentation of the package can be found at [OpenCombine Documentation](htt


### Installation

The current branch requires Swift 6.3 or later. On Apple platforms, use Xcode 26.6 or later.
The package uses Swift 5 language mode.
`OpenCombine` contains three public targets: `OpenCombine`, `OpenCombineFoundation` and `OpenCombineDispatch` (the fourth one, `COpenCombineHelpers`, is considered private. Don't import it in your projects).

OpenCombine itself does not have any dependencies. Not even Foundation or Dispatch. If you want to use OpenCombine with Dispatch (for example for using `DispatchQueue` as `Scheduler` for operators like `debounce`, `receive(on:)` etc.), you will need to import both `OpenCombine` and `OpenCombineDispatch`. The same applies to Foundation: if you want to use, for instance, `NotificationCenter` or `URLSession` publishers, you'll need to also import `OpenCombineFoundation`.
Expand Down Expand Up @@ -51,9 +54,9 @@ targets: [
```

###### Xcode
`OpenCombine` can also be added as a SwiftPM dependency directly in your Xcode project *(requires Xcode 11 upwards)*.
`OpenCombine` can also be added as a SwiftPM dependency directly in your Xcode project *(requires Xcode 26.6 or later)*.

To do so, open Xcode, use **File** → **Swift Packages** → **Add Package Dependency…**, enter the [repository URL](https://github.com/OpenSwiftUIProject/OpenCombine.git), choose the latest available version, and activate the checkboxes:
To do so, open Xcode, use **File** → **Add Package Dependencies…**, enter the [repository URL](https://github.com/OpenSwiftUIProject/OpenCombine.git), choose the latest available version, and activate the checkboxes:

<p align="center">
<img alt="Select the OpenCombine and OpenCombineDispatch targets"
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenCombine/CombineIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#if canImport(COpenCombineHelpers)
@_implementationOnly import COpenCombineHelpers
internal import COpenCombineHelpers
#endif

#if os(WASI)
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenCombine/Helpers/Locking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#if canImport(COpenCombineHelpers)
@_implementationOnly import COpenCombineHelpers
internal import COpenCombineHelpers
#endif

#if os(WASI)
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenCombine/Publishers/Publishers.Breakpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if !os(WASI)

#if canImport(COpenCombineHelpers)
@_implementationOnly import COpenCombineHelpers
internal import COpenCombineHelpers
#endif

extension Publisher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ extension Publisher {
/// }
///
/// cancellable = Just(DiceRoll(${dice_roll_init}))
/// .map(${', '.join(['\.' + s for s in example_dice_roll_properties])})
/// .map(${', '.join(['\\.' + s for s in example_dice_roll_properties])})
% if arity == 1:
/// .sink {
/// print ("Rolled: \($0)")
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenCombine/Publishers/Publishers.Merge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Audited for 2023 Release

#if canImport(COpenCombineHelpers)
@_implementationOnly import COpenCombineHelpers
internal import COpenCombineHelpers
#endif

// MARK: - merge methods on Publisher
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenCombine/Publishers/Publishers.Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Audited for 2023 Release

#if canImport(COpenCombineHelpers)
@_implementationOnly import COpenCombineHelpers
internal import COpenCombineHelpers
#endif

// MARK: - zip methods on Publisher
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenCombine/Subscribers/Subscribers.Completion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
// Created by Sergej Jaskiewicz on 11.06.2019.
//

#if canImport(_Concurrency) && compiler(>=5.5)
import _Concurrency
#endif

extension Subscribers {

Expand All @@ -28,9 +26,7 @@ extension Subscribers.Completion: Equatable where Failure: Equatable {}

extension Subscribers.Completion: Hashable where Failure: Hashable {}

#if canImport(_Concurrency) && compiler(>=5.5) || compiler(>=5.5.1)
extension Subscribers.Completion: Sendable {}
#endif

extension Subscribers.Completion {
private enum CodingKeys: String, CodingKey {
Expand Down
4 changes: 0 additions & 4 deletions Sources/OpenCombine/Subscribers/Subscribers.Demand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

// swiftlint:disable attributes

#if canImport(_Concurrency) && compiler(>=5.5)
import _Concurrency
#endif

extension Subscribers {

Expand Down Expand Up @@ -488,6 +486,4 @@ extension Subscribers {
}
}

#if canImport(_Concurrency) && compiler(>=5.5) || compiler(>=5.5.1)
extension Subscribers.Demand: Sendable {}
#endif
6 changes: 3 additions & 3 deletions Sources/OpenCombineDispatch/DispatchQueue+Scheduler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ extension DispatchQueue {
queue.async(group: options.group,
qos: options.qos,
flags: options.flags,
execute: action)
execute: { action() })
}

public func schedule(after date: SchedulerTimeType,
Expand All @@ -310,7 +310,7 @@ extension DispatchQueue {
queue.asyncAfter(deadline: date.dispatchTime,
qos: options.qos,
flags: options.flags,
execute: action)
execute: { action() })
}

/// Performs the action at some time after the specified date, at the specified
Expand Down Expand Up @@ -413,7 +413,7 @@ private func clampedIntProduct(_ lhs: Int64, _ rhs: Int64) -> Int64 {
extension DispatchTime {

fileprivate func polyfillDistance(to other: DispatchTime) -> DispatchTimeInterval {
#if canImport(Darwin) && compiler(>=5.1)
#if canImport(Darwin)
if #available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) {
return distance(to: other)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenCombineFoundation/Helpers/Locking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#if canImport(COpenCombineHelpers)
@_implementationOnly import COpenCombineHelpers
internal import COpenCombineHelpers
#endif

import OpenCombine
Expand Down
Loading