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

Remove exotic Modifier APIs, fix normalization #1548

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

JakeWharton
Copy link
Collaborator

As we consider removing/reimagining Modifier as a concept in our composables, remove more of their exotic API which is focused on usage as interceptor-like structures (from Compose UI) rather than as key/value structures (from Redwood).

Added tests for remaining API behavior, including that of an inconsistency in how combined modifiers behave. The CombinedModifier type retains association on how it was assembled despite being otherwise a list-like structure. So ((a then b) then c) did not equal (a then (b then c)) in old code. Now, if an CombinedModifier is being added to another, its elements are unpacked forming a normal form. Additionally, since nothing references this type or needs to use it directly, remove it from the public API.

As we consider removing/reimagining Modifier as a concept in our composables, remove more of their exotic API which is focused on usage as interceptor-like structures (from Compose UI) rather than as key/value structures (from Redwood).

Added tests for remaining API behavior, including that of an inconsistency in how combined modifiers behave. The CombinedModifier type retains association on how it was assembled despite being otherwise a list-like structure. So ((a then b) then c) did not equal (a then (b then c)) in old code. Now, if an CombinedModifier is being added to another, its elements are unpacked forming a normal form. Additionally, since nothing references this type or needs to use it directly, remove it from the public API.
@JakeWharton JakeWharton merged commit d9b6e84 into trunk Oct 3, 2023
@JakeWharton JakeWharton deleted the jw.modifier-changes.2023-10-03 branch October 3, 2023 19:28
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