Skip to content

Made ComposeModifierView public. #83

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

moros
Copy link

@moros moros commented Oct 30, 2024

Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Would be useful to make ComposeModifierView public to allow a 3rd party codebase to define their own view extensions. I was exploring creating my own extension as mentioned on the documentation but couldn't because of type visibility. The other types, like ComposeContext and ComposeResult are already public. I ran tests though I see existing failing cases; an @testable import makes internal types visible to the unit test meaning increasing the visibility more wouldn't contribute to test failers.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

@cla-bot cla-bot bot added the cla-signed label Oct 30, 2024
@aabewhite
Copy link
Contributor

Thank you.

Making an additional type public is a commitment of sorts that we'll try to not to make breaking changes to its API. So we'd prefer to minimize the public surface area of the module. Can you provide an example of something that can't be done via the existing Compose integration or a custom SwiftUI modifier?

@moros
Copy link
Author

moros commented Oct 30, 2024

The documentation under the Modifiers section seems to imply that its available for use outside of the skip-ui module. The composeModifier as mentioned in the docs seems like it'll work for what I need currently. If I wanted to create my own SwiftUI view type and extend it accessing the context and view kind of like in the public onSubmit function in TextField then I would need access to the ComposeModifierView. Though this would probably be more of a rare occurrence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants