Skip to content

Releases: Flagsmith/flagsmith-js-client

Version 4.0.2

17 May 17:06
1a47754
Compare
Choose a tag to compare

What's Changed

  • fix: clear traits when identifying over previous identity by @kyle-ssg in #229

Full Changelog: 4.0.1...4.0.2

v4.0.1 Fix onChange Generic Types

24 Apr 10:27
b1aa273
Compare
Choose a tag to compare

v4.0.0 - add list of changed flags/traits, improve resolve/reject of init

08 Apr 07:55
6253e7e
Compare
Choose a tag to compare

This will be the first version compatible with OpenFeature. Merges #223

Breaking changes

  • Init will now reject if:
    • No environment ID is provider
    • Fetch fails and there's no cache (Init resolves on cache)
    • There's no cache/defaults and preventFetch is true
  • The boolean properties traitsChange and flagsChanged are now a string[] of changed keys or null. This reduces breaking changes since falsey and truthy checks will still behave as before.

Other changes

  • Init is (finally) async/await
  • Init code is reduced by pulling out isolated functions
  • Added tests around init promises
  • Organised util files

3.24.0 - Read cache synchronously

28 Mar 19:05
68fe0e8
Compare
Choose a tag to compare

Closes #222

The SDK will now synchronously read cache rather than fetching it asynchronously.

3.23.2 - Remove busy logs, fix onChange event

01 Mar 08:54
2a7e519
Compare
Choose a tag to compare

3.23.1 - Prevent Nextjs caching behaviour

01 Mar 08:51
1d72411
Compare
Choose a tag to compare

3.23.0 - Fix missed events in useFlags

29 Feb 08:55
bfe5446
Compare
Choose a tag to compare

Closes #214

  • Fixes flag updates from useFlags
  • Fixes flag updates where flagsmith.init is not called

3.22.1 - Support fallback for non-JSON evaluations

20 Feb 12:26
23b0cae
Compare
Choose a tag to compare

3.22.0 - Prevent race condition between identify/getFlags

10 Jan 16:35
b018621
Compare
Choose a tag to compare

Prior to this release, clients that request identified/unidentified flags simultaneously could see the wrong results due to a race condition. Although this signifies incorrect usage of the SDK, this will no longer occur.

For more information see #205.

3.19.0 - Access Flagsmith loading state

23 Jun 07:55
b4d93c7
Compare
Choose a tag to compare

This introduces a strategy to responding to loading state changes in flagsmith

The following will be exposed to Flagsmith:

export declare enum FlagSource {
    "NONE" = "NONE",
    "DEFAULT_FLAGS" = "DEFAULT_FLAGS",
    "CACHE" = "CACHE",
    "SERVER" = "SERVER",
}

export declare type LoadingState = {
    error: Error | null, // Current error, resets on next attempt to fetch flags
    isFetching: bool, // Whether there is a current request to fetch server flags
    isLoading: bool,  // Whether any flag data exists
    source: FlagSource //Indicates freshness of flags
}

It can be consumed via the onChange function of flagsmith.init or the newly introduced useFlagsmithLoading

    onChange?: (previousFlags: IFlags<F> | null, params: IRetrieveInfo, loadingState:LoadingState) => void;
    const loadingState:LoadingState = useFlagsmithLoading()