This guide highlights the key changes you need to be aware of when upgrading to v10.0.0 of the Unleash client.
The Bootstrapping interface now requires an Optional<String>
to be returned rather than a String
. If the bootstrapper fails to load the feature set, return an Optional
of empty.
MoreOperations
no longer lists count
or countVariant
, these are considered internal APIs and are no longer publicly exposed.
getFeatureToggleDefinition
no longer returns the complete feature flag definition. Instead, it returns a lightweight Java object that contains the name of the flag, the project that it's bound to, and an optional type parameter that describes the feature flag type in Unleash, such as "experiment" or "killswitch".
The strategy interface has changed to only include the two methods getName
and isEnabled
. isEnabled
now requires both a parameter map and an UnleashContext
. This only affects users who are implementing custom or fallback strategies.
The following subscriber functions are no longer available: togglesBackedUp
, toggleBackupRestored
, and togglesBootstrapped
. Subscribing to featuresBackedUp
, featuresBackupRestored
, and featuresBootstrapped
respectively serves the same purpose. These subscribers no longer yield events that contain the full feature flag definition, instead, they expose a getFeatures
method which returns a list of lightweight Java objects containing the feature name, the type of flag, and the project it's bound to.
The togglesFetched
listener now returns a ClientFeaturesResponse
event, which has an identical getFeatures
method instead of the full feature flag definitions.
Variant
has been moved to theio.getunleash.variant
namespace.- The public interface
IFeatureRepository
has been renamed toFeatureRepository
. - The concrete implementor of
FeatureRepository
has been renamed toFeatureRepositoryImpl
.
The following public deprecated APIs have been removed:
deprecatedGetVariant
- This computes a variant with an old hash seed. This is no longer supported.getFeatureToggleDefinition
-DefaultUnleash.more().getFeatureToggleDefinition()
.getFeatureToggleNames
- UseDefaultUnleash.more().getFeatureToggleNames()
instead.count
- No longer publicly accessible.
deprecatedGetVariant
- No longer present on the parent interface, removed for consistency.
selectDeprecatedVariantHashingAlgo
- Removed since it's no longer required fordeprecatedGetVariant
.
FeatureToggleRepository
- Use FeatureRepositoryImpl
instead.
ToggleRepository
- Use FeatureRepository
instead.
HttpToggleFetcher
- Use HttpFeatureFetcher
instead.
ToggleFetcher
- Use FeatureFetcher
instead.
JsonToggleCollectionDeserializer
- No alternative needed.
JsonToggleParser
- No alternative needed.
ToggleBackupHandlerFile
- No alternative needed.