Skip to content

Releases: Flagsmith/flagsmith-js-client

3.14.0 - Reduce bundle size

09 Nov 09:51

Choose a tag to compare

This release reduces the bundle size (31kb -> 21kb Pre GZIP) of the core SDK, it does so by patching one of our only dependencies (@callstack/async-storage) to export just the functions we need and remove the dependency of lodash.

image

3.13.1 - fix IFlagsmithFeature type

09 Nov 09:30

Choose a tag to compare

3.13.0 - Fix race condition with useFlags

27 Oct 12:51
9511561

Choose a tag to compare

Prior to this release, there were cases where useFlags was not updating flags when the Flagsmith cache was received. This was down to event listeners not being initialised prior to the cache being accessed.

3.12.0 - fix fallback usage on null flags

27 Oct 09:10

Choose a tag to compare

A few releases ago we added the ability to automatically parse JSON in flagsmith.getValue. Since null is parseable by JSON.parse, the fallback was not being used in a lot of cases. Now, the client will ignore null flag values and use the fallback.

  const json = flagsmith.getValue<{foo: string|null, bar: string|null}>("json_value", {
      json: true,
      fallback: {foo:null,bar:null}
  });
  // if the value is null, json before this release would be null

3.11.0 - Fix offline cache usage

20 Oct 16:20

Choose a tag to compare

Closes #148, prior to this release failed API requests (e.g. offline) would incorrectly update the local storage cache. Failed API calls will correctly trigger onError with the appropriate information.

This also fixes a usecase where the client has analytics data for an environment different to the one they are currently requesting https://github.com/Flagsmith/flagsmith-js-client/blob/main/flagsmith-core.ts#L201.

Thank you so much to @gfrancischini for spotting and reporting this.

3.10.5 - getValue JSON type support

09 Oct 10:33
b15b539

Choose a tag to compare

This release will allow you to specify the return type of getValue as well as allow you to parse the value as JSON.

// for getting JSON values this will type the return
const json = flagsmith.getValue<{ foo: string | null; bar: string | null }>('json_value', {
 json: true,
 fallback: { foo: null, bar: null },
});
console.log(json.foo); // typed as {foo: string|null, bar: string|null}

// If a type is not specified for getValue it will asume it from the type of fallback. In this case, a number.
const font_size = flagsmith.getValue('font_size', { fallback: 12 });

Thank you very much @azriel46d and @dangrima90 🤩

3.10.2 - Bundle "flagsmith/react" into react-native-flagsmith

03 Oct 10:22

Choose a tag to compare

Prior to this release, users on React Native had to install both the react-native SDK and standard flagsmith SDK.

An implementation would look like this

import flagsmith from 'react-native-flagsmith';
import {FlagsmithProvider} from 'flagsmith/react';

<FlagsmithProvider flagsmith={flagsmith}
...

With this release you can now import react specific components from 'react-native-flagsmith'. So implementation can be as follows

import flagsmith from 'react-native-flagsmith';
import {FlagsmithProvider} from 'react-native-flagsmith/react';

3.10.1 - Fix multi project flag analytics

22 Sep 11:10
addebde

Choose a tag to compare

3.10.0 Realtime flag preparations

22 Sep 11:02

Choose a tag to compare

This release configures serverside event urls to match what we intend to use for production. More updates on realtime flags will follow.

3.9.2 - TypeScript fixes and Fixed React Native Async Storage

26 Aug 15:51

Choose a tag to compare