All Projects → OpenCombine → Opencombine

OpenCombine / Opencombine

Licence: mit
Open source implementation of Apple's Combine framework for processing values over time.

Programming Languages

swift
15916 projects
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Opencombine

CombineCoreBluetooth
A wrapper API for CoreBluetooth using Combine Publishers
Stars: ✭ 50 (-97.55%)
Mutual labels:  tvos, watchos, reactive-programming, combine
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (-85.54%)
Mutual labels:  tvos, watchos, swift-package-manager
Skeletonui
☠️ Elegant skeleton loading animation in SwiftUI and Combine
Stars: ✭ 275 (-86.52%)
Mutual labels:  tvos, watchos, swift-package-manager
Surmagic
🚀 The better way to deal with Binary Frameworks on iOS, Mac Catalyst, tvOS, macOS, and watchOS. Create XCFrameworks with ease.
Stars: ✭ 119 (-94.17%)
Mutual labels:  tvos, watchos, swift-package-manager
Dots
Lightweight Concurrent Networking Framework
Stars: ✭ 35 (-98.28%)
Mutual labels:  tvos, watchos, swift-package-manager
Mechanica
A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.
Stars: ✭ 27 (-98.68%)
Mutual labels:  tvos, watchos, swift-package-manager
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (-74.17%)
Mutual labels:  tvos, watchos, swift-package-manager
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-92.25%)
Mutual labels:  tvos, watchos, swift-package-manager
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+1313.04%)
Mutual labels:  reactive-programming, tvos, watchos
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (-52.75%)
Mutual labels:  tvos, watchos, swift-package-manager
Waterfallgrid
A waterfall grid layout view for SwiftUI.
Stars: ✭ 1,086 (-46.76%)
Mutual labels:  tvos, watchos, swift-package-manager
tracelog
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS.
Stars: ✭ 52 (-97.45%)
Mutual labels:  tvos, watchos, swift-package-manager
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (-85.98%)
Mutual labels:  tvos, watchos, swift-package-manager
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+424.8%)
Mutual labels:  tvos, watchos, swift-package-manager
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-91.32%)
Mutual labels:  tvos, watchos, swift-package-manager
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (-85.2%)
Mutual labels:  tvos, watchos, swift-package-manager
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-93.24%)
Mutual labels:  tvos, watchos, swift-package-manager
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (-68.58%)
Mutual labels:  tvos, watchos, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (-40.39%)
Mutual labels:  tvos, watchos, swift-package-manager
Conbini
Publishers, operators, and subscribers to supplement Combine.
Stars: ✭ 109 (-94.66%)
Mutual labels:  reactive-programming, tvos, watchos

OpenCombine

OpenCombine codecov Language Platform Cocoapods

Open-source implementation of Apple's Combine framework for processing values over time.

The main goal of this project is to provide a compatible, reliable and efficient implementation which can be used on Apple's operating systems before macOS 10.15 and iOS 13, as well as Linux, Windows and WebAssembly.

Installation

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.

If you develop code for multiple platforms, you may find it more convenient to import the OpenCombineShim module instead. It conditionally re-exports Combine on Apple platforms (if available), and all OpenCombine modules on other platforms. You can import OpenCombineShim only when using SwiftPM. It is not currently available for CocoaPods.

Swift Package Manager
Swift Package

To add OpenCombine to your SwiftPM package, add the OpenCombine package to the list of package and target dependencies in your Package.swift file. OpenCombineDispatch and OpenCombineFoundation products are currently not supported on WebAssembly. If your project targets WebAssembly exclusively, you should omit them from the list of your dependencies. If it targets multiple platforms including WebAssembly, depend on them only on non-WebAssembly platforms with conditional target dependencies.

dependencies: [
    .package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.12.0")
],
targets: [
    .target(
        name: "MyAwesomePackage",
        dependencies: [
            "OpenCombine",
            .product(name: "OpenCombineFoundation", package: "OpenCombine"),
            .product(name: "OpenCombineDispatch", package: "OpenCombine")
        ]
    ),
]
Xcode

OpenCombine can also be added as a SwiftPM dependency directly in your Xcode project (requires Xcode 11 upwards).

To do so, open Xcode, use FileSwift PackagesAdd Package Dependency…, enter the repository URL, choose the latest available version, and activate the checkboxes:

Select the OpenCombine and OpenCombineDispatch targets

CocoaPods

To add OpenCombine to a project using CocoaPods, add OpenCombine and OpenCombineDispatch to the list of target dependencies in your Podfile.

pod 'OpenCombine', '~> 0.12.0'
pod 'OpenCombineDispatch', '~> 0.12.0'
pod 'OpenCombineFoundation', '~> 0.12.0'

Contributing

In order to work on this project you will need Xcode 10.2 and Swift 5.0 or later.

Please refer to the issue #1 for the list of operators that remain unimplemented, as well as the RemainingCombineInterface.swift file. The latter contains the generated interface of Apple's Combine from the latest Xcode 11 version. When the functionality is implemented in OpenCombine, it should be removed from the RemainingCombineInterface.swift file.

You can refer to this repo 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:

$ make test-compatibility

Or enable the -DOPENCOMBINE_COMPATIBILITY_TEST compiler flag in Xcode's build settings. Note that on iOS only the latter will work.

NOTE: Before starting to work on some feature, please consult the GitHub project 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.

Releasing a new version

  1. Create a new branch from master and call it release/<major>.<minor>.<patch>.

  2. Replace the usages of the old version in README.md with the new version (make sure to check the Swift Package Manager and CocoaPods sections).

  3. Bump the version in OpenCombine.podspec, OpenCombineDispatch.podspec and OpenCombineFoundation.podspec. In the latter two you will also need to set the spec.dependency "OpenCombine" property to the previous version. Why? Because otherwise the pod lib lint command that we run on our regular CI will fail when validating the OpenCombineDispatch and OpenCombineFoundation podspecs, since the dependencies are not yet in the trunk. If we set the dependencies to the previous version (which is already in the trunk), everything will be fine. This is purely to make the CI work. The clients will not experience any issues, since the version is specified as >=.

  4. Create a pull request to master for the release branch and make sure the CI passes.

  5. Merge the pull request.

  6. In the GitHub web interface on the releases page, click the Draft a new release button.

  7. The Tag version and Release title fields should be filled with the version number.

  8. The description of the release should be consistent with the previous releases. It is a good practice to divide the description into several sections: additions, bugfixes, known issues etc. Also, be sure to mention the nicknames of the contributors of the new release.

  9. Publish the release.

  10. Switch to the master branch and pull the changes.

  11. Push the release to CocoaPods trunk. For that, execute the following commands:

    pod trunk push OpenCombine.podspec --verbose --allow-warnings
    pod trunk push OpenCombineDispatch.podspec --verbose --allow-warnings
    pod trunk push OpenCombineFoundation.podspec --verbose --allow-warnings
    

    Note that you need to be one of the owners of the pod for that.

GYB

Some publishers in OpenCombine (like Publishers.MapKeyPath, Publishers.Merge) exist in several different flavors in order to support several arities. For example, there are also Publishers.MapKeyPath2 and Publishers.MapKeyPath3, which are very similar but different enough that Swift's type system can't help us here (because there's no support for variadic generics). Maintaining multiple instances of those generic types is tedious and error-prone (they can get out of sync), so we use the GYB tool for generating those instances from a template.

GYB is a Python script that evaluates Python code written inside a template file, so it's very flexible — templates can be arbitrarily complex. There is a good article about GYB on NSHipster.

GYB is part of the Swift Open Source Project and can be distributed under the same license as Swift itself.

GYB template files have the .gyb extension. Run make gyb to generate Swift code from those templates. The generated files are prefixed with GENERATED- and are checked into source control. Those files should never be edited directly. Instead, the .gyb template should be edited, and after that the files should be regenerated using make gyb.

Debugger Support

The file opencombine_lldb.py defines some lldb type summaries for easier debugging. These type summaries improve the way lldb and Xcode display some OpenCombine values.

To use opencombine_lldb.py, figure out its full path. Let's say the full path is ~/projects/OpenCombine/opencombine_lldb.py. Then the following statement to your ~/.lldbinit file:

command script import ~/projects/OpenCombine/opencombine_lldb.py

Currently, opencombine_lldb.py defines type summaries for these types:

  • Subscribers.Demand
  • That's all for now.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].