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

[AND-8] Update compose to v1.7.5. Migrate RippleTheme to RippleConfiguration. #5475

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Nov 14, 2024

🎯 Goal

Linear: https://linear.app/stream/issue/AND-8/update-compose-to-latest-stable-version

This PR updates the compose and compose-material libraries to their latest stable version: 1.7.5 and 1.3.1 respectively, and migrates the usage of RippleTheme to RippleConfiguration.

There is currently a problem in following scenario:

  1. Use any version of the compose chat SDK (which has compose version 1.6.8)
  2. Integrating app has compose version 1.7.+
  3. Integrating app overrides ChatTheme#rippleTheme

This issue happens because starting from compose v1.7.0, the RippleTheme is deprecated with Level.ERROR, and it is not possible to use - therefore for an app using compose version 1.7.+, it is not possible to provide a custom RippleTheme for ChatTheme.rippleTheme.
There is now a replacement for RippleTheme called RippleConfiguration.

More details:

Because of this, we need to provide a way for users to customise the ripples, even if they are using compose 1.7.+.
(and we decided to update the compose versions as well, because this change will eventually be inevitable)

🛠 Implementation details

🚨 BREAKING CHANGE 🚨

  • Change the ChatTheme rippleTheme: RippleTheme argument to a compose version-independent StreamRippleConfiguration (Note: we are not directly exposing RippleConfiguration from ChatTheme as it will be experimental until compose version 1.8.0, therefore making ChatTheme experimental as well. Additionally it gives us flexibility to change the internal implementation in the future, without affecting the public API)
  • The StreamRippleConfiguration is then internally mapped to RippleConfiguration, keeping the implementation details of the ripple provider internal
  • Replace the usage of LocalRippleTheme with the new LocalRippleConfiguration
  • Replace all usages of rememberRipple() with the new ripple(), which properly queries LocalRippleConfiguration

@VelikovPetar VelikovPetar marked this pull request as ready for review November 14, 2024 16:34
@VelikovPetar VelikovPetar requested a review from a team as a code owner November 14, 2024 16:34
@VelikovPetar VelikovPetar linked an issue Nov 14, 2024 that may be closed by this pull request
Copy link
Member

@skydoves skydoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 🙌

Copy link
Member

@JcMinarro JcMinarro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look Good to me.

BTW, Some of our customers are using Chat and Video SDK together, Could we verify same compose versions are being used on Video SDK and if they are not the same, update to to the last one and verify it works fine?
cc/ @VelikovPetar @skydoves

@skydoves
Copy link
Member

@JcMinarro That's a good point, for now, Video SDK is also using the relatively recent version of Jetpack Compose, so that would be compatible with each other - https://github.com/GetStream/stream-video-android/blob/develop/gradle/libs.versions.toml#L25

@JcMinarro JcMinarro merged commit b85f643 into develop Nov 15, 2024
7 checks passed
@JcMinarro JcMinarro deleted the feature/update-compose-to-v175 branch November 15, 2024 14:32
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.

Migrate to Indication and Ripple APIs
3 participants