Skip to content

Comments

[@flags-sdk/bucket] getProviderData#113

Merged
AAorris merged 4 commits intovercel:adapter-bucketfrom
roncohen:adapter-bucket
Apr 8, 2025
Merged

[@flags-sdk/bucket] getProviderData#113
AAorris merged 4 commits intovercel:adapter-bucketfrom
roncohen:adapter-bucket

Conversation

@roncohen
Copy link
Contributor

@roncohen roncohen commented Mar 28, 2025

Demonstrating getting the feature definitions for getProviderData.

@vercel
Copy link
Contributor

vercel bot commented Mar 28, 2025

@roncohen is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link

socket-security bot commented Mar 28, 2025

@roncohen roncohen changed the title draft: getProviderData [@flags-sdk/bucket] draft: getProviderData Mar 28, 2025
@roncohen roncohen changed the title [@flags-sdk/bucket] draft: getProviderData [@flags-sdk/bucket] getProviderData Mar 28, 2025
Comment on lines +153 to +156
options: [
{ label: 'Disabled', value: false },
{ label: 'Enabled', value: true },
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

fc47847

maybe we can ship an initial version which only lets you override the isEnabled state for now?

@AAorris AAorris marked this pull request as ready for review April 8, 2025 19:42
@AAorris
Copy link
Contributor

AAorris commented Apr 8, 2025

Let's continue iterating in vercel:adapter-bucket and collaborate together there 🙌

@AAorris AAorris merged commit f47666b into vercel:adapter-bucket Apr 8, 2025
1 of 5 checks passed
@roncohen
Copy link
Contributor Author

roncohen commented Apr 9, 2025

thanks for merging! I commented above on the config issue.

@roncohen roncohen deleted the adapter-bucket branch April 9, 2025 10:29
AAorris pushed a commit that referenced this pull request May 15, 2025
AAorris added a commit that referenced this pull request May 16, 2025
* init
* [@flags-sdk/bucket] getProviderData (#113)
* [@flags-sdk/bucket] various improvements (#121)
* Update framer-motion to motion for CI

---------

Co-authored-by: Ron Cohen <cohen1@gmail.com>
Co-authored-by: Aaron Morris <aaron@vercel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants