18 Commits

Author SHA1 Message Date
Stephen Celis
f02fab5000 Allow an alert to present another alert (#3309)
* 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
2024-08-26 15:19:08 -07:00
Stephen Celis
dae1b9aafb Leverage UIKitNavigation (#3180)
* wip

* wip

* wip

* Update

* Remove duplicate UIAlertAction convenience initializers (#3188)

* wip

* wip

* wip

* fixes

* wip

* Add nav stack helper

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* watch fix

---------

Co-authored-by: Cosmic Flamingo <67525430+acosmicflamingo@users.noreply.github.com>
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2024-08-13 16:01:24 -04: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
e121b91fb4 Shared State (#2858)
* Shared State

* fix compiler errors in 5.7

* fixes and tests

* fix

* fix

* wip

* longer sleeps

* fix test

* fix tests

* Clean up some typos in SharingState.md (#2860)

* public inits

* wip

* wip

* add test for shared state and onChange

* Case study for sandboxing shared state

* tweaks to case study

* wip

* add tests to sandboxing case study

* rename files

* wip

* simplify sync up tests

* wip

* fix

* wip

* fix $shared.publisher non-determinism and write test that currently fails but ideally would not.

* more docs and a test for autoclosure

* more docs

* wip

* update todo with persistence

* wip

* wip

* support default `nil` optionals in `@Shared`

* Introduce unavailable overload for better diagnostics

* Fix autocomplete from `@Shared(.`

* Revert "Fix autocomplete from `@Shared(.`"

This reverts commit fd1798f9f5.

* Fix defaults

* wip

* Give persistence keys a synchronous update interface (#2880)

* Don't use async sequence for persistence

* wip

* wip

* wip

* Update Sources/ComposableArchitecture/SharedState/PersistenceKey.swift

Co-authored-by: Hal Lee <hal@lee.me>

---------

Co-authored-by: Hal Lee <hal@lee.me>

* Revert sharing in Todos for now

* wip

* wip

* Pass initial shared value to strategy / register app storage (#2904)

* Pass initial shared value to strategy / register app storage

This PR modifies the `PersistenceKey` protocol so that its `load` and
`subscribe` endpoints are handed the initial value and must return a
non-optional value. By feeding this value in, we can ensure that
`.appStorage` declared in a feature is registered outside the feature.

* wip

* wip

* wip

* wip

* wip

* wip

* swift-format

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/SharingState.md

Co-authored-by: Pyry Jahkola <pyry.jahkola@iki.fi>

* non-exhaustive fix

* wip

* remove decodable for now

* Fix app storage registration with `nil` values

* fix

* wip

* tutorial

* fixes

* lots of tutorial fixes

* more tutorial fixes

* more tutorial fixes

* more tutorial fixes

* tutorial fixes

* wip

* re-arrange test

* Remove store shared preview quarantine

* Add support for \.defaultInMemoryStorage (#2965)

* fix

* Added Privacy Manifest file (#2930)

* Added Privacy Manifest file

* Update Package@swift-5.9.swift

---------

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

* remove warning overloads

* write default instead of register

this is more consistent with SwiftUI's property wrapper, and causes less
strangeness when multiple repeat properties have different defaults

* move privacy manifest

* wip

* wip

* EphemeralFileStorage -> InMemoryFileStorage

* documented gotcha

* add test

* Shared state beta task snaps (#2976)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

---------

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

* wip

* Use notification center instead of KVO for user defaults observation. (#2978)

* Use notification center instead of KVO for user defaults observation.

* wip

* wip

* Introduce @SharedReader (#2979)

* wip

* wip

* wip

* wip

* wip

* wip

* Introduce @SharedReader.

* wip

* wip

* sendable

* wip

* wip

---------

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

* Make Shared.Subscription.cancel public (#2983)

* added failing test

* Add convenience initializers

* Save to file storage when app is about to be terminated (#2992)

* Save file storage on termination too.

* wip

* Shared change tracking enhancements (#2989)

* wip

* wip

* wip

* wip

* Add unavailable conformance

* wip

* wip

* wip

* Don't need to check for previews.

* Add default providing persistence key (#2980)

* wip - default providing key

* warn on default access

* Revert "warn on default access"

This reverts commit 38706450bef44a50f94afeaddbc4628e383b52b3.

* wip

* wip

* wip - tests

* wip - reader key

* fix docs

* A few changes.

* A few more changes.

* docs

---------

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

* Fix optional shared defaults.

* undo last commit but keep test

* wip

* Better shared state change tracking and `TestStore` interactions (#2995)

* A fix for shared assertion.

* fixes

* wip

---------

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

* docs

* docs

* wip

* Throttle for 1 second.

* fix typo in examples: `let` -> `var` (#2999)

Co-authored-by: Andreas Tielmann <atielmann@deloitte.de>

* wip

* wip

* fix observing projection

* Ping `Shared.publisher` in `willSet` so prev/next values observable

* wip

* wip

* remove sandbox demo

* wip

* wip

* recover inlining

* wip

* wip

* fix docc

* wip

* wip

* re-entrant test

* wip

* Don’t assume CastableLookup (#3011)

* Don’t assume CastableLookup

If the observed value in `UserDefaults` is a `RawRepresentable` type, simply casting to `Value` might fail because the raw representing type could be different from `Value`.  Instead of querying `UserDefaults` directly here, we should call `loadValue()` which will do the right thing for raw representable types (esp. try to call `Value.init(rawValue:)` with the value obtained from `UserDefaults`).

* Add test

---------

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

* Make `FileStorage` more opaque (#3010)

* Make `FileStorage` more opaque

Previously, we had a public protocol and conformances, but we don't
expect anyone to conform outside the library, so instead let's hide
things in a more opaque struct.

The downside of this PR is that it's a breaking API change pretty late
in the game:

```diff
-$0.defaultFileStorage = InMemoryFileStorage()
+$0.defaultFileStorage = .inMemory
```

We could add public deprecated functions that emulate the old
initializers if we think it's worth it...

* wip

* wip

* wip

* wip

* wip

* wip

* fix for 5.7.1

* sync ups clean up

* more docs

* more tests

* shared testing tiups

* wip

* wip

* Fix typo. (#3014)

* more shared state docs

* relax version of swift-dependencies.

* dep change

* fix == and hash on Shared and more tests

* revert == changes

* add test

* Remove hashable conformance from shared

* remove conditional encodability from shared

* wip

* remove syncups tutorial

* wip

* fix

* fix file storage deletion resubscription

* wip

* wip

* wip

* wip

* wip

* fix

* eager throttle

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: NF <4764329+NFulkerson@users.noreply.github.com>
Co-authored-by: Hal Lee <hal@lee.me>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: Pyry Jahkola <pyry.jahkola@iki.fi>
Co-authored-by: Daniel Lyons <72824209+DandyLyons@users.noreply.github.com>
Co-authored-by: Hilton Campbell <github@crosswaterbridge.com>
Co-authored-by: Luke Redpath <lredpath@community.com>
Co-authored-by: andtie <andreas.tielmann@gmail.com>
Co-authored-by: Andreas Tielmann <atielmann@deloitte.de>
Co-authored-by: Alex Kovács <alex@kobachi.jp>
Co-authored-by: Zev Eisenberg <zev@zeveisenberg.com>
2024-04-28 17:53:12 -07:00
Stephen Celis
605222d332 Adopt complete concurrency and fix a few warnings (#2787)
* wip

* cleanup
2024-02-12 12:26:45 -08:00
Brandon Williams
b1a0c88516 Fix visionOS and Xcode project warnings (#2752)
* Fix deprecation warnings for visionOS

* update project settings

* use negated visionOS check

* fix ttt alert dismissl

* formatting
2024-01-31 10:38:24 -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
Brandon Williams
188ecd18d2 Don't replay changes to invalidated child stores. (#2633)
* Don't replay changes to invalidated child stores.

* wip

* backport fix from observation-beta

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2023-12-08 09:11:15 -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
Brandon Williams
464d95e368 Add previews to integration test cases (#2551)
* Add previews to all integration tests.

* wip;

* wip

* wip

* debug

* xcode 15

* split out examples

* wip

* wip

* move around tests so they don't go off screen

* wip

* wip

* ops

* wip

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2023-11-09 14:10:23 -08:00
Brandon Williams
178b0215eb Short circuit == when ordered sets don't have same size. (#2556) 2023-11-08 19:50:15 -08:00
Brandon Williams
931a71b78e Revamp integration tests (#2503)
* More integration tests.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* comment out all but one test

* wip

* try ios 17

* see if this works in ios 16

* wip

* wip

* wip

* bring back tests

* wip

* wip

* wip

* fixes

* fixes

* re-enable tests

* wip

* Update Sources/ComposableArchitecture/Internal/Logger.swift

* wip

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2023-10-09 15:06:04 -04: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
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
1a0c3f9326 Bump Xcode settings (#2042)
* Bump Xcode settings

We had some warnings related to new Xcode 14.3 settings.

* wip
2023-04-14 08:06:26 -07:00
Stephen Celis
4192a843ee Pass state to SwitchStore.init view builder (#2029)
* Pass state to `SwitchStore.init` view builder

Rather than rely on many, many overloads of `SwitchStore.init` to
strictly accept only `CaseLet`s and an optional, final `Default` view,
let's introduce a single initializer without constraints that is passed
the current state whenever the case changes. This state can be switched
on and route to the appropriate view via `CaseLet`.

The pros:

  * We get exhaustive switching at compile time.

  * We get more flexibility in the view layer. Previously, any
    customization needed to be pushed into the `CaseLet` builder, but
    now `CaseLet` can freely apply view modifiers.

  * We can deprecate and eventually remove the many, many initializer
    overloads, and hopefully slim down binary size in the process, and
    improve view builder compile times when dealing with `SwitchStore`.
    We can also deprecate and eventually remove `Default`.

The cons:

  * It's slightly more verbose and repetitive. You have a `SwitchStore`
    and then a `switch` inside it with many `case`s with `CaseLet`s
    inside them, and the `case .screen:` is followed by
    `CaseLet(/State.screen, ...)`.

  * One is free to extract the state's associated value(s) and use it to
    render a view, but this view will be inert and will not re-render if
    the value it depends on changes in the store. This can lead to some
    surprises, but we can document against the pattern, and maybe in the
    future we can use something like macros to prevent this from being
    possible.

  * You can still get things wrong if you're not careful: there's
    nothing enforcing that the `case` you switch on is the same case you
    send to `CaseLet`, so `case .screenA: CaseLet(/State.screenB, ...)`
    is possible. While unlikely, it's still a copy-paste error in
    waiting.

* wip

* wip

* wip

* Bump

* fix test

* clean up

* clean up

* clean up

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2023-04-10 11:37:02 -07:00
Thomas Grapperon
db39334dcc Add a UI test for escaped ViewStore from WithViewStore, and a Binding animations test bench (#1819)
* Add a UITest for escaped `ViewStore` from `WithViewStore`

* Add `BindingsAnimationsTestBench`

* Cleanup
2023-01-11 13:49:25 -08:00
Brandon Williams
82d2b78074 UI test to catch SwiftUI regressions (#1815)
* Add some UI tests to catch regressions.

* wip

* wip
2023-01-10 17:44:01 -05:00