* Apply existential any to protocol for Swift 6
* Update Package@swift-6.0.swift
* Update Package.swift
* Apply any to Macro.Type
* Apply any for the rest
* Applying the any keyword internally for typealias in a _KeyPath
* Undoing accidental syntax
---------
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
* [FIX] Replace deprecated viewStore with store
* [FIX] Replace deprecated viewStore with store in Article
* [TEST] Match the changed view store message with the test message
* [TEST] Match the changed view store message with the test message
* Remove subscription on cancel
* Slight refactor
* Small refactor
Subscription keeps strong reference of `CurrentValueRelay` similar to `CurrentValueSubject`
* Add subscription lifetime tests
* Use weak subscriptions and remove inside send
* Change relay implementation
* For loop better
* Move tests to StoreTests.swift
* A few more locks and a Shared test.
---------
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
* Warn if bindable store binding action isn't processed
Looks like the warnings we emit when we detect `BindingReducer` is
missing are only applied to view stores, and were not ported over to the
newer observable store bindings.
This PR fixes that, though the main caveat is the messages can't seem to
point to any good context. These bindings are derived from dynamic
member lookup, which can't include source context like file/line.
* wip
* Add test
* Require main actor isolation in store collection
* `preconditionIsolated` is not available in iOS <14
* Update Sources/ComposableArchitecture/Observation/IdentifiedArray+Observation.swift
* Address `Reducer._printChanges()` sendability
Because printing is done on a queue, both `State` and `Action` must be
sendable. While `State` is easy enough to make sendable, it might be a
pain to do so in a large, modularized application. Actions are not
always so easy, but are in simple cases.
Alternately, since this is a debugging affordance:
1. We could forego sendability since all we're doing is hitting it with
a `Mirror` at the end of the day, and traffic the state/action along
in a `nonisolated(unsafe)`.
2. We could ditch the queue...but that could affect the performance
pretty negatively in some cases.
* Unchecked send the debug printing
* `@preconcurrency @MainActor` isolation of `Store`
* Remove unneeded `@MainActor`s
* Remove thread checking code
* Remove unneeded `@MainActor`s
* Swift 5.10 compatibility fixes
* wip
* More 5.10 fixes
* wip
* fixes
* wip
* wip
* up the timeout
* wip
* Fixes
* wip
* wip
* wip
* wip
* wip
* Fix binding action sendability
* Address more binding action sendability
* more bindable action sendability
* more bindable action warnings
* fix
* Make `Effect.map` sendable
* Make `Effect.actions` sendable
Also moves it to the test target, since it's only really used there.
* Make `AnyPublisher.create` sendable
* Make `_SynthesizedConformance` sendable
* Avoid non-sendable captures of `self` in reducers
We can capture the sendable case path instead.
* Make `ViewStore.yield` sendable
* Address internal sendability warning
* fix
* Another small warning
---------
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
* Require sendable IDs in cancellation/reducers
Many of our APIs warn that we are passing hashable identifiers across
concurrency boundaries, so we should require that they're sendable.
* fix
* fix
* Fix
* Allow an alert to present another alert
When we added support for vanilla SwiftUI modifiers, we lost the ability
to present one alert after another because `nil` writes to the alert
bindings unconditionally dismissed the feature, even if the feature was
freshly presented.
This fixes things by suppressing dismissal when the identity of a
presented item has changed.
Fix#3272.
* wip
* Fix: Crash when writing to user defaults in background thread
* Update tests
* Update Tests/ComposableArchitectureTests/AppStorageTests.swift
---------
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
* Fix ephemeral dismissal
This regression was introduced to fix a UIKit warning, but it causes
state to not be `nil`'d out in SwiftUI. Luckily we caught it before a
release.
* wip