Skip to content

Conversation

@pavkam
Copy link
Contributor

@pavkam pavkam commented Feb 12, 2025

No description provided.

pavkam added 30 commits January 10, 2025 15:43
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.
…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.
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-3250-extend-the-openfeature-web-sdk-to-use-the-config
Modify test assertions to reflect changes in feature configuration handling, including expected feature state and override behavior.
… buc-3250-extend-the-openfeature-web-sdk-to-use-the-config
Update useFeature hook to return a reduced feature configuration with only key and payload properties, aligning with recent configuration changes in the SDK.
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.
… buc-3250-extend-the-openfeature-web-sdk-to-use-the-config
…evaluations

Update test cases for boolean, number, string, and object flag evaluations to:
- Enhance test descriptions with more context
- Add type mismatch test scenarios
- Refine feature flag evaluation logic
- Improve error handling for different input types
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
…expose-the-config' into buc-3198-extend-the-web-sdks-to-expose-the-config
pavkam added 20 commits January 28, 2025 12:24
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-3250-extend-the-openfeature-web-sdk-to-use-the-config
…ature resolution and lifecycle management

- Update provider to handle feature resolution with more robust type checking
- Add support for provider lifecycle methods, including stopping the client
- Improve error handling for different evaluation scenarios
- Update dependencies to use @bucketco/browser-sdk 3.0.0-alpha.2
- Bump package version to 0.4.0-alpha.0
…re resolution and context handling

- Update provider to support more robust feature resolution methods
- Improve context translation with additional user and company attributes
- Add support for variant tracking in feature evaluations
- Enhance error handling for different evaluation scenarios
- Update dependencies to use @bucketco/node-sdk 1.6.0-alpha.3
- Bump package version to 0.3.0-alpha.0
…r and company IDs

- Convert user and company IDs to strings in both browser and node providers
- Update test cases to reflect string-based ID handling
- Maintain consistent context translation across providers
…ion in browser and node providers

- Update type checking logic to handle undefined and null payloads
- Ensure consistent feature resolution across browser and node providers
- Simplify payload type detection and comparison
This PR improves the handling of check/evaluate events in the age of
`remote config`. Fixes some additional small nagging issues along the
way.
@pavkam pavkam self-assigned this Feb 12, 2025
@pavkam pavkam closed this Feb 12, 2025
@pavkam pavkam deleted the buc-3250-extend-the-openfeature-node-sdk-to-use-the-config branch February 12, 2025 13:30
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.

1 participant