GithubHelp home page GithubHelp logo

Comments (10)

vinaygaba avatar vinaygaba commented on May 18, 2024 2

Sounds reasonable! I'll take a look at share the keep rules you might need!

from showkase.

vinaygaba avatar vinaygaba commented on May 18, 2024 1

Hey! I had played around with the proguard configuration a bit and went down a rabbit hole for minimizing the footprint of this library. I was also experimenting with using debugImplementation and updating some of the documentation to reflect with some new guidance for use cases where Showkase is only used in debug mode. As far as release builds go, I haven't profiled release build yet and suspect that it's probably going to be the rule that you have in your previous comment itself. Once more people can confirm it and I also spend some time experimenting with it, I can potentially ship this library with some release proguard rules.

from showkase.

vinaygaba avatar vinaygaba commented on May 18, 2024

It is ok in debug but ko in release

Could you elaborate on this a bit more. Under what circumstances do you want to run this on a release build? We envisioned Showkase to be an tool that was meant primarily for internal and debug purposes. It sounds like you plan to host the app on the Play Store? Is that what you are trying to do?

from showkase.

VincentJouanne avatar VincentJouanne commented on May 18, 2024

Under what circumstances do you want to run this on a release build?

Having Showkase in a staging build would allow stakeholders (designers, POs ...) to easily have a look at the Design System: they might be able to spot mistakes if any.

from showkase.

VincentJouanne avatar VincentJouanne commented on May 18, 2024

Awesome, thank you very much for the value provided 🖖

from showkase.

StylianosGakis avatar StylianosGakis commented on May 18, 2024

Is there any update on this?
It seems like this fails on the minified version as it tries to find "${packageName}.ShowkaseModuleCodegen" but it's not named that?
So asking proguard to not strip @Preview composables isn't enough, that class also needs to be retained? I am super unfamiliar with playing with proguard so I couldn't find a way to fix it myself, do you have any ideas on how to solve this otherwise?

from showkase.

StylianosGakis avatar StylianosGakis commented on May 18, 2024

Okay, just adding
-keep class **.ShowkaseModuleCodegen { }
to my proguard file seems to render them just fine. Can you @VincentJouanne try it out too and confirm?
I have no idea what other kind of consequences this might have, nor do I know if there is a more optimal proguard configuration that will keep just the necessary stuff, if what I wrote above keeps too much.
So for our use case, having the staging build simply add another proguard file compared to the release build that has this one proguard command should suffice. Maybe something to put on the library documentation after it's confirmed (or improved)? I be happy to help with that if you'd like me to!

from showkase.

vinaygaba avatar vinaygaba commented on May 18, 2024

@VincentJouanne Did you try with the rule that @StylianosGakis suggested?

from showkase.

VincentJouanne avatar VincentJouanne commented on May 18, 2024

Hey guys, thanks a lot for your answers, I did not had time to test it again, I am closing it for now and if I encounter the problem again I will re-open it :)

Thanks for your time 🖖

from showkase.

vinaygaba avatar vinaygaba commented on May 18, 2024

Want to summarize the solution for future reference -

You essentially need to add a proguard keep rule to make it with in release/alternate builds. The exact keep rule depends on your setup. For example, if your ShowkaseRootModule implementation looks like this -

package my.lovely.package

@ShowkaseRoot
class MyRootModule: ShowkaseRootModule

Then your proguard rule will need to be

-keep class **.MyRootModuleCodegen { }

We are essentially trying to retain the final XCodegen class that Showkase generates. The name of this generated class is of the format (_name_of_ShowkaseRootModule_implementation_)Codegen.

Hope this makes sense!

from showkase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.