Skip to content

Releases: statsig-io/react-sdk

v1.2.0 - upgrade internal Javascript SDK

04 Dec 01:52
a436f34
Compare
Choose a tag to compare

With this release we upgraded the version of the internal Statsig javascript SDK, which brings 2 changes:

  1. You can now customize the timeout for the SDK initialize network request, see details here.
  2. Local storage is now keyed on user ID, so that at a given time we store cached values of feature gates and experiments for up to 10 different users. See details here

v1.1.0 - Adds localMode option

10 Nov 18:47
Compare
Choose a tag to compare

Adds a statsig option called localMode

LocalMode short circuits all network requests. As a result, all gate/config/experiment checks will return default values. They can be overridden.

Useful for tests or local debugging to force values to a known state.

v1.0.2 [Internal] upgrade internal js sdk dependency

08 Nov 17:46
Compare
Choose a tag to compare

upgrade internal js sdk dependency for log beacon endpoint

v1.0.1 - Updating statsig-react with v4+ of the statsig-js SDK

04 Nov 21:53
5140bef
Compare
Choose a tag to compare

Migrates the statsig-react sdk to v4.0 of the statsig-js SDK. This introduces a number of breaking changes and enhancements.

Breaking Changes:

  • Removed the useStatsig hook. Instead, use import Statsig from 'statsig-react' to use the statsig-js sdk for event logging, or gate checks/event logging outside of a component tree. NOTE: SDK methods like checkGate and logEvent will throw if called before initialize() - to avoid errors in your component tree, check initStarted from the StatsigContext, or globally, check Statsig.initializedCalled()
  • Removed the separate DynamicConfig type, instead directly exporting the same type from the statsig-js sdk.

Enhancements and Bug Fixes:

  • Unify the type of DynamicConfig to be a single type across this SDK and the statsig-js sdk.
  • Memoizes the result of gate/config checks for a given user for enhanced performance and to reduce duplicate exposures.
  • Adds initializationComponent to render while initializing if waitForInitialization is true
  • Fetches cached flag values from local storage while initialize is pending if waitForInitialization is false. This means the first render pass will be waiting for initialization, the second will be with cached values, waiting for the initialize response from the server, and the third will have the up to date values from the server
  • Fixes an issue where changing the user object could trigger an updateUser while the SDK was initializing, which would throw an exception

Additional features (inherited from statsig-js). See the releases for more details:

  • DynamicConfig overrides
  • Ability to checkGate and getConfig without overrides, which is also added on the useGate, useConfig, and useExperiment hooks
  • Improved support for browsers + event logging, SSR logging bug fix, and configurations for event batch sizes and event flush intervals.
  • Added support for customIDs on the StatsigUser object

NOTE:
If you are calling methods on the global Statsig like initialize or updateUser, the user object tracked by the provider and the user object used outside the component tree can get out of sync. You are responsible for maintaining the state of the user and keeping it consistent with the StatsigProvider in these cases. The statsig-react SDK uses the global Statsig class to serve gate/config/experiment checks, but these are memoized in the hooks the SDK provides. Updates to the user which impact flag values that are made outside the context of the react component tree will not be reflected in the component tree unless the updated user is passed in to the StatsigProvider.

v1.0.0 - Updating statsig-react with v4+ of the statsig-js SDK

02 Nov 16:22
Compare
Choose a tag to compare

Migrates the statsig-react sdk to v4.0 of the statsig-js SDK. This introduces a number of breaking changes and enhancements.

Breaking Changes:

  • Removed the useStatsig hook. Instead, use import Statsig from 'statsig-react' to use the statsig-js sdk for event logging, or gate checks/event logging outside of a component tree. NOTE: SDK methods like checkGate and logEvent will throw if called before initialize() - to avoid errors in your component tree, check initStarted from the StatsigContext, or globally, check Statsig.initializedCalled()
  • Removed the separate DynamicConfig type, instead directly exporting the same type from the statsig-js sdk.

Enhancements and Bug Fixes:

  • Unify the type of DynamicConfig to be a single type across this SDK and the statsig-js sdk.
  • Memoizes the result of gate/config checks for a given user for enhanced performance and to reduce duplicate exposures.
  • Adds initializationComponent to render while initializing if waitForInitialization is true
  • Fetches cached flag values from local storage while initialize is pending if waitForInitialization is false. This means the first render pass will be waiting for initialization, the second will be with cached values, waiting for the initialize response from the server, and the third will have the up to date values from the server
  • Fixes an issue where changing the user object could trigger an updateUser while the SDK was initializing, which would throw an exception

Additional features (inherited from statsig-js). See the releases for more details:

  • DynamicConfig overrides
  • Ability to checkGate and getConfig without overrides
  • Improved support for browsers + event logging, SSR logging bug fix, and configurations for event batch sizes and event flush intervals.

NOTE:
If you are calling methods on the global Statsig like initialize or updateUser, the user object tracked by the provider and the user object used outside the component tree can get out of sync. You are responsible for maintaining the state of the user and keeping it consistent with the StatsigProvider in these cases. The statsig-react SDK uses the global Statsig class to serve gate/config/experiment checks, but these are memoized in the hooks the SDK provides. Updates to the user which impact flag values that are made outside the context of the react component tree will not be reflected in the component tree unless the updated user is passed in to the StatsigProvider.

v0.5.7 - Add missing exports for StatsigUser, StatsigOptions, and StatsigEnvironment

07 Oct 00:09
Compare
Choose a tag to compare

v0.5.6 - Export hook types from index file for easy import

05 Oct 17:31
Compare
Choose a tag to compare

Minor patch to export some types returned by the hook calls from the main index.ts

Fixed a rare bug when Statsig unmounts and remounts

02 Oct 00:43
b457242
Compare
Choose a tag to compare

Fixed a rare bug when Statsig unmounts and remounts, which would cause it to not fetch new values if user changes.

New patch version with a bug fix

01 Oct 22:56
60f6522
Compare
Choose a tag to compare

Fixed a bug where values for updated user is not fetched again from Statsig server when the user object is changed.