From cf158efdbd8136a33ca0b0c2209892587181f6b6 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 5 Jan 2024 16:31:19 -0300 Subject: [PATCH 1/2] Updated code to avoid errors when passing factory or config props on the server-side --- src/SplitFactory.tsx | 10 +++++++++- src/types.ts | 11 +++++++++-- src/utils.ts | 11 +++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/SplitFactory.tsx b/src/SplitFactory.tsx index ef390c5..29b3756 100644 --- a/src/SplitFactory.tsx +++ b/src/SplitFactory.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { SplitComponent } from './SplitClient'; import { ISplitFactoryProps } from './types'; import { WARN_SF_CONFIG_AND_FACTORY, ERROR_SF_NO_CONFIG_AND_FACTORY } from './constants'; -import { getSplitFactory, destroySplitFactory, IFactoryWithClients, getSplitClient } from './utils'; +import { getSplitFactory, destroySplitFactory, IFactoryWithClients, getSplitClient, isServerEnvironment } from './utils'; import { DEFAULT_UPDATE_OPTIONS } from './useSplitClient'; /** @@ -30,6 +30,14 @@ export class SplitFactory extends React.Component Date: Sat, 6 Jan 2024 13:28:06 -0300 Subject: [PATCH 2/2] Add changelog entry --- CHANGES.txt | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/SplitFactory.tsx | 2 +- src/types.ts | 6 +++--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7f32a73..b1681e0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +1.11.0 (January 11, 2023) + - Updated the `SplitFactory` component provider to support server-side rendering (Related to issue #11 and #109). See our documentation for more details: https://help.split.io/hc/en-us/articles/360038825091-React-SDK#server-side-rendering + - Updated internal code to remove a circular dependency and avoid warning messages with tools like PNPM (Related to issue #176). + 1.10.2 (December 12, 2023) - Updated @splitsoftware/splitio package to version 10.24.1 that updates localStorage usage to clear cached feature flag definitions before initiating the synchronization process, if the cache was previously synchronized with a different SDK key (i.e., a different environment) or different Split Filter criteria, to avoid using invalid cached data when the SDK is ready from cache. diff --git a/package-lock.json b/package-lock.json index cbf4ac1..102c89d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-react", - "version": "1.10.3-rc.0", + "version": "1.10.3-rc.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-react", - "version": "1.10.3-rc.0", + "version": "1.10.3-rc.1", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.0", diff --git a/package.json b/package.json index 058de08..bfe607c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-react", - "version": "1.10.3-rc.0", + "version": "1.10.3-rc.1", "description": "A React library to easily integrate and use Split JS SDK", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/SplitFactory.tsx b/src/SplitFactory.tsx index 29b3756..d2c5c40 100644 --- a/src/SplitFactory.tsx +++ b/src/SplitFactory.tsx @@ -30,7 +30,7 @@ export class SplitFactory extends React.Component