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

Prefer import * as for imports whose types are re-exported #7742

Merged
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ TBD
- Allow `merge: true` field policy to merge `Reference` objects with non-normalized objects, and vice-versa. <br/>
[@benjamn](https://github.com/benjamn) in [#7778](https://github.com/apollographql/apollo-client/pull/7778)

- Prefer `import * as namepace ...` for imports whose types are re-exported (and thus may appear in `.d.ts` files). <br/>
[@devrelm](https://github.com/devrelm) in [#7742](https://github.com/apollographql/apollo-client/pull/7742)

### Documentation
TBD

Expand Down
4 changes: 2 additions & 2 deletions src/link/persisted-queries/__tests__/react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom/server';
import * as React from 'react';
import * as ReactDOM from 'react-dom/server';
import gql from 'graphql-tag';
import { print } from 'graphql';
import { sha256 } from 'crypto-hash';
Expand Down
2 changes: 1 addition & 1 deletion src/react/components/Mutation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

import { OperationVariables } from '../../core';
import { MutationComponentOptions } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/react/components/Query.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

import { OperationVariables } from '../../core';
import { QueryComponentOptions } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/react/components/Subscription.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

import { OperationVariables } from '../../core';
import { SubscriptionComponentOptions } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/react/context/ApolloConsumer.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 { invariant } from 'ts-invariant';

import { ApolloClient } from '../../core';
Expand Down
2 changes: 1 addition & 1 deletion src/react/context/ApolloContext.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 { ApolloClient } from '../../core';
import { canUseWeakMap } from '../../utilities';

Expand Down
2 changes: 1 addition & 1 deletion src/react/context/ApolloProvider.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 { invariant } from 'ts-invariant';

import { ApolloClient } from '../../core';
Expand Down
2 changes: 1 addition & 1 deletion src/react/hoc/hoc-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 { invariant } from 'ts-invariant';
import { OperationVariables } from '../../core';
import { IDocumentDefinition } from '../parser';
Expand Down
2 changes: 1 addition & 1 deletion src/react/hoc/mutation-hoc.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 { DocumentNode } from 'graphql';
import hoistNonReactStatics from 'hoist-non-react-statics';

Expand Down
2 changes: 1 addition & 1 deletion src/react/hoc/query-hoc.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 { DocumentNode } from 'graphql';
import hoistNonReactStatics from 'hoist-non-react-statics';

Expand Down
2 changes: 1 addition & 1 deletion src/react/hoc/subscription-hoc.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 { DocumentNode } from 'graphql';
import hoistNonReactStatics from 'hoist-non-react-statics';

Expand Down
2 changes: 1 addition & 1 deletion src/react/hoc/withApollo.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 hoistNonReactStatics from 'hoist-non-react-statics';
import { invariant } from 'ts-invariant';

Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/useApolloClient.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 { invariant } from 'ts-invariant';

import { ApolloClient } from '../../core';
Expand Down
2 changes: 1 addition & 1 deletion src/react/ssr/getDataFromTree.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 { getApolloContext } from '../context';
import { RenderPromises } from './RenderPromises';

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/testing/mocking/MockedProvider.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 { ApolloClient, DefaultOptions } from '../../../core';
import { InMemoryCache as Cache } from '../../../cache';
Expand Down