-
Notifications
You must be signed in to change notification settings - Fork 7
feat(node-sdk): support for remote configuration #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(node-sdk): support for remote configuration #295
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
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.
…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.
…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.
… enhance feature evaluation - Updated the dependency on `@bucketco/browser-sdk` from version 2.4.0 to 2.5.1 in both `yarn.lock` and `package.json`. - Refactored feature evaluation methods to improve type handling and support for various data types (boolean, string, number, object). - Enhanced README documentation with new examples for dynamic configuration usage. - Improved test coverage for feature evaluation scenarios, ensuring accurate results across different data types. These changes enhance the functionality and robustness of the openfeature-browser-provider, improving the developer experience and maintainability.
- Added support for more flexible fallback features with object-based configuration - Introduced new types for remote feature configurations - Updated client methods to handle feature configs with payload and targeting version - Improved type safety and configuration handling in feature evaluation - Extended feature override mechanisms to support config-based overrides These changes provide more robust and flexible feature flag configuration in the Node.js SDK.
… feature flags - Added documentation for remote feature configuration with key-payload pairs - Updated README examples to demonstrate remote config usage - Enhanced type-safe feature flags section with more detailed examples - Included configuration override examples with complex feature configurations The changes improve the clarity and comprehensiveness of the Node.js SDK documentation.
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.
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.
… buc-3197-extend-the-node-sdk-to-expose-the-configs
Modify feature test to reflect updated feature configuration handling, including changes to feature state and override expectations.
Modify test assertions to reflect changes in feature configuration handling, including expected feature state and override behavior.
… buc-3197-extend-the-node-sdk-to-expose-the-configs
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.
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
… buc-3197-extend-the-node-sdk-to-expose-the-configs
… buc-3197-extend-the-node-sdk-to-expose-the-configs
… structure Improve type checking and validation for feature overrides: - Add more robust validation for feature override objects - Require explicit `isEnabled` boolean for feature overrides - Support optional configuration with stricter type checks - Update test cases to reflect new feature override structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good. Let's get it in as an alpha and try it out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good. Still the outstanding issue of {}
vs {key: undefined...}
.
Can you also update the example application? It's also good to use that to test out if things actually work ;)
…expose-the-config' into buc-3198-extend-the-web-sdks-to-expose-the-config
… buc-3197-extend-the-node-sdk-to-expose-the-configs
…config is provided
… type safety This commit adds support for feature configurations in the node SDK, including: - Updated type definitions to support typed feature configs - Modified client methods to handle feature configs - Added example implementation with minimum todo length configuration - Improved type safety for feature overrides and feature retrieval
Enhance type safety for feature retrieval methods by: - Adding generic type parameters to `getFeature` and `getFeatureRemote` - Updating return types to use `TypedFeatures` for precise type inference - Modifying `_wrapRawFeature` to support typed feature configurations
Enhance type inference for feature configuration by casting the simplified config to the correct type for the specific feature
showMessage("Are you really sure you want to delete this item?"); | ||
// ... rest of the code | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds support for remote configuration to the node-sdk.
This PR adds support for remote configuration to the node-sdk.