Skip to content

TCA2 backport: enum scopes#3882

Open
stephencelis wants to merge 1 commit intotrait-deprecate-presentation-scopefrom
presentation-member-lookup
Open

TCA2 backport: enum scopes#3882
stephencelis wants to merge 1 commit intotrait-deprecate-presentation-scopefrom
presentation-member-lookup

Conversation

@stephencelis
Copy link
Member

TCA2 is stricter about scoping along feature boundaries, which means composed scoping like \.destination?.sheet aren't desirable.

But these APIs could be improved to begin with, and have in TCA2, so let's backport them to make the migration easier.

// Before:
$store.scope(state: \.$destination?.sheet, action: \.destination.sheet)

// After:
$store.scope(state: \.$destination, action: \.destination).sheet

TCA2 is stricter about scoping along feature boundaries, which means
composed scoping like `\.destination?.sheet` aren't desirable.

But these APIs could be improved to begin with, and have in TCA2, so
let's backport them to make the migration easier.

```swift
// Before:
$store.scope(state: \.$destination?.sheet, action: \.destination.sheet)

// After:
$store.scope(state: \.$destination, action: \.destination).sheet
```
@stephencelis stephencelis requested a review from mbrandonw March 12, 2026 22:03
@stephencelis stephencelis added the 2.0 Related to our 2.0 release. label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0 Related to our 2.0 release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant