CasePath protocol - #254
Draft
stephencelis wants to merge 13 commits into
Draft
Conversation
This file contains hidden or 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
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.
This is another 2.0-breaking change.
@CasePathablewill generate concreteCasePathconformances per case, andCaseKeyPathwill be generic over that concrete type instead.For end-users of case paths, like ComposableArchitecture, SwiftNavigation, Parsing, and more, this change should be more or less transparent.
To library users writing code against case key paths, the main change:
1.0's case key paths were more ergonomic than the original
AnyCasePathstruct, but generally a bit slower. Not so slow to drop the concept entirely, but worth addressing. This PR eliminates pretty much all overhead of case key paths. Direct benchmarks are hundreds of times faster per extract/embed, while library usage sees a nice real world speedup as well (store scoping is about 3x faster in TCA26 on this branch).