Skip to content

Commit 8f8a03e

Browse files
Merge pull request #225 from splitio/react_namespace_import
Updated `React` default imports to the recommended namespace imports
2 parents 1a94593 + f0d096f commit 8f8a03e

25 files changed

+32
-29
lines changed

.github/workflows/ci-cd.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
- name: Store assets
8080
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
81-
uses: actions/upload-artifact@v3
81+
uses: actions/upload-artifact@v4
8282
with:
8383
name: assets
8484
path: umd/
@@ -100,7 +100,7 @@ jobs:
100100

101101
steps:
102102
- name: Download assets
103-
uses: actions/download-artifact@v3
103+
uses: actions/download-artifact@v4
104104
with:
105105
name: assets
106106
path: umd
@@ -110,7 +110,7 @@ jobs:
110110
working-directory: umd
111111

112112
- name: Configure AWS credentials
113-
uses: aws-actions/configure-aws-credentials@v1-node16
113+
uses: aws-actions/configure-aws-credentials@v4
114114
with:
115115
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
116116
aws-region: us-east-1
@@ -139,7 +139,7 @@ jobs:
139139

140140
steps:
141141
- name: Download assets
142-
uses: actions/download-artifact@v3
142+
uses: actions/download-artifact@v4
143143
with:
144144
name: assets
145145
path: umd
@@ -149,7 +149,7 @@ jobs:
149149
working-directory: umd
150150

151151
- name: Configure AWS credentials
152-
uses: aws-actions/configure-aws-credentials@v1-node16
152+
uses: aws-actions/configure-aws-credentials@v4
153153
with:
154154
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
155155
aws-region: us-east-1

CHANGES.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.0.2 (January XX, 2025)
2+
- Updated the internal imports of React library from default to namespace imports as this is the recommended approach for better compatibility with React, TypeScript, ES modules, and tree shaking (https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports).
3+
14
2.0.1 (December 4, 2024)
25
- Updated @splitsoftware/splitio package to version 11.0.3 that includes some improvements and bugfixes.
36
- 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".

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2024 Split Software, Inc.
1+
Copyright © 2025 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-react",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "A React library to easily integrate and use Split JS SDK",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

src/SplitClient.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { SplitContext } from './SplitContext';
33
import { ISplitClientProps } from './types';
44
import { useSplitClient } from './useSplitClient';

src/SplitContext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { ISplitContextValues } from './types';
33
import { EXCEPTION_NO_SFP } from './constants';
44

src/SplitFactoryProvider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22

33
import { ISplitFactoryProviderProps } from './types';
44
import { VERSION, WARN_SF_CONFIG_AND_FACTORY } from './constants';

src/SplitTreatments.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22

33
import { SplitContext } from './SplitContext';
44
import { ISplitTreatmentsProps } from './types';

src/__tests__/SplitClient.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render, act } from '@testing-library/react';
33

44
/** Mocks and test utils */

src/__tests__/SplitContext.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render } from '@testing-library/react';
33
import { SplitContext } from '../SplitContext';
44
import { SplitFactoryProvider } from '../SplitFactoryProvider';

src/__tests__/SplitFactoryProvider.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render, act } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/SplitTreatments.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render, RenderResult, act } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/testUtils/utils.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render } from '@testing-library/react';
33
import { ISplitStatus } from '../../types';
44
const { SplitFactory: originalSplitFactory } = jest.requireActual('@splitsoftware/splitio/client');

src/__tests__/useSplitClient.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { act, render } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/useSplitManager.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { act, render } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/useSplitTreatments.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { act, render } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/withSplitClient.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/withSplitFactory.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { render } from '@testing-library/react';
33

44
/** Mocks */

src/__tests__/withSplitTreatments.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { act, render } from '@testing-library/react';
33

44
/** Mocks */

src/useSplitClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { useSplitContext } from './SplitContext';
33
import { getSplitClient, initAttributes, getStatus } from './utils';
44
import { ISplitContextValues, IUseSplitClientOptions } from './types';

src/useSplitTreatments.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { memoizeGetTreatmentsWithConfig } from './utils';
33
import { ISplitTreatmentsChildProps, IUseSplitTreatmentsOptions } from './types';
44
import { useSplitClient } from './useSplitClient';

src/withSplitClient.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { ISplitClientChildProps } from './types';
33
import { SplitClient } from './SplitClient';
44

src/withSplitFactory.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { ISplitFactoryChildProps } from './types';
33
import { SplitFactoryProvider } from './SplitFactoryProvider';
44
import { SplitClient } from './SplitClient';

src/withSplitTreatments.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import * as React from 'react';
22
import { ISplitTreatmentsChildProps } from './types';
33
import { SplitTreatments } from './SplitTreatments';
44

0 commit comments

Comments
 (0)