Comments (10)
Sounds reasonable! I'll take a look at share the keep rules you might need!
from showkase.
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.
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.
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.
Awesome, thank you very much for the value provided 🖖
from showkase.
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.
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.
@VincentJouanne Did you try with the rule that @StylianosGakis suggested?
from showkase.
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.
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)
- Paparazzi + Showkase Integration - java.io.FileNotFoundException (File name too long) HOT 5
- PreviewParameters don't work with Kotlin 1.9 HOT 1
- Incorrect generate ShowcaseBrowser color with kotlin 1.9 HOT 2
- Updating compileSdkVersion to 34 causes deceprecation errors for newInstance() HOT 2
- exported ShowkaseBrowserActivity HOT 3
- Incompatibility with Dagger 2.48 HOT 7
- Is that possible to download an image from url? HOT 2
- Showkase silently ignores duplicate ShowkaseComposables
- IllegalStateException on ShowkaseMultiPreviewCodegenMetadata HOT 6
- When using Showkase version 1.01 or 1.0.2 I get this error "error: cannot find symbol - import androidx.room.util.RelationUtil; " HOT 1
- old account label bypassing all fraud measures HOT 1
- Multi module: same package name leads to silently ignoring previews
- Class file has wrong version 61.0, should be 55.0 HOT 1
- Showkase ignoring the Locale parameter for @Preview
- Feature Request: Compose Multiplatform Support HOT 4
- Fatal Exception: java.lang.RuntimeException: Unable to start activity ShowkaseBrowserActivity HOT 12
- Any plans to add support for other compose multiplatform targets like ios and desktop? HOT 2
- Feature request: Add support for K2 compiler.
- Root module codegen preventing incremental compilation for KSP HOT 3
- Remote Image Not Displaying in Showcase Using Coil's AsyncImage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from showkase.