[@flags-sdk/bucket] getProviderData#113
Conversation
|
@roncohen is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
| options: [ | ||
| { label: 'Disabled', value: false }, | ||
| { label: 'Enabled', value: true }, | ||
| ], |
There was a problem hiding this comment.
This implies that bucket only has true/false flags. If there are structured variants that you can determine from features, then this is where they should go
There was a problem hiding this comment.
Improve getProviderData to provide options based on the data in feature definitions
In Bucket we have feature keys. A feature can both be on/off but also have configuration:
const { isEnabled, config } = bucketClient.getFeature('myNewFeature'); // use feature key to get both the isEnabled state and the feature config
if (!isEnabled) {
return;
}
return <button>{{config.payload.copy}}</button>In the sidebar, ideally the config and the isEnabled state would be two different entries. I initially made getProviderData return two feature keys whenever config existed for a feature, but removed it again because overriding these values didn't work:
maybe we can ship an initial version which only lets you override the isEnabled state for now?
|
Let's continue iterating in |
|
thanks for merging! I commented above on the |
Demonstrating getting the feature definitions for
getProviderData.