Showkase icon indicating copy to clipboard operation
Showkase copied to clipboard

ShowkaseMetadata class leaking into public API

Open iamutkarshtiwari opened this issue 2 years ago • 3 comments

I have a gradle setup where I have several public preview methods (> 20) in a module. This module also has some public API that will be consumed. Since I have renamed all the public preview methods with PreviewXyz, no one is going to be using it because the intended public API starts with EGDSXyz so that should be fine.

However, there is one issue. For one of those preview methods, a generated class is leaking through. Screen Shot 2022-10-11 at 12 31 34

Screen Shot 2022-10-11 at 12 40 34 Screen Shot 2022-10-11 at 12 40 44 Screen Shot 2022-10-11 at 12 40 54

I am able to access ShowkaseMetadata_com_xyz_components_composables_scrim() in the consuming project. I am not sure why this is happening for this preview method only as there are other preview methods that have the exactly same setup and are not leaking through:

  • annotated with a custom warning level annotation
  • annotated with @Preview
  • is a public composable function
Screen Shot 2022-10-11 at 12 37 37 Screen Shot 2022-10-11 at 12 37 44

iamutkarshtiwari avatar Oct 11 '22 03:10 iamutkarshtiwari

@iamutkarshtiwari Interesting 🤔 Don't have a hypothesis about why this happens only for 1 preview and not the rest. Would you be kind enough to create a sample project that I can play with so that it's easier to debug/repro.

vinaygaba avatar Dec 19 '22 19:12 vinaygaba

Is that generated function being referenced anywhere somehow?

vinaygaba avatar Dec 19 '22 19:12 vinaygaba

Hi @vinaygaba, apologies for the delayed response. No, that generated function is not being referenced anywhere. However, like I mentioned, it's accessible on the consumer side.

iamutkarshtiwari avatar Jun 29 '23 05:06 iamutkarshtiwari