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

Give internal presentation store an id #2908

Conversation

lukeredpath
Copy link
Contributor

@lukeredpath lukeredpath commented Mar 11, 2024

Addresses the problem raised in #2907 where using legacy presentation APIs (e.g. sheet(store:)) result in the presented destination always receiving a store that does not support store caching due to the hardcoded nil ID given to the internal store that is created.

This prevents you from presenting features that uses observation tools using these APIs without lots of purple runtime warnings even though there's no reason why you shouldn't be able to do this.

Note: An earlier implementation in of this logic used to have a comment stating that a \.self ID could not be used because it would prevent dismissal. In my example app I am able to present and dismiss sheets using both the SwiftUI dismiss environment value, or by sending an action to the store and setting the destination state to nil.

@lukeredpath lukeredpath changed the title fix: Give internal presentation store an id Give internal presentation store an id Mar 11, 2024
Copy link
Member

@stephencelis stephencelis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@stephencelis stephencelis merged commit 8907f4f into pointfreeco:main Mar 11, 2024
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Apr 22, 2024
…ure to from: "1.9.3" (#1020)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture)
| patch | `from: "1.9.2"` -> `from: "1.9.3"` |

---

### Release Notes

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

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

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

#### What's Changed

- Added: Added missing `StackActionOf<R>` type alias (thanks
[@&#8203;d-date](https://togithub.com/d-date),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2906](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2906)).
- Fixed: Cache scoped presentation stores where possible (thanks
[@&#8203;lukeredpath](https://togithub.com/lukeredpath),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2908](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2908)).
- Fixed: Allow "inert" enum state to be observed by having an
ever-changing ID
([https://github.com/pointfreeco/swift-composable-architecture/pull/2910](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2910)).
- Fixed: Silence SwiftSyntax 510 / Xcode 15.3 warnings
([https://github.com/pointfreeco/swift-composable-architecture/pull/2909](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2909)).
- Fixed: Restore `TestStore` autocompletion
([https://github.com/pointfreeco/swift-composable-architecture/pull/2923](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2923)).
- Fixed: It is now possible to scope bindings of enum stores to
non-reducer cases for sheets and other navigation
([https://github.com/pointfreeco/swift-composable-architecture/pull/2943](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2943)).
- Fixed: `package` access modifier support in enum `@Reducer` macro
(thanks [@&#8203;samrayner](https://togithub.com/samrayner),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2939](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2939)).
- Fixed: `Effect.publisher` is no longer escaping
([https://github.com/pointfreeco/swift-composable-architecture/pull/2968](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2968)).
- Fixed: Add runtime warning diagnostic to catch nested calls to
`observe`
([https://github.com/pointfreeco/swift-composable-architecture/pull/2996](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2996)).
- Infrastructure: Fix documentation typos (thanks
[@&#8203;takehilo](https://togithub.com/takehilo),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2898](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2898);
[https://github.com/pointfreeco/swift-composable-architecture/pull/2944](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2944));
tutorial fixes (thanks [@&#8203;LRSnowX](https://togithub.com/LRSnowX),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2808](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2808));
test store tutorial/documentation fixes
([https://github.com/pointfreeco/swift-composable-architecture/pull/2912](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2912));
fix favorites case study mocks (thanks
[@&#8203;beribas](https://togithub.com/beribas),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2962](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2962));
improve docs for stack-based navigation
([https://github.com/pointfreeco/swift-composable-architecture/pull/2967](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2967));
fix dismissal in UIKit demos
([https://github.com/pointfreeco/swift-composable-architecture/pull/2986](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2986))
fix shared state case study (thanks
[@&#8203;eltociear](https://togithub.com/eltociear),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2994](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2994)).

#### New Contributors

- [@&#8203;LRSnowX](https://togithub.com/LRSnowX) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2808](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2808)
- [@&#8203;beribas](https://togithub.com/beribas) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2962](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2962)
- [@&#8203;samrayner](https://togithub.com/samrayner) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2939](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2939)
- [@&#8203;eltociear](https://togithub.com/eltociear) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2994](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2994)

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.9.2...1.9.3

</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:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants