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
Enhance Reducer.ifLet
child effect cancellation
#2402
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added support for |
mbrandonw
approved these changes
Aug 29, 2023
cgrindel-self-hosted-renovate bot
added a commit
to cgrindel/rules_swift_package_manager
that referenced
this pull request
Oct 25, 2023
…ure to from: "1.3.0" (#689) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture) | minor | `from: "1.2.0"` -> `from: "1.3.0"` | --- ### Release Notes <details> <summary>pointfreeco/swift-composable-architecture (pointfreeco/swift-composable-architecture)</summary> ### [`v1.3.0`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.3.0) [Compare Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.2.0...1.3.0) #### What's Changed - Added: `dismiss(transaction:)` dependency (thanks [@​tomokisun](https://togithub.com/tomokisun), [pointfreeco/swift-composable-architecture#2433). - Fixed: `Reducer.ifLet` child effects are now properly cancelled when reset by a parent ([pointfreeco/swift-composable-architecture#2402). - Fixed: Added missing `file` and `line` parameters to `dismiss` dependency (thanks [@​heiberg](https://togithub.com/heiberg), [pointfreeco/swift-composable-architecture#2440). - Fixed: Only dismiss alert/dialog state when receiving a domain-specific action ([pointfreeco/swift-composable-architecture#2468). - Fixed: Serialize `Reducer._printChanges()` ([pointfreeco/swift-composable-architecture#2519). - Infrastructure: README, tutorial, and other assorted fixes (thanks [@​zooxop](https://togithub.com/zooxop), [pointfreeco/swift-composable-architecture#2405; thanks [@​filblue](https://togithub.com/filblue), [pointfreeco/swift-composable-architecture#2418, [pointfreeco/swift-composable-architecture#2467, [pointfreeco/swift-composable-architecture#2486; thanks [@​yimajo](https://togithub.com/yimajo), [pointfreeco/swift-composable-architecture#2425, [pointfreeco/swift-composable-architecture#2426; thanks [@​denil-ct](https://togithub.com/denil-ct), [pointfreeco/swift-composable-architecture#2427; thanks [@​mornin-ystIUBqR](https://togithub.com/mornin-ystIUBqR), [pointfreeco/swift-composable-architecture#2446; thanks [@​jkimdev](https://togithub.com/jkimdev), [pointfreeco/swift-composable-architecture#2454; thanks [@​Jager-yoo](https://togithub.com/Jager-yoo), [pointfreeco/swift-composable-architecture#2442; [pointfreeco/swift-composable-architecture#2472; thanks [@​vasiliyzaycev](https://togithub.com/vasiliyzaycev), [pointfreeco/swift-composable-architecture#2474, [pointfreeco/swift-composable-architecture#2475; thanks [@​jtouzy](https://togithub.com/jtouzy) in [pointfreeco/swift-composable-architecture#2477; thanks [@​jaesung-0o0](https://togithub.com/jaesung-0o0), [pointfreeco/swift-composable-architecture#2484, [pointfreeco/swift-composable-architecture#2499; thanks [@​ictechgy](https://togithub.com/ictechgy), [pointfreeco/swift-composable-architecture#2481; thanks [@​Ryu0118](https://togithub.com/Ryu0118), [pointfreeco/swift-composable-architecture#2482; [pointfreeco/swift-composable-architecture#2480; thanks [@​KyleLeneau](https://togithub.com/KyleLeneau), [pointfreeco/swift-composable-architecture#2493; thanks [@​kalupas226](https://togithub.com/kalupas226), [pointfreeco/swift-composable-architecture#2498; thanks [@​kodok1988](https://togithub.com/kodok1988), [pointfreeco/swift-composable-architecture#2511). - Infrastructure: Rename Standups sample project to SyncUps ([pointfreeco/swift-composable-architecture#2524); remove meeting feature reducer ([pointfreeco/swift-composable-architecture#2410); fixed `.minutes` duration (thanks [@​filblue](https://togithub.com/filblue), [pointfreeco/swift-composable-architecture#2437). - Infrastructure: Bump `actions/checkout` version to `v4` (thanks [@​Ryu0118](https://togithub.com/Ryu0118), [pointfreeco/swift-composable-architecture#2479). - Infrastructure: Clean up `StoreTask.cancel` implementation (thanks [@​Ryu0118](https://togithub.com/Ryu0118), [pointfreeco/swift-composable-architecture#2496). - Infrastructure: Revamp integration tests ([pointfreeco/swift-composable-architecture#2503, [pointfreeco/swift-composable-architecture#2515). - Infrastructure: Simplify SwiftUI case studies ([pointfreeco/swift-composable-architecture#2526). - Infrastructure: Fixed search example debounce duration (thanks [@​wtsnz](https://togithub.com/wtsnz), [pointfreeco/swift-composable-architecture#2525). #### New Contributors - [@​zooxop](https://togithub.com/zooxop) made their first contribution in [pointfreeco/swift-composable-architecture#2405 - [@​denil-ct](https://togithub.com/denil-ct) made their first contribution in [pointfreeco/swift-composable-architecture#2427 - [@​tomokisun](https://togithub.com/tomokisun) made their first contribution in [pointfreeco/swift-composable-architecture#2433 - [@​mornin-ystIUBqR](https://togithub.com/mornin-ystIUBqR) made their first contribution in [pointfreeco/swift-composable-architecture#2446 - [@​jkimdev](https://togithub.com/jkimdev) made their first contribution in [pointfreeco/swift-composable-architecture#2454 - [@​vasiliyzaycev](https://togithub.com/vasiliyzaycev) made their first contribution in [pointfreeco/swift-composable-architecture#2474 - [@​jtouzy](https://togithub.com/jtouzy) made their first contribution in [pointfreeco/swift-composable-architecture#2477 - [@​ictechgy](https://togithub.com/ictechgy) made their first contribution in [pointfreeco/swift-composable-architecture#2481 - [@​KyleLeneau](https://togithub.com/KyleLeneau) made their first contribution in [pointfreeco/swift-composable-architecture#2493 - [@​kodok1988](https://togithub.com/kodok1988) made their first contribution in [pointfreeco/swift-composable-architecture#2511 - [@​wtsnz](https://togithub.com/wtsnz) made their first contribution in [pointfreeco/swift-composable-architecture#2525 **Full Changelog**: pointfreeco/swift-composable-architecture@1.2.0...1.3.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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now,
ifLet
checks the presented state before and after it runs the parent reducer, and if it changes, it cancels any in-flight effects for the previous state. It will not, however, detect when child state changes outside the parent reducer, e.g.:While we generally recommend structuring reducers in a way in which this doesn't happen, as a library we should attempt to improve the situation. In our case
@PresentationState
already uses some internal state to detect if it needs to install the child's dismiss effects, e.g. if it was deep-linked into at app launch. We can leverage this same state to detect if it needs to tear down the previous child's effects.This PR's solution should improve cancellation in these edge cases, but it may not (and may not be able to) handle every case.
We should explore an equivalent solution for.forEach
.