Skip to content

Conversation

@jessesquires
Copy link
Owner

@jessesquires jessesquires commented Dec 10, 2025

Closes #157.

  • Adopt Swift 6
  • Support Concurrency
  • Remove background diffing

Maintaining CollectionViewDriverOptions.diffOnBackgroundQueue is too large of an effort for very little benefit. It was always questionable, and against guidance from the UIKit team.

See this blog post for more:

https://www.jessesquires.com/blog/2024/12/19/diffable-data-source-main-actor-inconsistency

From the UIKit team:

We have seen a number of issues stemming from usage of diffable data source on background queues/threads, and the performance benefits of doing this are generally minimal due to the fact that only the diffing of identifiers in the old & new snapshots happens on the background queue/thread; the work to set up and execute the Ul updates and animations for cells always happens on the main thread. Therefore, we made the decision to restrict diffable data source to the main actor when using Swift Concurrency, as this ensures correctness in all cases and is nearly always the best approach anyways. If you were previously applying snapshots from a background queue, we recommend you update your implementation to do so on the main queue instead.

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 modernizes the ReactiveCollectionsKit library by adopting Swift 6 and removing the background diffing feature. The change simplifies the codebase by eliminating the CollectionViewDriverOptions.diffOnBackgroundQueue option and its associated implementation, which was always questionable and contrary to UIKit team guidance. All diffing now occurs on the main thread with proper @MainActor isolation, aligning with Swift 6's strict concurrency model.

Key changes:

  • Updated to Swift 6.0 language mode across Package.swift, Xcode project, and documentation
  • Removed CollectionViewDriverOptions.diffOnBackgroundQueue property and related background queue infrastructure
  • Simplified DiffableDataSource by removing nonisolated annotations and MainActor.assumeIsolated wrappers, relying on @MainActor class isolation instead

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Package.swift Updated Swift language mode from .v5 to .v6, removed experimental StrictConcurrency settings
ReactiveCollectionsKit.xcodeproj/project.pbxproj Updated SWIFT_VERSION from 5.0 to 6.0 for both Debug and Release configurations
README.md Updated Swift version requirement from 5.10+ to 6.0+
Sources/CollectionViewDriverOptions.swift Removed diffOnBackgroundQueue property and its associated parameter from initializer
Sources/CollectionViewDriver.swift Removed diffOnBackgroundQueue parameter when initializing DiffableDataSource
Sources/DiffableDataSource.swift Removed background queue infrastructure, _diffingQueue property, and conditional background/main queue logic; simplified methods by removing nonisolated and MainActor.assumeIsolated calls
Sources/DebugDescriptions.swift Removed diffOnBackgroundQueue field from debug descriptions
Tests/Utils/CollectionViewDriverOptions+Extensions.swift Updated test helper to remove diffOnBackgroundQueue parameter
Tests/TestCollectionViewDriverOptions.swift Removed tests for diffOnBackgroundQueue property and updated debug description assertions
Tests/TestDebugDescriptionDriver.swift Updated expected debug output to remove diffOnBackgroundQueue field
Tests/TestCollectionViewDriver.swift Updated test to use default options instead of explicitly setting diffOnBackgroundQueue: true
Example/Sources/List/ListViewController.swift Removed diffOnBackgroundQueue option from driver initialization
CHANGELOG.md Added 0.2.0 release notes documenting the breaking change

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

Closes #157.

- Adopt Swift 6
- Support Concurrency
- Remove background diffing

Maintaining `CollectionViewDriverOptions.diffOnBackgroundQueue` is too large of an effort for very little benefit. It was always questionable, and against guidance from the UIKit team.

See this blog post for more:

https://www.jessesquires.com/blog/2024/12/19/diffable-data-source-main-actor-inconsistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt Swift 6 + Concurrency + Drop background diffing support

2 participants