Skip to content

Commit

Permalink
Merge pull request #225 from splitio/react_namespace_import
Browse files Browse the repository at this point in the history
Updated `React` default imports to the recommended namespace imports
  • Loading branch information
EmilianoSanchez authored Jan 13, 2025
2 parents 1a94593 + f0d096f commit 8f8a03e
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 29 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Store assets
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: assets
path: umd/
Expand All @@ -100,7 +100,7 @@ jobs:

steps:
- name: Download assets
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: assets
path: umd
Expand All @@ -110,7 +110,7 @@ jobs:
working-directory: umd

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

steps:
- name: Download assets
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: assets
path: umd
Expand All @@ -149,7 +149,7 @@ jobs:
working-directory: umd

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
aws-region: us-east-1
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.0.2 (January XX, 2025)
- 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).

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".
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2024 Split Software, Inc.
Copyright © 2025 Split Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/SplitClient.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/SplitContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { ISplitContextValues } from './types';
import { EXCEPTION_NO_SFP } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion src/SplitFactoryProvider.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/SplitTreatments.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

import { SplitContext } from './SplitContext';
import { ISplitTreatmentsProps } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/SplitClient.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { render, act } from '@testing-library/react';

/** Mocks and test utils */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/SplitContext.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/SplitFactoryProvider.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { render, act } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/SplitTreatments.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { render, RenderResult, act } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/testUtils/utils.tsx
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/useSplitClient.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { act, render } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/useSplitManager.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { act, render } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/useSplitTreatments.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { act, render } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/withSplitClient.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { render } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/withSplitFactory.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { render } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/withSplitTreatments.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { act, render } from '@testing-library/react';

/** Mocks */
Expand Down
2 changes: 1 addition & 1 deletion src/useSplitClient.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/useSplitTreatments.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/withSplitClient.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { ISplitClientChildProps } from './types';
import { SplitClient } from './SplitClient';

Expand Down
2 changes: 1 addition & 1 deletion src/withSplitFactory.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/withSplitTreatments.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { ISplitTreatmentsChildProps } from './types';
import { SplitTreatments } from './SplitTreatments';

Expand Down

0 comments on commit 8f8a03e

Please sign in to comment.