Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated React default imports to the recommended namespace imports #225

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (December XX, 2024)
- 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
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
Loading