Skip to content

Releases: configcat/common-js

v8.0.0

12 Jun 18:24
Compare
Choose a tag to compare

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:

  • Complete overhaul of SDK logging:
    • Simplify the logger interface (IConfigCatLogger) to make it easier to write custom implementations/adapters to logger frameworks.
    • Enable structured logging.
    • Include event IDs in log messages to make identification of log events easier.
    • Revise log messages and make them consistent across the ConfigCat SDKs.
  • Revise caching of downloaded config data:
    • Change the cache interface (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.
    • Use a standardized config cache key generation algorithm and cache payload format to allow shared caches to be used by SDKs of different platforms.
  • Revise JSDoc documentation.
  • Improve the performance of the "IS (NOT) ONE OF (sensitive)" operators by hashing the value once (#80).

Bug fixes:

  • Fix checks which ensure that 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.)
  • Fix ... 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):

  • Remove the createClientWithAutoPoll, createClientWithManualPoll and createClientWithLazyLoad factory functions. Alternative: getClient.
  • Remove all callback-style evaluation methods (e.g. getValue, getValueDetails, etc.) from IConfigCatClient. Alternative: get*Async(...).then(result => ...)
  • Remove the callback-style forceRefresh method from IConfigCatClient. Alternative: forceRefreshAsync(...).then(result => ...)
  • Remove the IAutoPollOptions.configChanged callback. Alternative: options.setupHooks = hooks => hooks.on("configChanged", ...).
  • Changes the type of the newConfig argument from ProjectConfig to IConfig in the configChanged hook.
  • Remove the 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.
  • Remove the ICache interface. Alternative: IConfigCatCache.
  • Remove the getVariationIdAsync and getAllVariationIdsAsync methods from IConfigCatClient/ConfigCatClient. Alternative: getValueDetailsAsync and getAllValueDetailsAsync.
  • Slightly change the behavior of flag overrides so default value is returned instead of an unsupported value.
  • Slightly change the behavior of 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).
  • Remove the IOverrideDataSource interface and the FlagOverrides and MapOverrideDataSource classes from the public API.
  • Remove the ProjectConfig, RolloutRule and RolloutPercentageItem classes from the public API.
  • Change the type of the MatchedEvaluationRule to ITargetingRule and MatchedEvaluationPercentageRule to IPercentageOption in IEvaluationDetails.
  • Change the algorithm used to generate the config cache key and the format of the cache payload.

Notable internal breaking changes:

  • Replaces the 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.

v7.0.1

03 Jan 16:36
5350f4d
Compare
Choose a tag to compare

Fix potential ReferenceError in polyfills.

v7.0.0

03 Jan 11:27
7e1c5ba
Compare
Choose a tag to compare
  • Deprecate factory functions (createClientWith*) in favor of the new factory method getClient,
    which provides single client instances per SDK key.
  • Add convenience method disposeAllClients for disposing all open clients at once.
  • Implement default user feature.
  • Implement offline mode feature.
  • Improve LazyLoad and AutoPoll refresh logic by taking the cache timestamp into account
    to fetch the config only if cached config is unavailable or stale.
  • Add new evaluation methods getValueDetail/getValueDetailAsync and getAllValueDetails/getAllValueDetailsAsync,
    which provide more detailed information about the evaluation result.
  • Deprecate all callback-style get* functions and also deprecate getVariationIdAsync and getAllVariationIdsAsync.
  • Add hooks (events), which provide notifications of the client's actions.
  • Additional minor code quality and performance improvements.

Breaking changes

  • Remove redundancy from the package (lib/cjs folder removed, TS type declarations included only once)
  • Improve type safety of setting evaluation methods:
    • [API] make getValue/getValueAsync and getVariationId/getVariationIdAsync generic to enforce that the compile-time type of default value and return value match,
    • [Behavior] also make sure that run-time type of default value and actual setting value match (if not, an error message is logged and default value is returned).
  • [API] Change IConfigCatClient.refreshConfig/refreshConfigAsync to return information about the success of the operation.
  • [Behavior] Slightly change the behavior of ProjectConfig.Timestamp (updated when communication with the CDN servers succeeds, even in the case of several erroneous status codes like 403 and 404.)
  • [Behavior] Make ProjectConfig.equals consistent with other SDKs (improves tolerance to missing etags)

v6.0.1

21 Nov 14:14
Compare
Choose a tag to compare

Fixed

  • When the flagOverrides was set, the { [name: string]: Setting } map transformation of the remote settings didn't work properly.

v6.0.0

01 Jun 13:59
14cab55
Compare
Choose a tag to compare
  • Moved the SDK version to the fetch URL as a query parameter. Descendant SDKs will send the SDK version as a query parameter instead of the dedicated X-ConfigCat-UserAgent header.

v5.3.0

01 Jun 09:05
e97644d
Compare
Choose a tag to compare

Adding polyfill for Object.fromEntries to support older browsers.

v5.2.0

31 May 13:05
Compare
Choose a tag to compare

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.

v5.1.0

19 May 08:30
Compare
Choose a tag to compare
  • Export missing types related to feature flag overrides.

v5.0.2

26 Apr 08:00
524d933
Compare
Choose a tag to compare

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.

v5.0.1

22 Apr 12:44
Compare
Choose a tag to compare

🐛 Fixed

  • 5 sec delay issue on each first auto poll request.
  • Missing getSetting() function.