82 Commits

Author SHA1 Message Date
Stephen Celis
2ef7c09b0b Update reportIssue formatting to avoid console errors (#3795)
When a non-ASCII character is fed to `reportIssue`, the following is
output to the console:

```
<decode: bad range for [%@] got [offs:330 len:1073 within:0]>
```

This causes a lot of confusion for folks, so let's update the formatting
to avoid this.
2025-10-16 10:35:05 -05:00
Brandon Williams
552e757b2c Remove mainActorNow tool where not needed. (#3788)
* Remove mainActorNow tool where not needed.

* wip
2025-10-08 20:18:34 -05:00
Stephen Celis
149fdf9c20 Use SPI docs instead of self-hosted (#3791)
* Use SPI docs instead of self-hosted

Fixes #3785.

* wip
2025-10-08 09:28:11 -07:00
Johan Kool
abd1331571 Adjust documentation for binding action (#3661)
Afaict the $ sign shouldn't used to match on a binding as was done in this documentation snippet.
2025-04-18 07:11:56 -07:00
Stephen Celis
d4d1df8102 Store internals: Refactor RootStore/ToState to "Core" protocol composition (#3460)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* get rid of originating action

* wip

* wip

* Deprecate non-writable scopes

* Revert "Deprecate non-writable scopes"

This reverts commit 95570eb602.

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2025-03-26 17:24:11 -07:00
Brandon Williams
69011b636f Add migration guide for 1.16. (#3491)
* Add migration guide for 1.16.

* Update README.md

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2024-11-19 11:04:44 -05:00
Stephen Celis
3879d2c831 Avoid sendable key paths in dynamic member lookup (#3463)
* Avoid sendable key paths in dynamic member lookup

There are a few compiler bugs that prevent us from declaring sendability
for key paths where it's needed.

First, doing so breaks autocomplete, which really hurts the developer
experience: https://github.com/swiftlang/swift/issues/77035

Second, even though recovering autocomplete might be preferable at the
cost of safety, there is no safety to begin with right now because
sendable diagnostics don't propagate through dynamic member lookup:
https://github.com/swiftlang/swift/issues/77105

Because of this, let's only use non-sendable key paths for now, and
force cast them under the hood.

* fix
2024-10-23 11:16:34 -07:00
Brandon Williams
2d0590bedd Clean up key path bitcasting. (#3411)
* Clean up key path bitcasting.

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2024-10-14 13:08:23 -04:00
Stephen Celis
912192b619 Remove unused perception branches (#3376) 2024-09-12 08:10:06 -07:00
Mason Kim
71cfb1ef2d Existential any to protocol for Swift 6 (#3370)
* 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>
2024-09-10 08:01:24 -07:00
Stephen Celis
a7e2e73f83 Swift 6: Key path sendability (#3282)
* `@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

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2024-08-29 13:46:39 -07:00
stephencelis
dfa29e0203 Run swift-format 2024-08-27 18:28:03 +00:00
Stephen Celis
08faf84fe3 MainActor Store Isolation (#3277)
* `@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

* Remove mainActorASAP in favor of mainActorNow. (#3288)

* wip

* Run swift-format

* Update README.md

* Fix integration tests. (#3294)

* Fix integration tests.

* wip

* wip

* Run swift-format

* mainActorNow doesnt need escaping closure

* wip

* migration guide

* wip

* Update MigratingTo1.14.md

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: mbrandonw <mbrandonw@users.noreply.github.com>
2024-08-27 10:57:46 -07:00
Stephen Celis
3e830b575a Swift Testing support (#3229)
* wip

* wip

* Update Testing.md

* wip

* wip

* wip

* wip

* wip:

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* disable library evolution

* bump

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2024-07-22 17:52:04 -07:00
Stephen Celis
bc8f27b1d0 Swift Language Support: Drop <5.9 (#3185)
* Swift Language Support: Drop <5.9

* wip

* wip

* wip

* wip

* wip
2024-06-19 07:40:15 -07:00
Stephen Celis
fd9ef56bb8 Don't pass embed functions directly to AnyCasePath.init (#3167)
`AnyCasePath` closures will be required to be `@Sendable` for Swift 6
data race checking, but `Enum.case` functions are not `@Sendable`
implicitly. As such we cannot pass `Enum.case` directly to functions
that expect sendable closures. Instead, we must explicitly write:

```swift
{ .case($0) }
```
2024-06-14 13:32:05 -07:00
Stephen Celis
c76914ee09 Runtime warn when stack integration is missing from store's reducer (#3048)
* Runtime warn when reducer is missing stack integration

If SwiftUI writes to a binding and the state is invalid (it is not
inserting or removing elements from the stack), then the most likely
cause is a missing `forEach` in the reducer (or a missing integration in
some parent reducer).

This commit adds a runtime warning to detect this issue.

* wip
2024-05-06 12:18:36 -07:00
Brandon Williams
2ddf47f87b Disfavor new subscript (#2875)
* Disfavor case key path for binding actions.

* wip

* fix

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2024-02-29 14:25:40 -08:00
hmhv
1f5985a359 remove invalid newlines (#2763) 2024-02-02 10:18:52 -08:00
Stephen Celis
c373d8eae3 Observable Architecture (#2593)
* bring back view store performance

* wip

* Allow chaining of store bindings

* wip

* Localize ignoring bindings to text field resignation/dismissal

* wip

* fix DiagnosticsError message (#2597)

* store collection

* wip

* wip

* update migration guide

* Add `@Presents` macro for observable presentation

While it would be nice for the `@PresentationState` property wrapper to
"just work" with TCA's upcoming observable tools, sadly that does not
seem to be the case. Adding observation directly to
`@PresentationState`, as we have done with the beta so far, can break
existing projects due to the additional observation. This primarily
manifests itself in projects that present navigation stacks, where the
`@PresentationState` observation can cause the navigation hierarchy to
recompute and trigger SwiftUI bugs.

The best we've come up with so far is introducing a brand new macro that
automatically wraps a property with `@PresentationState` _and_
instruments it with observation.

We're open to other ideas, and we do have future plans to eliminate the
need for a property wrapper or macro at all, but till then this offers a
non-breaking upgrade path!

* fixes

* Observe child store changes

* wip

* wip

* wip

* Fix typo in MigratingTo1.6.md (#2608)

* Rename bindingViewStore argument to store in MigratingTo1.6.md (#2611)

* wip

* Revert "wip"

This reverts commit f221ed0e1a.

* Add `@Presents` macro for observable presentation (#2604)

* Add `@Presents` macro for observable presentation

While it would be nice for the `@PresentationState` property wrapper to
"just work" with TCA's upcoming observable tools, sadly that does not
seem to be the case. Adding observation directly to
`@PresentationState`, as we have done with the beta so far, can break
existing projects due to the additional observation. This primarily
manifests itself in projects that present navigation stacks, where the
`@PresentationState` observation can cause the navigation hierarchy to
recompute and trigger SwiftUI bugs.

The best we've come up with so far is introducing a brand new macro that
automatically wraps a property with `@PresentationState` _and_
instruments it with observation.

We're open to other ideas, and we do have future plans to eliminate the
need for a property wrapper or macro at all, but till then this offers a
non-breaking upgrade path!

* wip

* Fix perception bindings (#2609)

* Fix runtime warning when binding accesses perceptible state.

* Fix runtime warning in SwiftUI bindings.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* wip

* wip

* fix

* wip

* wip

* wip

* Check observable state identity for presentation state.

* Add willSset/didSet to registrar types.

* clean up @Presents

* clean up

* fix

* Emit observation warnings in escaping contexts like `ForEach` and `sheet` (#2613)

* Fix perception warning in ForEach.

* fix

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>

* Introduce @ViewAction(for:) macro. (#2612)

* Add back @ViewAction macro.

* wip

* wip

* wip

* wip

* wip

* clean up

* wip

* wip

* fix migration guide'

* ViewActionable

* wip

* rename

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Introduce @BindableStore for bindings in pre-iOS 17 (#2610)

* Introduce @BindableStore.

* docs

* wip

* wip

* fixc

* wip

* wip

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* re-record intergration logs

* wip

* wip

* localize invalid stores to store collection

* Deprecate closure-based `store.scope` operations (#2618)

These uncached operations can be problematic, especially when working
with observation, which often depends on the stable identity of stores.

* document

* Update warning message

* Performance Improvement: Skip perception checks when calling reducers. (#2622)

* Skip perception checks when calling reducers.

* inline withoutPerceptionChecking() for RELEASE

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>

---------

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>

* Don't show perception warnings in action closures. (#2614)

* Don't show perception warnings in action closures.

* wip

* wip

* wip

* clean up

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* fix BindableStore + release

* Add docs

* Change associated type names of ViewActionSending (#2629)

* Fix some @ViewAction annoyances.

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* fixed merge

* Add new view modifiers for observing alerts/dialogs (#2628)

* Add new view modifiers for observing alerts/dialogs

Instead of:

```swift
.alert(store: store.scope(state: \.$alert, action: \.alert))
```

You can now do:

```swift
.alert($store.scope(state: \.alert, action: \.alert))
```

This new modifier is powered by the same store binding scope operation
that can power `sheet(item:)`, etc., and is much lighter weight than the
previous view modifier, which spun up view stores and `WithViewStore`
views.

* wip

* wip

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>

* Fix uncached warning when using Store.ifLet (#2625)

* Fix uncached warning when using Store.ifLet

* wip

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Resolve packages

* Updated scopes

* wip

* wip

* updated binding docs

* adding docs

* clean up

* wip

* wip

* wip

* clean up

* clean up

* clean up

* wip;

* lots of fixes

* update more docs

* fix

* wip

* wip

* Remove ObservationRegistrarWrapper. (#2634)

* Remove ObservationRegistrarWrapper.

* Delete Sources/ComposableArchitecture/Internal/ObservationRegistrarWrapper.swift

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* more docs

* update docs

* a few more tests

* fix

* wip

* wip

* wip

* Cache data in store collections (#2635)

* fix tutorial highlighting

* wip

* wip

* wip

* wip

* tests for observation of special domain types

* another test

* fix

* wip

* Implement memoization for perception checks (#2630)

* Implement memoization for isInSwiftUIBody

* tidy up

* Perception caching updates (#2649)

* Small updates to perception caching.

* wip

* debug

* some more macro tests

* syncups tutorial beginnings

* wip

* wip

* wip

* wip

* wip

* merge fixes

* wip

* update tests

* fix

* fix

* fix perception checking in store

* rename task local

* delete old test

* deprecate test using old apis

* fix test

* perception tests for store

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Opt out of key path for Store.ifLet

* sync ups

* lots more sync up tutorial

* more sync ups tutorial

* wip

* wip

* wio

* wip

* wip

* wip

* updated references of 1.6 to 1.7

* wip

* no need to force unwrap here

* fixed crash in ForEach with bindings

* more sync ups tutorial

* more sync ups tutorial

* wip

* more sync ups

* wip

* wip

* Better support for observing copies of values (#2650)

* Explore using _modify

* wip

* wip

* wip

* wip

* wip

* wip

* more tests

* wip

* get another failing test for an edge case

* wip

* tests all passing

* flag for determining when new state was created

* wip

* clean up

* wip

* wip

* wip;

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* New test that currently fails.

* wip

* wip

* Update Sources/ComposableArchitectureMacros/PresentsMacro.swift

* wip

* remove redundant attached member attribute

* storage

* cleanup

* more benchmarks and tests

* wip

* wip

* wip

* wip

* update tests

* wip

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>

* wip

* wip

* wip

* swift-format

* fix

* wip

* wip

* wip

* wip

* Perception

* wip

* wip

* clean up shared state

* fix shared state tests

* wip

* add alert test

* wip

* wip

* wip

* wip

* Use transaction in binding

* wip

* wip

* wip

* wip

* wip

* wip

* uikit

* keep references to controllers when presenting so that we can properly dismiss

* change order of features in shared state demo

* wip

* cleanup

* cleanup

* wip

* wip

* wip

* Fix perception checking for effect actions.

* wip

* wip

* wip

* Fix perception checking for effect actions.

* wip

* wip

* remove sync ups tutorial

* wip

* wip

* wip

* wip

* wip

* docs for observe function for uikit

* Add cancellation to observation'

* re-record integration test snapshots

* fixed some todos

* update test

* remove 5.9.2 checks

* wip

* improve docs

* update docs

* updates

* lots of fixes

* more docs

* remove unneeded file;

* wip

* wip

* wip

* update readme and getting started

* wip

* simplify

* migration stuff

* wip

* Update Models.swift

* wip

* wip

* wip

* Update Bindings.md

* wip

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

Co-authored-by: Kabir Oberai <oberai.kabir@gmail.com>

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: hmhv <admin@hmhv.info>
Co-authored-by: Jimmy Prime <jimmylevelup@gmail.com>
Co-authored-by: Michael Pohl <15653162+Mika5652@users.noreply.github.com>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: George Scott <gscott@gekkoto.com>
Co-authored-by: Kabir Oberai <oberai.kabir@gmail.com>
2024-01-26 16:59:03 -08:00
stephencelis
8edcd12683 Run swift-format 2023-12-20 02:36:02 +00:00
Stephen Celis
087b6b5730 Overhaul store scope communication (#2664)
* store 2

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* check sharesStorage in ==

* wip

* wip

* fix crashes

* wip

* wip

* wip

* wip

* clean up

* wip

* wip

* wip

* wip

* rename

* wip

* wip

* fix

* stack

* wip

* wip

* wip

* wip

* wip

* wip

* remove duplicates based on presentation storage

* wip

* wip

* wip

* wip

* update log snapshots

* bring back expected failure

* wip

* remove removeDuplicates

* test for fast path of PresentationState

* wip

* Updated logs

* wip

* wip

* wip

* wip

* Skip flakey CI test

* bump timeout

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2023-12-19 18:35:08 -08:00
Stephen Celis
efba1336af Fix BindingAction's case key path for extraction (#2600) 2023-11-29 11:50:46 -08:00
Stephen Celis
57e804f1cc Macro bonanza (#2553)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Silence test warnings

* wip

* wip

* wip

* update a bunch of docs

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Kill integration tests for now

* wip

* wip

* wip

* wip

* updating docs for @Reducer macro

* replaced more Reducer protocols with @Reducer

* Fixed some broken docc references

* wip

* Some @Reducer docs

* more docs

* convert some old styles to new style

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* bump

* update tutorials to use body

* update tutorials to use DML on destination state enum

* Add diagnostic

* wip

* updated a few more tests

* wip

* wip

* Add another gotcha

* wip

* wip

* wip

* fixes

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* remove for now

* wip

* wip

* updated some docs

* migration guides

* more migration guide

* fix ci

* fix

* soft deprecate all apis using AnyCasePath

* wip

* Fix

* fix tests

* swift-format 509 compatibility

* wip

* wip

* Update Sources/ComposableArchitecture/Macros.swift

Co-authored-by: Mateusz Bąk <bakmatthew@icloud.com>

* wip

* wip

* update optional state case study

* remove initializer

* Don't use @State for BasicsView integration demo

* fix tests

* remove reduce diagnostics for now

* diagnose error not warning

* Update Sources/ComposableArchitecture/Macros.swift

Co-authored-by: Jesse Tipton <jesse@jessetipton.com>

* wip

* move integration tests to cron

* Revert "move integration tests to cron"

This reverts commit f9bdf2f04b.

* disable flakey tests on CI

* wip

* wip

* Revert "Revert "move integration tests to cron""

This reverts commit 66aafa7327.

* fix

* wip

* fix

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: Mateusz Bąk <bakmatthew@icloud.com>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: Jesse Tipton <jesse@jessetipton.com>
2023-11-13 12:57:35 -08:00
Stephen Celis
5ba7943402 Internal: rename Store.{state,stateSubject} (#2538)
* Internal: rename `Store.{state,stateSubject}`

Both an internal readability win and will make it easier to provide a
public `state` property in the future.

* wip
2023-10-31 14:45:57 -07:00
Stephen Celis
195284b94b The Composable Architecture 1.0 (#2318)
* docs

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Fix invalid states count for 3 optionals and typos (#2094)

* wip

* wip

* more dismisseffect docs

* fixed some references

* navigation doc corrections

* more nav docs

* fix cancellation tests in release mode

* wrap some tests in #if DEBUG since they are testing expected failures

* update UUIDs in tests to use shorter initializer

* fixed a todo

* wip

* fix merge errors

* wip

* fix

* wip

* wip

* fixing a bunch of todos

* get rid of rawvalue in StackElementID

* more todos

* NavLinkStore docs

* fix swift 5.6 stuff

* fix some standups tests

* fix

* clean up

* docs fix

* fixes

* wip

* 5.6 fix

* wip

* wip

* dont parallelize tests

* updated demo readmes

* wip

* Use ObservedObject instead of StateObject for alert/dialog modifiers.

* integration tests for bad dismissal behavior

* check for runtime warnings in every integration test

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* Drop a bunch of Hashables.

* some nav bug fixes

* wip

* wip

* wip

* fix

* fix

* wip

* wip

* Simplify recording test.

* add concurrent async test

* fix

* wip

* Refact how detail dismisses itself.

* fix

* 5.6 fix

* wip

* wip

* wip

* wip

* Add TestStore.assert.

* Revert "Add TestStore.assert."

This reverts commit a892cccc66.

* add Ukrainian Readme.md (#2121)

* Add TestStore.assert. (#2123)

* Add TestStore.assert.

* wip

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* fix tests

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Run swift-format

* push for store.finish and presentation

* wip

* move docs around

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Add case subscripts

* wip

* wip

* wip

* 5.7-only

* wip

* wip

* wip

* wip

* fix

* revert store.finish task cancellation

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* add test for presentation scope

* wip

* wip

* wip

* wip

* wip

* cleanup

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Rename ReducerProtocol.swift to Reducer.swift (#2206)

* Hard-deprecate old SwitchStore initializers/overloads

* wip

* wip

* Resolve CaseStudies crash (#2258)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Bump timeout for CI

* wip

* Remove old deprecations

* Simplify test store

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* images for tutorials

* wip

* wip

* Remove deprecated alert APIs

* Bump dependencies

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: 유재호 <y73447jh@gmail.com>
Co-authored-by: Dmytro <barabashdmyto@gmail.com>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: mbrandonw <mbrandonw@users.noreply.github.com>
2023-07-30 14:58:40 -07:00
Stephen Celis
37b8a41e09 Allow chaining into BindingViewState (#2334)
Currently, `BindingViewStore`s can only directly derive
`BindingViewState` for a view state struct, and then the view store can
derive a binding and use dynamic member lookup to pluck out a field for
a view. This means potentially exposing view state to far more state
than necessary.

To prevent this we can add dynamic member lookup to the binding view
state itself, which allows a view state struct to chip away any state it
doesn't care about.
2023-07-30 10:53:46 -07:00
Brandon Williams
2c93195c23 Prerelease 1.0 (#1929)
* Converted voice memos back to identified array

* update deps

* update docs for DismissEffect

* wip

* Add Sendable conformance to PresentationState (#2086)

* wip

* swift-format

* wip

* wip

* fix some warnings

* docs

* wip

* wip

* Catch some typos in Articles (#2088)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* docs

* wip

* wip

* docs

* wip

* wip

* wip

* wip

* docs

* docs

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Fix invalid states count for 3 optionals and typos (#2094)

* wip

* wip

* more dismisseffect docs

* fixed some references

* navigation doc corrections

* more nav docs

* fix cancellation tests in release mode

* wrap some tests in #if DEBUG since they are testing expected failures

* update UUIDs in tests to use shorter initializer

* fixed a todo

* wip

* fix merge errors

* wip

* fix

* wip

* wip

* fixing a bunch of todos

* get rid of rawvalue in StackElementID

* more todos

* NavLinkStore docs

* fix swift 5.6 stuff

* fix some standups tests

* fix

* clean up

* docs fix

* fixes

* wip

* 5.6 fix

* wip

* wip

* dont parallelize tests

* updated demo readmes

* wip

* Use ObservedObject instead of StateObject for alert/dialog modifiers.

* integration tests for bad dismissal behavior

* check for runtime warnings in every integration test

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* Drop a bunch of Hashables.

* some nav bug fixes

* wip

* wip

* wip

* fix

* fix

* wip

* wip

* Simplify recording test.

* add concurrent async test

* fix

* wip

* Refact how detail dismisses itself.

* fix

* 5.6 fix

* wip

* wip

* wip

* wip

* Add TestStore.assert.

* Revert "Add TestStore.assert."

This reverts commit a892cccc66.

* add Ukrainian Readme.md (#2121)

* Add TestStore.assert. (#2123)

* Add TestStore.assert.

* wip

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* fix tests

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Run swift-format

* push for store.finish and presentation

* wip

* move docs around

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Add case subscripts

* wip

* wip

* wip

* 5.7-only

* wip

* wip

* wip

* wip

* fix

* revert store.finish task cancellation

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* add test for presentation scope

* wip

* wip

* wip

* wip

* wip

* cleanup

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Rename ReducerProtocol.swift to Reducer.swift (#2206)

* Hard-deprecate old SwitchStore initializers/overloads

* wip

* wip

* Resolve CaseStudies crash (#2258)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Bump timeout for CI

* wip

* wip

---------

Co-authored-by: Jackson Utsch <jutechs@gmail.com>
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: 유재호 <y73447jh@gmail.com>
Co-authored-by: Dmytro <barabashdmyto@gmail.com>
Co-authored-by: mbrandonw <mbrandonw@users.noreply.github.com>
2023-07-27 17:35:07 -07:00
Stephen Celis
cc8f6611e9 Abbreviate nested binding action values (#2315)
* Abbreviate nested binding action values

Now that binding action key paths cannot use dynamic member lookup,
dumps are a little more unwieldy to read when nested state is involved.
Generally one can look at the state diff to figure out what changed, so
let's abbreviate the action's state when we can.

* wip
2023-07-21 08:47:30 -07:00
Stephen Celis
faadf6a780 Add named closure arguments (#2295)
* Add named closure arguments

Better for documentation and auto-fill.

* wip
2023-07-16 15:27:02 -07:00
Stephen Celis
d69b5db82c Fix view state binding equatability (#2255)
* Fix view state binding equatability

* wip

* wip

* wip

* wip

* wip
2023-07-12 16:25:55 -07:00
Stephen Celis
663a45f39d Fix WithViewStore initializer ambiguity (#2278)
* Test to show when ambiguous init of ViewStore happens

* Fix #2275

* wip

---------

Co-authored-by: Johan Kool <johankool@users.noreply.github.com>
2023-07-12 14:23:39 -07:00
Jesse Tipton
d2d3c149cc Add BindingViewStore initializers for ViewStore (#2274) 2023-07-12 14:09:40 -07:00
Jesse Tipton
745bc10361 Fix commas that should be periods in docs (#2267) 2023-07-07 22:36:50 -07:00
bharath2020
d74930b494 Fixed BindingAction.set(keyPath:value:) causes equality test on value to fail (#2248)
* Fixed BindingAction.set(keyPath:value:) causes equality test on value to fail

* clean up

---------

Co-authored-by: Bharath Booshan <bbooshan@atlassian.com>
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2023-06-30 11:20:15 -04:00
Stephen Celis
f2de7e7f66 Weaken BindingViewStore's dynamic member lookup (#2243)
Right now it requires a writably, equatable property, but that prevents
accessing `let` constants on state.
2023-06-29 08:30:26 -07:00
stephencelis
93c878441b Run swift-format 2023-06-28 18:57:06 +00:00
Stephen Celis
43e28a57f3 Update docs for next release (#2238)
* Update docs for next release

* wip

* fix deprecations

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2023-06-28 11:34:01 -07:00
stephencelis
461ee90b74 Run swift-format 2023-06-28 16:36:43 +00:00
Stephen Celis
95d2bc701b Better Bindings Revisited (#2215)
* Simpler bindable view state

* wip

* wip

* wip

* wip

* wip

* wip

* simplify

* wip

* wip

* wip

* wip

* wip

* wip

* wip
2023-06-28 09:31:12 -07:00
Stephen Celis
c432a76b5b Navigation (#1945)
* wip

* fix

* wip

* wip

* move

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Fix

* wip

* wip

* Renamed action to onTap in NavigationLinkStore (#2043)

Renamed the `action` parameter to mirror other inits and differentiate itself from `action fromDestinationAction`

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Tie view identity to stack element identity

* Tie item identity to case

* wip

* wip

* cleanup

* fix

* fix

* Add warning to nav link

* wip

* wip

* Rename FullscreenCover.swift to FullScreenCover.swift (#2062)

* wip

* fix isDetailLink on non-iOS platforms

* Correct some comments in Effect.swift (#2081)

* add integration tests for showing alert/dialog from alert/dialog.

* copy StackElementIDGenerator dependency before running TestStore receive closure.

* Removed some unneeded delegate actions.

* wip

* clean up

* lots of clean up

* Converted voice memos back to identified array

* update deps

* update docs for DismissEffect

* wip

* Add Sendable conformance to PresentationState (#2086)

* wip

* swift-format

* wip

* wip

* docs

* wip

* wip

* Catch some typos in Articles (#2088)

* wip

* wip

* wip

* wip

* wip

* docs

* wip

* wip

* docs

* wip

* wip

* wip

* wip

* docs

* docs

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Fix invalid states count for 3 optionals and typos (#2094)

* wip

* wip

* more dismisseffect docs

* fixed some references

* navigation doc corrections

* more nav docs

* fix cancellation tests in release mode

* wrap some tests in #if DEBUG since they are testing expected failures

* update UUIDs in tests to use shorter initializer

* fixed a todo

* wip

* fix merge errors

* wip

* fix

* wip

* wip

* fixing a bunch of todos

* get rid of rawvalue in StackElementID

* more todos

* NavLinkStore docs

* fix swift 5.6 stuff

* fix some standups tests

* fix

* clean up

* docs fix

* fixes

* wip

* 5.6 fix

* wip

* wip

* dont parallelize tests

* updated demo readmes

* wip

* Use ObservedObject instead of StateObject for alert/dialog modifiers.

* integration tests for bad dismissal behavior

* check for runtime warnings in every integration test

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* Drop a bunch of Hashables.

* some nav bug fixes

* wip

* wip

* wip

* fix

* fix

* wip

* wip

* Simplify recording test.

* add concurrent async test

* fix

* wip

* Refact how detail dismisses itself.

* fix

* 5.6 fix

* wip

* wip

* Add TestStore.assert.

* Revert "Add TestStore.assert."

This reverts commit a892cccc66.

* add Ukrainian Readme.md (#2121)

* Add TestStore.assert. (#2123)

* Add TestStore.assert.

* wip

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* fix tests

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Run swift-format

* push for store.finish and presentation

* move docs around

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Add case subscripts

* wip

* wip

* 5.7-only

* wip

* wip

* wip

* wip

* revert store.finish task cancellation

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* add test for presentation scope

* wip

* wip

* wip

* wip

* wip

* cleanup

* updated presentation scope test

* sytnax update

* clean up

* fix test

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: Martin Václavík <mvaclavik96@icloud.com>
Co-authored-by: 유재호 <y73447jh@gmail.com>
Co-authored-by: Jackson Utsch <jutechs@gmail.com>
Co-authored-by: Dmytro <barabashdmyto@gmail.com>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: mbrandonw <mbrandonw@users.noreply.github.com>
2023-05-30 12:22:00 -04:00
Stephen Celis
14c11ade59 Don't pass file and line to runtime warnings (#2059)
Runtime warnings are not test helpers that should propagate XCTest
failures to the original file/line, so we should always omit that
information. This leads to better test failures that show up alongside
the test, not buried in application code.
2023-04-25 11:40:02 -07:00
유재호
ce187a4d08 Update remaining 'bindable state' to 'binding state' (#2054) 2023-04-25 09:38:05 -07:00
Ryu
23501d36a7 Fix Document in BindingAction (#2019) 2023-04-03 08:25:29 -07:00
Stephen Celis
c330496164 Workaround for BindingAction existential layout crash (#1881)
* Add test case for binding action crash

* Workaround layout issue

* flakey test

* wip
2023-01-30 10:57:04 -08:00
Stephen Celis
52c4a01437 Rename BindableState to BindingState (#1855)
The -`able` naming evokes protocols in Swift, and is an outlier when
considered alongside the rest of TCA's binding tools:

- `BindingAction`: concrete type
- `BindableAction`: protocol
- `BindingReducer`: concrete type

So, let's make things consistent.

The one caveat is that Swift diagnostics for such a deprecation aren't
great, so users won't get proactive warnings here for the time being:

https://github.com/apple/swift/issues/63139

We may just want to keep the deprecation around till it does...
2023-01-20 14:56:53 -08:00
Jon Shier
888af2fafc Conditionally conform BindableState to Sendable. (#1834) 2023-01-14 12:03:45 -08:00
Stephen Celis
30015d13a3 Revert #1790 (#1795)
It occurred to us that this solution unfortunately is incompatible with
view actions. We have an alternate solution that works, so I'll PR that
in the future if no others materialize!
2023-01-05 18:04:48 -05:00
stephencelis
d1c2e5b6d1 Run swift-format 2023-01-05 18:30:30 +00:00
Thomas Grapperon
c719fa1d39 Allow BindingReducer to work with ViewState (#1790)
* Simpler bindable view state

* wip

* wip

* Remove `BindingStore`

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Make BindingState conditionally sendable.

* Fixed tests

* Update bindings article

* Add some additional contextual information to the runtime warnings

* update some docs

* lots more docs

* test clean up

* Improve diagnostic

* Put back `BindingReducer()` in the form study

* clean up

* Improve DocC references

* Remove DocC references for `@`'d property wrappers.

* wip

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2023-01-05 13:18:34 -05:00