Conversation
This update introduces a new `config` property for features, allowing optional, user-defined configuration payloads. The change includes implementation within SDKs, unit tests, and updates to version numbers. It maintains backward compatibility while enabling new configuration flexibility.
Simplified flag evaluation by introducing a generic `resolveFeature` method for type consistency and streamlined logic. Added extensive test cases for different flag types and scenarios. Updated `@bucketco/browser-sdk` dependency to version 2.6.0 for compatibility.
Introduced support for feature-specific configurations, enabling dynamic payloads for features based on user-defined rules. Enhanced fallback features to accept both string arrays and object records, providing more flexibility for feature initialization. Updated documentation and tests to reflect the new configuration capabilities and backwards-compatible fallback behavior.
…eb-sdks-to-expose-the-config # Conflicts: # packages/browser-sdk/src/client.ts # packages/browser-sdk/src/feature/features.ts
config option.
Update package version to 0.4.0 to reflect changes and improvements made in the OpenFeature browser provider. This helps signify a new iteration with potential new features or fixes.
roncohen
reviewed
Jan 17, 2025
Contributor
roncohen
left a comment
There was a problem hiding this comment.
started reviewing this, but since we still need to get the key stuff in I'll pause for now and revisit once that's updated. Looks like a good start though!
…enhance feature handling - Added a new "format" script to package.json for consistent code formatting. - Improved formatting in README.md files across browser-sdk, react-sdk, and openfeature-browser-provider for better readability. - Updated feature handling in features.ts and mocks/handlers.ts to ensure proper type usage and maintainability. - Adjusted test cases to reflect changes in feature access patterns. These changes enhance the developer experience and maintain code quality.
…documentation - Renamed "Feature toggles" section to "Remote config" in README.md for clarity. - Introduced a new type, `FeatureDynamicConfig`, to better represent dynamic feature configurations in client.ts. - Updated the `Feature` interface to use `FeatureDynamicConfig` instead of a generic `any` type for the `config` property. - Adjusted the handling of feature configurations in the `BucketClient` class to utilize a default `missingConfig`. - Enhanced the `FetchedFeature` type in features.ts to reflect the new configuration structure. - Updated test cases to align with the new configuration model, ensuring accurate feature representation. These changes enhance type safety and improve the overall developer experience when working with feature configurations.
- Introduced a new EMPTY_FEATURE_CONFIG constant to provide a default configuration for features. - Updated the useFeature hook to return a more structured Feature type, including isEnabled, isLoading, and config properties. - Modified requestFeedback function to use a more specific RequestFeedbackOptions type. - Adjusted test cases to validate the new feature configuration structure and ensure correct default values are returned. These changes improve type safety and enhance the developer experience when working with feature flags.
…e configuration handling and improve documentation - Updated feature configuration structure across browser-sdk and react-sdk to use `targetingVersion` and `value` instead of `version` and `payload`. - Refactored related types and interfaces to improve type safety and clarity in feature handling. - Enhanced README documentation to reflect changes in feature configuration and usage examples. - Adjusted test cases to validate the new configuration structure and ensure accurate feature representation. These changes improve the developer experience and maintainability of the SDKs.
config option.config option.
roncohen
reviewed
Jan 23, 2025
Contributor
roncohen
left a comment
There was a problem hiding this comment.
good stuff! I will take this for a spin and try it in an application.
…pter - moving to a new PR
…ration - Changed the reference from `value` to `payload` in the README documentation to accurately describe the updated feature configuration structure. - Ensured that the example usage aligns with the latest implementation for better clarity and understanding. These updates improve the documentation and help developers understand the new configuration handling.
Swiftwork
reviewed
Jan 27, 2025
Swiftwork
reviewed
Jan 27, 2025
Simplified the feature remote config type by removing unnecessary properties and aligning with recent configuration changes. Minor refactoring of sendCheckEvent method to use shorthand property syntax.
config option.config option.
Cleaned up an unnecessary import of Features from a development-specific path in the main index file.
Update FallbackFeatureConfig type to support boolean and object overrides, allowing more flexible feature flag configuration. Modify feature fallback logic to handle both simple boolean flags and complex feature configurations.
Remove the .only modifier from the "caches response" test to ensure all tests are run during test execution.
Modify test assertions to reflect changes in feature configuration handling, including expected feature state and override behavior.
Update useFeature hook to create a reduced configuration object with only key and payload, streamlining config retrieval and aligning with recent configuration changes in the SDK.
Update README files for browser and react SDKs to provide more detailed explanations of remote configuration handling, including: - Clarifying optional payload behavior - Adding guidance on handling undefined config - Improving code examples for remote config usage
…eb-sdks-to-expose-the-config
…expose-the-config' into buc-3198-extend-the-web-sdks-to-expose-the-config
Add FallbackFeatureOverride to the exported types, extending the SDK's type exports for feature configuration
Update package versions and lock file to reflect the new alpha release, ensuring consistent versioning across SDKs
roncohen
approved these changes
Jan 29, 2025
Contributor
roncohen
left a comment
There was a problem hiding this comment.
apart from the EmptyFeatureConfig stuff, this all look good 👍
…expose-the-config' into buc-3198-extend-the-web-sdks-to-expose-the-config
roncohen
pushed a commit
that referenced
this pull request
Feb 26, 2025
…config` option. (#285) This PR introduces the `config`, which is an user-supplied JSON value that matches a given feature context (similar to targeting). The resolved configuration variant is then passed down to the client SDKs for use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the
config, which is an user-supplied JSON value that matches a given feature context (similar to targeting). The resolved configuration variant is then passed down to the client SDKs for use.