Skip to content

Releases: Flagsmith/flagsmith-js-client

3.9.0 Fixed source maps

22 Aug 13:33

Choose a tag to compare

This release fixes source mapping for all clients, prior to this you could not inspect ts functions such as init and getFlags from flagsmith-core.ts.

3.8.1 - Preparations for realtime flags

17 Aug 10:00

Choose a tag to compare

This release includes working functionality for Serverside Events in the Flagsmith JavaScript client, React Native and SSR clients. A follow-up release will be published when this is released to production.

3.8.0 - Fix useFlags for React Native, prepare for realtime flags

16 Aug 16:04

Choose a tag to compare

Prior to this release, React Native was not receiving flag updates with useFlags(["flag_name"]), this is due to the event emitter not being compatible.

This release also prepares functionality for realtime flags.

3.7.2 - Inform user of undefined fetch

10 Aug 14:03

Choose a tag to compare

Similarly to version 3.7.1, this change caters for SSR technologies not supporting fetch. This version informs the user when fetch is undefined regardless of whether the user is opted into logging.

3.7.1 - Add fetch logging

10 Aug 13:25

Choose a tag to compare

With SSR clients especially where fetch implementations differ, it's important to be able to debug fetch requests. With this version you will be able to see fetch statuses and exceptions when you pass enableLogs:true within flagsmith.init

3.7.0 - Typed generics for flagsmith flags and traits

09 Aug 14:37
99883c7

Choose a tag to compare

Given that we type our flags and traits

 type FlagOptions = "font_size" | "hero"
 type TraitOptions = "example_trait"

We can now enforce these types:

  // enforces you passing the correct key to flagsmith.getValue(x), flagsmith.getTrait(x)
  import flagsmith from "flagsmith"
  const typedFlagsmith = flagsmith as IFlagsmith<FlagOptions,TraitOptions> 

  // Similarly for the useFlagsmith hook
  const flagsmith = useFlagsmith<FlagOptions, TraitOptions>(); // enforces flagsmith.getValue()
  
  // for useFlags this will ensure you only can pass correct keys also
  const flags = useFlags<FlagOptions, TraitOptions>(["font_size"],["example_trait"]);

Thank you very much for this addition @PrettyWood

3.6.0 - Improve event-trigger code, fix up TypeScript issues

09 Aug 09:47
935a0ce

Choose a tag to compare

Closes #132 Thank you to @dgreene1 for the in-depth review 🚀 .

3.5.0 - allow custom fetch implementations

05 Aug 09:58

Choose a tag to compare

Some SSR technologies e.g. Nuxt do not provide a fetch polyfill, this means that sometimes we need to tell Flagsmith how to fetch data.

This is now possible with the following:

flagsmith.init({fetch:myCustomImplementation})

Here's an example of how this can be done with Nuxt https://github.com/Flagsmith/flagsmith-js-client/blob/main/examples/nuxt/plugins/flagsmith-plugin.ts#L10

3.4.0 - Remove deprecated IBulletTrainFeature type

15 Jul 10:24

Choose a tag to compare

IBulletTrainFeature had been deprecated many releases ago, this release removes it entirely. If your application imports it, just import IFlagsmithFeature instead. See https://github.com/Flagsmith/flagsmith-js-client/blob/main/types.d.ts

3.3.2 - Added Next.js Middleware Support

01 Jul 13:14
7c2688b

Choose a tag to compare

This release adds a Next.js middleware compatible bundle, a working example of this can be found here.

Closes #112