Common Javascript library for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
MIT License
Improvements:
UserComparator
members consistent. (#102)Bug fixes:
Breaking changes:
UserComparator
members: Is(Not)OneOf
-> TextIs(Not)OneOf
, SensitiveIs(Not)OneOf
-> SensitiveTextIs(Not)OneOf
, (Not)ContainsAnyOf
-> Text(Not)ContainsAnyOf
. (Low impact expected.)Published by adams85 10 months ago
New features/improvements:
createFlagOverridesFromMap
function to the configcat-common
package to reduce redundancy.watchChanges
to createFlagOverridesFromMap
which controls whether the client should detect changes to the flag override map after client initialization. (https://github.com/configcat/common-js/pull/101)Notable internal breaking changes:
IOverrideDataSource
, FlagOverrides
(type is still re-exported) and MapOverrideDataSource
from package re-exports.Published by adams85 10 months ago
Improvements:
Bug fixes:
getKeyAndValueAsync
so it doesn't return an unsupported setting value coming from an invalid flag override.Breaking changes:
IEvaluationDetails
and `SettingKey. (Very low impact expected.)Notable internal breaking changes:
SettingType
, UserComparator
, PrerequisiteFlagComparator
, SegmentComparator
) into the ConfigJson
module.Published by adams85 11 months ago
New features and improvements:
Bug fixes:
IConfigCatClient.waitForReady
. Also, make observable if the initial cache sync-up fails.Breaking changes (listed in the order of expected impact):
matchedEvaluationRule
property to matchedTargetingRule
and the matchedEvaluationPercentageRule
property to matchedPercentageOption
in IEvaluationDetails
.Error
when the SDK key passed to ConfigCatClient.get
is in invalid format (unless the client is set up to use local-only flag override behavior).ClientReadyState
enum (it was renamed to ClientCacheState
).IConfig
and related interfaces/enums).ClientReady
hook in Auto Poll mode to fire after the completion of the first fetch operation - regardless of success or failure - to make the behavior consistent with other SDKs. (https://github.com/configcat/common-js/pull/94)Notable internal breaking changes:
User
class into a separate module.IRolloutEvaluator.evaluate
.Published by adams85 about 1 year ago
New features and improvements:
cacheState
to IConfigCatClientSnapshot
, which can be used to get information about the "up-to-dateness" of the state captured by the snapshot.get
operation is synchronous, the sync-up on client construction will also happen synchronously. (As a consequence, in such cases the cacheState
property of a snapshot created right after the client instantiation will already reflect the actual cache state.)Bug fixes:
maxInitWaitTimeSeconds
has passed.Published by adams85 about 1 year ago
Improvements:
Published by adams85 over 1 year ago
New features and improvements:
IConfigCatClient.snapshot()
, which captures the client's state (including the latest config fetched), then, using the returned object, they can execute synchronous evaluation operations.clientReady
hook, by means of which consumers can get information about the initialization state of the client.Bug fixes:
getValueAsync
/getValueDetailsAsync
calls.Comparator.Contains/NotContains
.Published by z4kn4fein over 1 year ago
Bug fixes:
configChanged
hook was emitted even when the downloaded config JSON wasn't changed.Published by adams85 over 1 year ago
Bug fixes:
getAllValues
when one or more settings evaluate with error.Notable internal breaking changes:
IRolloutEvaluator.evaluate
to IEvaluateResult
.Published by adams85 over 1 year ago
Please note that this version comes with several breaking changes, so you may need to adjust your code when upgrading, especially if you're using deprecated APIs or a custom logger and/or cache implementation. You can find the detailed list of breaking changes below.
New features and improvements:
IConfigCatLogger
) to make it easier to write custom implementations/adapters to logger frameworks.IConfigCatCache
, formerly ICache
) to get and set the cache payload as a plain string to make it easier to write custom implementations by removing the burden of data serialization from implementers.Bug fixes:
IAutoPollOptions.pollIntervalSeconds
, IAutoPollOptions.maxInitWaitTimeSeconds
and ILazyLoadingOptions.cacheTimeToLiveSeconds
settings are in the valid range. (Also, make infinite init wait possible in the case of Auto Polling.)... is not a function
bug which can occur in Auto Polling mode, when IAutoPollOptions.maxInitWaitTimeSeconds
is set to 0.Breaking changes (listed in the order of expected impact):
createClientWithAutoPoll
, createClientWithManualPoll
and createClientWithLazyLoad
factory functions. Alternative: getClient
.getValue
, getValueDetails
, etc.) from IConfigCatClient
. Alternative: get*Async(...).then(result => ...)
forceRefresh
method from IConfigCatClient
. Alternative: forceRefreshAsync(...).then(result => ...)
IAutoPollOptions.configChanged
callback. Alternative: options.setupHooks = hooks => hooks.on("configChanged", ...)
.newConfig
argument from ProjectConfig
to IConfig
in the configChanged
hook.debug
, info
, warn
and error
methods from IConfigCatLogger
and change the signature of the log
method, which is now the single method that needs to be implemented for custom logging.ICache
interface. Alternative: IConfigCatCache
.getVariationIdAsync
and getAllVariationIdsAsync
methods from IConfigCatClient
/ConfigCatClient
. Alternative: getValueDetailsAsync
and getAllValueDetailsAsync
.getValuesAsync
and getValuesDetailsAsync
to fail early with exception when these methods are called with invalid parameters:
Error
when key
is empty.TypeError
when defaultValue
is not of an allowed type (string
, boolean
, number
, null
and undefined
).IOverrideDataSource
interface and the FlagOverrides
and MapOverrideDataSource
classes from the public API.ProjectConfig
, RolloutRule
and RolloutPercentageItem
classes from the public API.MatchedEvaluationRule
to ITargetingRule
and MatchedEvaluationPercentageRule
to IPercentageOption
in IEvaluationDetails
.Notable internal breaking changes:
cache
property with defaultCacheFactory
in IConfigCatKernel
(+ in OptionsBase
constructors) to allow platform-specific SDKs to use own external cache implementations (like local storage cache) as default cache implementations. When the factory is not set, InMemoryConfigCache
will be used by default.Published by adams85 almost 2 years ago
Fix potential ReferenceError
in polyfills.
Published by adams85 almost 2 years ago
createClientWith*
) in favor of the new factory method getClient
,disposeAllClients
for disposing all open clients at once.getValueDetail
/getValueDetailAsync
and getAllValueDetails
/getAllValueDetailsAsync
,get*
functions and also deprecate getVariationIdAsync
and getAllVariationIdsAsync
.getValue
/getValueAsync
and getVariationId
/getVariationIdAsync
generic to enforce that the compile-time type of default value and return value match,IConfigCatClient.refreshConfig
/refreshConfigAsync
to return information about the success of the operation.ProjectConfig.Timestamp
(updated when communication with the CDN servers succeeds, even in the case of several erroneous status codes like 403 and 404.)ProjectConfig.equals
consistent with other SDKs (improves tolerance to missing etags)Published by z4kn4fein almost 2 years ago
flagOverrides
was set, the { [name: string]: Setting }
map transformation of the remote settings didn't work properly.Published by z4kn4fein over 2 years ago
Published by laliconfigcat over 2 years ago
Adding polyfill for Object.fromEntries to support older browsers.
Published by laliconfigcat over 2 years ago
Ability to pass the real SDK version though the ConfigCatKernel, instead of using the common-js version for the X-CONFIGCAT-USERAGENT.
Breaking change: from now, the SDK version should be passed to the ConfigCatKernel.
Published by z4kn4fein over 2 years ago
Published by laliconfigcat over 2 years ago
Extensive debug logging to trace down problems with the SDK.
Breaking change: the IConfigCatLogger interface has been improved with a debug() method that has to be implemented in any custom logger derived from that interface.
Published by z4kn4fein over 2 years ago
getSetting()
function.Published by z4kn4fein over 2 years ago
IConfigFetcher
interface has been changed to minimize the occurrences of JSON serialization/deserialization.