-
Notifications
You must be signed in to change notification settings - Fork 107
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 showkase module's dependency on ui-tooling #230
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized I hadn't added documentation on how to setup Showkase more efficiently. I'll add that documentation soon!
a6bd66a
to
77f2296
Compare
@mxalbert1996 Actually thinking a bit more, I think we don't need this change. Instead, use the following setup with Showkase (I'll also add this to the README) - debugImplementation "com.airbnb.android:showkase:1.0.0-beta12"
implementation "com.airbnb.android:showkase-annotation:1.0.0-beta12"
kaptDebug "com.airbnb.android:showkase-processor:1.0.0-beta12" This will ensure that you don't face the issue that you described in your ticket. Give it a shot and let me know if it fixes the issue for you and I will then go ahead and also update the README |
Actaully I've thought of that but the problem is that in order to use |
@mxalbert1996 Yes that's actually how we are using it. This is actually a really full proof way to ensure that your previews are not being referenced by any piece of code in non-release builds. This will also guarantee that your preview functions have no possibility of being retained in release builds (which is what you'd ideally want) |
@vinaygaba |
@mxalbert1996 no I meant purely having the Showkase root class that's annotated with
Not if something is referencing these preview functions in the release builds. It's possible that if you use Showkase for release builds, its autogen code will hold a reference to these preview functions. Maybe R8 is still intelligent enough to strip them off but by simply having these 2 files in the debug source set, you guarantee that the preview functions will never make its way into the release build (at least not due to Showkase)
Showkase does have first class support for |
Yes, definitely intelligent enough. That's one of the reasons why R8 exists.
IMHO we don't call this "require". If Showkase requires ui-tooling, it won't work without ui-tooling, which is not true. And same for ui-tooling-preview. |
@mxalbert1996 end user doesn't require it but Showkase needs it internally to add support for @Preview annotations. Anyway I've suggested what you should be using and what we use internally. In addition, I do have one minor update I can make. Going to close out your PR and this conversation. |
OK, it's your library after all but it would be kind of you if you could tell me where you are using ui-tooling as I've searched through the code before creating this PR and there are no occurrences of |
But that's |
@mxalbert1996 I have it mixed up and I stand corrected 😱 The dependency I was suggesting ( |
Sure 👍 |
It seems that |
@mxalbert1996 This actually rings a bell. I think that's the reason the dependency didn't live in the processor already.
This is not what I experienced. I actually had a todo in my internal usage of Showkase
This was needed because Showkase processor wasn't able to find the |
Summary
androidx.compose.ui:ui-tooling
doesn't seem to be used anyway in the main module so remove it to avoid pulling in unneeded dependencies for consumers.Background
We are using
ui-tooling-preview
as release dependency andui-tooling
as debug dependency as suggested here to avoid includingPreviewActivity
and other stuff unneeded in release builds. However Showkase pulls inui-tooling
even for release builds.