Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observable Architecture #2593

Merged
merged 658 commits into from
Jan 27, 2024
Merged

Observable Architecture #2593

merged 658 commits into from
Jan 27, 2024

Conversation

stephencelis
Copy link
Member

@stephencelis stephencelis commented Nov 26, 2023

This PR introduces Observation tools to the Composable Architecture.

Discussion with more details: #2594

mbrandonw and others added 20 commits November 27, 2023 11:04
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!
@stephencelis stephencelis added the observation Related to our observation release. label Dec 2, 2023
Jimmy-Prime and others added 7 commits December 2, 2023 08:39
This reverts commit f221ed0.
* 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
@stephencelis stephencelis merged commit c373d8e into main Jan 27, 2024
7 checks passed
@stephencelis stephencelis deleted the observation-beta branch January 27, 2024 00:59
@stephencelis stephencelis restored the observation-beta branch January 27, 2024 00:59
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Jan 29, 2024
…ure to from: "1.7.0" (#882)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture)
| minor | `from: "1.6.0"` -> `from: "1.7.0"` |

---

### Release Notes

<details>
<summary>pointfreeco/swift-composable-architecture
(pointfreeco/swift-composable-architecture)</summary>

###
[`v1.7.0`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.7.0)

[Compare
Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.6.0...1.7.0)

#### What's Changed

- Added: Observation support
([https://github.com/pointfreeco/swift-composable-architecture/pull/2593](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2593)),
which both streamlines and soft-deprecates many concepts in the
Composable Architecture. See the [1.7 migration
guide](https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/migratingto1.7)
for more information on how to apply these updates to your applications.
- Infrastructure: Add CI for Swift 5.7.1
([https://github.com/pointfreeco/swift-composable-architecture/pull/2701](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2701)).
- Infrastructure: Add docs for testing `StackAction`'s case path
subscript (thanks
[@&#8203;lukeredpath](https://togithub.com/lukeredpath),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2704](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2704)).
- Infrastructure: Fixed examples CI
([https://github.com/pointfreeco/swift-composable-architecture/pull/2715](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2715)).
- Infrastructure: Fixed `TestStore.assert` docs
([https://github.com/pointfreeco/swift-composable-architecture/pull/2720](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2720)).
- Infrastructure: Use `XCTExpectFailure` from `XCTestDynamicOverlay`
([https://github.com/pointfreeco/swift-composable-architecture/pull/2721](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2721)).
- Infrastructure: Documentation typo fix (thanks
[@&#8203;JonCox](https://togithub.com/JonCox),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2723](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2723)).
- Infrastructure: Fixed concurrency docs (thanks
[@&#8203;hmhv](https://togithub.com/hmhv),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2726](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2726)).
- Infrastructure: Fixed composing features tutorial (thanks
[@&#8203;bricklife](https://togithub.com/bricklife),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2698](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2698);
thanks [@&#8203;Kyome22](https://togithub.com/Kyome22),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2727](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2727)).
- Infrastructure: Fixed 1.7 migration guide (thanks
[@&#8203;Ryu0118](https://togithub.com/Ryu0118),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2731](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2731)).

#### New Contributors

- [@&#8203;JonCox](https://togithub.com/JonCox) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2723](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2723)
- [@&#8203;Kyome22](https://togithub.com/Kyome22) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2727](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2727)

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.6.0...1.7.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
observation Related to our observation release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants