darkmoon_uk
09/10/2021, 3:11 AM@Preview
annotated functions do not end up in production code?"
☝️ This came as a fair challenge from within our team today.
I'm working in an environment where adherence to architectural layers, and guaranteed correctness is paramount. As such, it was fairly pointed out that @Preview
functions strictly belong in a different place to production code.
There's an obvious tension there between architectural purity and the practical benefits of placing them alongside `@Composable`'s (such as the intent behind the Code / Split / Design pane).
We've arrived at a place where it's deemed acceptable as long as we have a way of guaranteeing that @Preview
annotated functions cannot accidentally make it into a Release build (either as live or dead code). Do any easily configurable means exist today? If not, could we implement something using the recently released KSP?ephemient
09/10/2021, 3:20 AMephemient
09/10/2021, 3:21 AM@Preview
-annotated functions, but that has a possibility of breaking code in the module that happens to use themromainguy
09/10/2021, 3:24 AMAlbert Chang
09/10/2021, 3:25 AMephemient
09/10/2021, 3:27 AMdarkmoon_uk
09/10/2021, 3:28 AMromainguy
09/10/2021, 3:28 AMdarkmoon_uk
09/10/2021, 3:28 AMromainguy
09/10/2021, 3:28 AMdarkmoon_uk
09/10/2021, 3:28 AMromainguy
09/10/2021, 3:29 AMromainguy
09/10/2021, 3:29 AMromainguy
09/10/2021, 3:29 AMdarkmoon_uk
09/10/2021, 3:34 AM@Preview
annotated functions 👌