kevincianfarini / monarch

Multiplatform, multi module, type safe feature flagging.
https://kevincianfarini.github.io/monarch/docs/0.x/
Apache License 2.0
65 stars 0 forks source link

Reconsider the necessity of having `ByteArray` as a primitive flag type #49

Closed kevincianfarini closed 7 months ago

kevincianfarini commented 7 months ago

Most flagging SDKs don't expose a way to acquire byte arrays easily. Firebase Remote Config does, but not as a simple function on their client. Instead, you have to query for a FirebaseRemoteConfigValue and then call [asByteArray](https://firebase.google.com/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigValue#asByteArray()) on it. Similarly, LaunchDarkly doesn't expose this at all and in our integration we just throw a NotImplementedError.

In the environment variable integration I chose to encode bytes as hex strings for the interface. This feels like too opinionated of a decision for me to make -- what if someone wants to store their flag's bytes as base64 encoded strings?

I think this probably lives better as a mixin. Perhaps a base64 mixin and a hex mixin. Though, I am dubious of the merits of exposing bytes in feature flags at all.