-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Re-adds Reducer.forEach
method removed in 1.4
#2570
Re-adds Reducer.forEach
method removed in 1.4
#2570
Conversation
Reducer.forEach
method removed in 1.4
Only have two overloads: - `CaseKeyPath` to an `IdentifiedAction` - Deprecated `AnyCasePath` to an unnamed tuple
@rhysm94 Thanks for pointing out the problem! I think we introduced more churn here than we should have. I've updated your PR to fix the old |
@stephencelis Thanks for that! That's great, I'm glad it was possible to make it simpler! |
…ure to from: "1.4.2" (#737) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture) | minor | `from: "1.3.0"` -> `from: "1.4.2"` | --- ### Release Notes <details> <summary>pointfreeco/swift-composable-architecture (pointfreeco/swift-composable-architecture)</summary> ### [`v1.4.2`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.4.2) [Compare Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.4.1...1.4.2) #### What's Changed - Fixed: `swift-case-paths` is now correctly pinned from 1.1.0, which should avoid some SPM resolution issues (thanks [@​bdolewski-intellias](https://togithub.com/bdolewski-intellias), [https://github.com/pointfreeco/swift-composable-architecture/pull/2577](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2577)). #### New Contributors - [@​bdolewski-intellias](https://togithub.com/bdolewski-intellias) made their first contribution in [https://github.com/pointfreeco/swift-composable-architecture/pull/2577](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2577) **Full Changelog**: pointfreeco/swift-composable-architecture@1.4.1...1.4.2 ### [`v1.4.1`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.4.1) [Compare Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.4.0...1.4.1) #### What's Changed - Fixed: A regression in `Reducer.forEach` was introduced in 1.4 that broke compilation in some cases, notably in the TCACoordinators library. This regression has been corrected (thanks [@​rhysm94](https://togithub.com/rhysm94), [https://github.com/pointfreeco/swift-composable-architecture/pull/2570](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2570)). - Infrastructure: Updated Japanese and Korean README translations (thanks [@​Achoo-kr](https://togithub.com/Achoo-kr), [https://github.com/pointfreeco/swift-composable-architecture/pull/2563](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2563), [https://github.com/pointfreeco/swift-composable-architecture/pull/2562](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2562)). - Infrastructure: Fixed documentation links (thanks [@​johankool](https://togithub.com/johankool), [https://github.com/pointfreeco/swift-composable-architecture/pull/2566](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2566), [https://github.com/pointfreeco/swift-composable-architecture/pull/2576](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2576)); fixed migration guide typos (thanks [@​kalupas226](https://togithub.com/kalupas226), [https://github.com/pointfreeco/swift-composable-architecture/pull/2569](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2569); [@​woxtu](https://togithub.com/woxtu), [https://github.com/pointfreeco/swift-composable-architecture/pull/2575](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2575); [@​Ryu0118](https://togithub.com/Ryu0118), [https://github.com/pointfreeco/swift-composable-architecture/pull/2574](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2574)). - Infrastructure: Clean up case study (thanks [@​mike123789-dev](https://togithub.com/mike123789-dev), [https://github.com/pointfreeco/swift-composable-architecture/pull/2567](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2567)). #### New Contributors - [@​Achoo-kr](https://togithub.com/Achoo-kr) made their first contribution in [https://github.com/pointfreeco/swift-composable-architecture/pull/2563](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2563) - [@​mike123789-dev](https://togithub.com/mike123789-dev) made their first contribution in [https://github.com/pointfreeco/swift-composable-architecture/pull/2567](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2567) - [@​woxtu](https://togithub.com/woxtu) made their first contribution in [https://github.com/pointfreeco/swift-composable-architecture/pull/2575](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2575) - [@​rhysm94](https://togithub.com/rhysm94) made their first contribution in [https://github.com/pointfreeco/swift-composable-architecture/pull/2570](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2570) **Full Changelog**: pointfreeco/swift-composable-architecture@1.4.0...1.4.1 ### [`v1.4.0`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.4.0) [Compare Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.3.0...1.4.0) #### What's Changed - Added: The `@Reducer` macro ([https://github.com/pointfreeco/swift-composable-architecture/pull/2553](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2553)). See the [migration guide](https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/migratingto1.4/) for more details. - Added: Reducer builder support for `any Reducer<State, Action>` ([https://github.com/pointfreeco/swift-composable-architecture/pull/2533](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2533)). - Fixed: Silenced a SwiftUI sendability warning ([https://github.com/pointfreeco/swift-composable-architecture/pull/2540](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2540)). - Fixed: Alert and confirmation dialog helpers now use `Text(verbatim: "")` to avoid localization warnings ([https://github.com/pointfreeco/swift-composable-architecture/pull/2541](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2541)). - Fixed: `Reducer.onChange` no longer requires an `Equatable` conformance (thanks [@​lukaskubanek](https://togithub.com/lukaskubanek), [https://github.com/pointfreeco/swift-composable-architecture/pull/2545](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2545)). - Infrastructure: Updated Swift compiler version to 5.7.1 to follow Apple's policy (thanks [@​jaesung-0o0](https://togithub.com/jaesung-0o0), [https://github.com/pointfreeco/swift-composable-architecture/pull/2549](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2549)). - Fixed: Short circuit equatability of ordered sets when counts don't match ([https://github.com/pointfreeco/swift-composable-architecture/pull/2556](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2556)). - Infrastructure: Added previews to integration test cases by ([https://github.com/pointfreeco/swift-composable-architecture/pull/2551](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2551)) #### New Contributors - [@​lukaskubanek](https://togithub.com/lukaskubanek) made their first contribution in [https://github.com/pointfreeco/swift-composable-architecture/pull/2545](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2545) **Full Changelog**: pointfreeco/swift-composable-architecture@1.3.0...1.4.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>
TCA 1.4 perhaps unintentionally removed the
Reducer.forEach
code which allowed creating aForEachReducer
with aAnyCasePath<Action, (ID, ElementAction)>
as theaction
parameter.Unfortunately, it seems that:
AnyCasePath<Action, (ID, ElementAction)>
, andAnyCasePath<Action, (id: ID, action: ElementAction)>
are not (always) considered equivalent by the Swift compiler.
The helper library, TCACoordinators, relies on the previous behaviour by passing an
AnyCasePath<Action, (ID, ElementAction)>
. I have tried updating TCACoordinators to useAnyCasePath<Action, (id: ID, action: ElementAction)>
, but this has the effect of breaking TCACoordinators when used with TCA 1.3. Without re-adding this particular method, TCACoordinators cannot compile in a way that works with both TCA 1.3 and TCA 1.4. With this small change, TCACoordinators compiles and works just fine!