From eb2440f8ca646127d9c7b4e41965a6c1d9b33f78 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 5 Dec 2024 14:52:40 -0300 Subject: [PATCH] Updated React default imports to namespace imports --- CHANGES.txt | 3 +++ package-lock.json | 4 ++-- package.json | 2 +- src/SplitClient.tsx | 2 +- src/SplitContext.ts | 2 +- src/SplitFactoryProvider.tsx | 2 +- src/SplitTreatments.tsx | 2 +- src/__tests__/SplitClient.test.tsx | 2 +- src/__tests__/SplitContext.test.tsx | 2 +- src/__tests__/SplitFactoryProvider.test.tsx | 2 +- src/__tests__/SplitTreatments.test.tsx | 2 +- src/__tests__/testUtils/utils.tsx | 2 +- src/__tests__/useSplitClient.test.tsx | 2 +- src/__tests__/useSplitManager.test.tsx | 2 +- src/__tests__/useSplitTreatments.test.tsx | 2 +- src/__tests__/withSplitClient.test.tsx | 2 +- src/__tests__/withSplitFactory.test.tsx | 2 +- src/__tests__/withSplitTreatments.test.tsx | 2 +- src/useSplitClient.ts | 2 +- src/useSplitTreatments.ts | 2 +- src/withSplitClient.tsx | 2 +- src/withSplitFactory.tsx | 2 +- src/withSplitTreatments.tsx | 2 +- 23 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1e64f26..960707a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +2.0.2 (December XX, 2024) + - Updated the import of the React library from default imports to namespace imports for better compatibility with React, TypeScript, ES modules, and tree shaking. + 2.0.1 (December 4, 2024) - Updated @splitsoftware/splitio package to version 11.0.3 that includes some improvements and bugfixes. - Updated internal handling of the `updateOnSdkTimedout` param to remove the wrong log "[ERROR] A listener was added for SDK_READY_TIMED_OUT on the SDK, which has already fired and won't be emitted again". diff --git a/package-lock.json b/package-lock.json index a0caaca..61c5662 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-react", - "version": "2.0.1", + "version": "2.0.2-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-react", - "version": "2.0.1", + "version": "2.0.2-rc.0", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "11.0.3", diff --git a/package.json b/package.json index 3eb460e..474a56b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-react", - "version": "2.0.1", + "version": "2.0.2-rc.0", "description": "A React library to easily integrate and use Split JS SDK", "main": "cjs/index.js", "module": "esm/index.js", diff --git a/src/SplitClient.tsx b/src/SplitClient.tsx index 7640ee6..fd146ae 100644 --- a/src/SplitClient.tsx +++ b/src/SplitClient.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { SplitContext } from './SplitContext'; import { ISplitClientProps } from './types'; import { useSplitClient } from './useSplitClient'; diff --git a/src/SplitContext.ts b/src/SplitContext.ts index 5e07aff..1f4a308 100644 --- a/src/SplitContext.ts +++ b/src/SplitContext.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ISplitContextValues } from './types'; import { EXCEPTION_NO_SFP } from './constants'; diff --git a/src/SplitFactoryProvider.tsx b/src/SplitFactoryProvider.tsx index 38b2502..219a0f3 100644 --- a/src/SplitFactoryProvider.tsx +++ b/src/SplitFactoryProvider.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ISplitFactoryProviderProps } from './types'; import { VERSION, WARN_SF_CONFIG_AND_FACTORY } from './constants'; diff --git a/src/SplitTreatments.tsx b/src/SplitTreatments.tsx index 1a9e2a8..7f52776 100644 --- a/src/SplitTreatments.tsx +++ b/src/SplitTreatments.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { SplitContext } from './SplitContext'; import { ISplitTreatmentsProps } from './types'; diff --git a/src/__tests__/SplitClient.test.tsx b/src/__tests__/SplitClient.test.tsx index 4943ffd..19fbb06 100644 --- a/src/__tests__/SplitClient.test.tsx +++ b/src/__tests__/SplitClient.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render, act } from '@testing-library/react'; /** Mocks and test utils */ diff --git a/src/__tests__/SplitContext.test.tsx b/src/__tests__/SplitContext.test.tsx index 5388adb..4175874 100644 --- a/src/__tests__/SplitContext.test.tsx +++ b/src/__tests__/SplitContext.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render } from '@testing-library/react'; import { SplitContext } from '../SplitContext'; import { SplitFactoryProvider } from '../SplitFactoryProvider'; diff --git a/src/__tests__/SplitFactoryProvider.test.tsx b/src/__tests__/SplitFactoryProvider.test.tsx index 5a6ff96..33f0977 100644 --- a/src/__tests__/SplitFactoryProvider.test.tsx +++ b/src/__tests__/SplitFactoryProvider.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render, act } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/SplitTreatments.test.tsx b/src/__tests__/SplitTreatments.test.tsx index ce33a96..b2a3cb8 100644 --- a/src/__tests__/SplitTreatments.test.tsx +++ b/src/__tests__/SplitTreatments.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render, RenderResult, act } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/testUtils/utils.tsx b/src/__tests__/testUtils/utils.tsx index 36a0c5f..027655e 100644 --- a/src/__tests__/testUtils/utils.tsx +++ b/src/__tests__/testUtils/utils.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render } from '@testing-library/react'; import { ISplitStatus } from '../../types'; const { SplitFactory: originalSplitFactory } = jest.requireActual('@splitsoftware/splitio/client'); diff --git a/src/__tests__/useSplitClient.test.tsx b/src/__tests__/useSplitClient.test.tsx index bbd9d88..96eee88 100644 --- a/src/__tests__/useSplitClient.test.tsx +++ b/src/__tests__/useSplitClient.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { act, render } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/useSplitManager.test.tsx b/src/__tests__/useSplitManager.test.tsx index cd6d497..a17d19c 100644 --- a/src/__tests__/useSplitManager.test.tsx +++ b/src/__tests__/useSplitManager.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { act, render } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/useSplitTreatments.test.tsx b/src/__tests__/useSplitTreatments.test.tsx index 06b57b2..97d861b 100644 --- a/src/__tests__/useSplitTreatments.test.tsx +++ b/src/__tests__/useSplitTreatments.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { act, render } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/withSplitClient.test.tsx b/src/__tests__/withSplitClient.test.tsx index d818389..9676a62 100644 --- a/src/__tests__/withSplitClient.test.tsx +++ b/src/__tests__/withSplitClient.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/withSplitFactory.test.tsx b/src/__tests__/withSplitFactory.test.tsx index 98e765a..5f8f18e 100644 --- a/src/__tests__/withSplitFactory.test.tsx +++ b/src/__tests__/withSplitFactory.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render } from '@testing-library/react'; /** Mocks */ diff --git a/src/__tests__/withSplitTreatments.test.tsx b/src/__tests__/withSplitTreatments.test.tsx index 7ed6901..f11f3a1 100644 --- a/src/__tests__/withSplitTreatments.test.tsx +++ b/src/__tests__/withSplitTreatments.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { act, render } from '@testing-library/react'; /** Mocks */ diff --git a/src/useSplitClient.ts b/src/useSplitClient.ts index f2808a3..fa8983b 100644 --- a/src/useSplitClient.ts +++ b/src/useSplitClient.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { useSplitContext } from './SplitContext'; import { getSplitClient, initAttributes, getStatus } from './utils'; import { ISplitContextValues, IUseSplitClientOptions } from './types'; diff --git a/src/useSplitTreatments.ts b/src/useSplitTreatments.ts index d9b0f38..5509002 100644 --- a/src/useSplitTreatments.ts +++ b/src/useSplitTreatments.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { memoizeGetTreatmentsWithConfig } from './utils'; import { ISplitTreatmentsChildProps, IUseSplitTreatmentsOptions } from './types'; import { useSplitClient } from './useSplitClient'; diff --git a/src/withSplitClient.tsx b/src/withSplitClient.tsx index 3dec7b9..13f41ec 100644 --- a/src/withSplitClient.tsx +++ b/src/withSplitClient.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ISplitClientChildProps } from './types'; import { SplitClient } from './SplitClient'; diff --git a/src/withSplitFactory.tsx b/src/withSplitFactory.tsx index e587223..ecc0acc 100644 --- a/src/withSplitFactory.tsx +++ b/src/withSplitFactory.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ISplitFactoryChildProps } from './types'; import { SplitFactoryProvider } from './SplitFactoryProvider'; import { SplitClient } from './SplitClient'; diff --git a/src/withSplitTreatments.tsx b/src/withSplitTreatments.tsx index 0c4ceda..8119292 100644 --- a/src/withSplitTreatments.tsx +++ b/src/withSplitTreatments.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ISplitTreatmentsChildProps } from './types'; import { SplitTreatments } from './SplitTreatments';