Skip to content

Releases: samuelcastro/react-splitio

v0.1.11

16 Nov 00:16
Compare
Choose a tag to compare

fix(SplitProvider): trying to freeze an already frozen object

If the memo cache is lost or maybe on hot reload deepFreeze would be called again for the same
config object which had been previously frozen. This makes deepFreeze idempotent instead of choking.

685dc69

Thanks to @CarsonF

v0.1.10

28 Oct 17:10
Compare
Choose a tag to compare
  • Fixed a TS type issue: a8df066
  • Documentation updates.

v0.1.9

01 Oct 20:05
Compare
Choose a tag to compare
  • Typescript error fix: c58ce76

  • Re-run split effect when splitName or attributes change: 7cab82c

v0.1.8

17 Sep 18:52
Compare
Choose a tag to compare
  • We included hooks support: 🎉
import { useSplit } form 'react-splitio';

const [feature1, config] = useSplit('feature1');

if (feature1 === 'on') {
  return <Feature1 />;
}
  • Changed client to be nullable.
    Now we don't have to fake a default client ({} as SplitIO.Client).
    This will prevent error if client is not defined and we try to call getTreatmentsWithConfig.
  • Changed lastUpdate to just be 0 instead of null for default.
    Since it is a unix timestamp check 0 functions fine.
  • Setting lastUpdate to "now" when the client is ready, because I'm pretty sure that's the time it has the treatments loaded from server.
  • We're not re-creating the client if the config options have changed.
    By giving all the config options as a dependency list to useEffect.
  • Converted SplitProvider to a function component.

Attributes on Split components

  • Adding the ability to include attributes when using Split components:
<Split name='feature1' attributes={{ paying_customer: true }}>
  {(value: TreatmentWithConfig) => {...}
</Split>

Advanced: Instantiate multiple/shared SDK clients

  • Allow for creating new clients by key. (#5)
  • We also support multiple clients instantiation as described in the Split.io documentation.

All you need to do is wrap your Split component with SplitClient passing key and optionally trafficType like so:

<SplitClient key="myKey" trafficType="...">
    <Split name="...">
</SplitClient>

Multiple/Shared clients.

11 Sep 21:10
Compare
Choose a tag to compare
Pre-release

Advanced: Instantiate multiple/shared SDK clients

We also support multiple clients instantiation as described in the Split.io documentation.

All you need to do is wrap your Split component with SplitClient passing key and optionally trafficType like so:

<SplitClient key="myKey" trafficType="...">
    <Split name="...">
</SplitClient>

Attributes on Split components

09 Sep 23:05
Compare
Choose a tag to compare
Pre-release
  • Adding the ability to include attributes when using Split components:
<Split name='feature1' attributes={{ paying_customer: true }}>
  {(value: TreatmentWithConfig) => {...}
</Split>

Performance Improvement

09 Sep 04:47
ff797d6
Compare
Choose a tag to compare
Pre-release
  • Allow for creating new clients by key. (#5)

Hooks Support and Improvements

22 Aug 21:44
f48c23e
Compare
Choose a tag to compare
Pre-release
  • We included hooks support: 🎉
import { useSplit } form 'react-splitio';

const [feature1, config] = useSplit('feature1');

if (feature1 === 'on') {
  return <Feature1 />;
}
  • Changed client to be nullable.
    Now we don't have to fake a default client ({} as SplitIO.Client).
    This will prevent error if client is not defined and we try to call getTreatmentsWithConfig.
  • Changed lastUpdate to just be 0 instead of null for default.
    Since it is a unix timestamp check 0 functions fine.
  • Setting lastUpdate to "now" when the client is ready, because I'm pretty sure that's the time it has the treatments loaded from server.
  • We're not re-creating the client if the config options have changed.
    By giving all the config options as a dependency list to useEffect.
  • Converted SplitProvider to a function component.