* 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
While we should get both dependencies picked up from
swift-dependencies' exports, we've heard reports from folks that they're
getting linker/symbol errors here. We should update these uses
regardless!
* Add support for custom decoding/encoding to `fileStorage`
* Update FileStorageKey.swift
---------
Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
* Make 'didSet' main actor.
* tests for AppStorageKey
* wip
* tests
* clean up
* Update Sources/ComposableArchitecture/SharedState/PersistenceKey/AppStorageKey.swift
* Update Sources/ComposableArchitecture/SharedState/PersistenceKey/AppStorageKeyPathKey.swift
* try working around CI problem
* Added NB
* wip
* Update MigratingTo1.11.md
---------
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Currently, the following reducer enum:
```swift
@Reducer
enum Destination {
case alert(AlertState<Never>)
}
```
Generates the following action:
```swift
@CasePathable
enum Action {
case alert(AlertState<Never>.Action)
}
```
And this produces a warning in Case Paths 1.5 due to the nested `Never`
not being referenced directly.
This PR plucks the action type out and embeds it directly, instead:
```diff
-case alert(AlertState<Never>.Action)
+case alert(Never)
```
Which will allow us to better suppress warnings Swift emits for
uninhabited types.