Skip to content

Commit

Permalink
Updated React default imports to namespace imports
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Dec 5, 2024
1 parent aa90a4a commit eb2440f
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 23 deletions.
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 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".
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 eb2440f

Please sign in to comment.