Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Avoid importing lodash directly #2045

Merged
merged 7 commits into from
Aug 22, 2018
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
4 changes: 3 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
- Remove duplicate `FetchMoreOptions` and `FetchMoreQueryOptions` types, and
instead import them from Apollo Client. <br/>
[@skovy](https://github.com/skovy) in [#2281](https://github.com/apollographql/react-apollo/pull/2281)
- Type changes for the `graphql` HOC `options.skip` property. <br/>
- Type changes for the `graphql` HOC `options.skip` property. <br/>
[@jameslaneconkling](https://github.com/jameslaneconkling) in [#2208](https://github.com/apollographql/react-apollo/pull/2208)
- Avoid importing `lodash` directly. <br/>
[@shahyar](https://github.com/shahyar) in [#2045](https://github.com/apollographql/react-apollo/pull/2045)

## 2.1.11 (August 9, 2018)

Expand Down
4 changes: 2 additions & 2 deletions dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Removed import
import { includes } from 'lodash';
import * as fs from 'fs';
import includes from 'lodash/includes';
import fs from 'fs';

// Setup
const pr = danger.github.pr;
Expand Down
4 changes: 2 additions & 2 deletions examples/base/src/__tests__/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as renderer from 'react-test-renderer';
import React from 'react';
import renderer from 'react-test-renderer';
import { MockedProvider } from 'react-apollo/test-utils';

import { HERO_QUERY, withCharacter, CharacterWithoutData, App } from '../App';
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import Character from './Character';
import { Episode } from './__generated__/types';

Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/src/Character.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { GetCharacterQuery, GetCharacterQueryVariables, Episode } from './__generated__/types';
import { GetCharacter as QUERY } from './queries';
import { Query } from 'react-apollo';
Expand Down
187 changes: 0 additions & 187 deletions examples/typescript/src/__tests__/Character.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion examples/typescript/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { render } from 'react-dom';
import { ApolloClient } from 'apollo-client';
import { createHttpLink } from 'apollo-link-http';
Expand Down
4 changes: 2 additions & 2 deletions src/ApolloConsumer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import ApolloClient from 'apollo-client';

const invariant = require('invariant');
Expand Down
4 changes: 2 additions & 2 deletions src/ApolloProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import { Component } from 'react';
import ApolloClient from 'apollo-client';
import { DocumentNode } from 'graphql';
Expand Down
4 changes: 2 additions & 2 deletions src/Mutation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import ApolloClient, { PureQueryOptions, ApolloError } from 'apollo-client';
import { DataProxy } from 'apollo-cache';
const invariant = require('invariant');
Expand Down
4 changes: 2 additions & 2 deletions src/Query.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import ApolloClient, {
ObservableQuery,
ApolloError,
Expand Down
4 changes: 2 additions & 2 deletions src/Subscriptions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import ApolloClient, { ApolloError } from 'apollo-client';
import { Observable } from 'apollo-link';

Expand Down
2 changes: 1 addition & 1 deletion src/getDataFromTree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

export interface Context {
[key: string]: any;
Expand Down
3 changes: 1 addition & 2 deletions src/graphql.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// pacify typescript (we have to turn off no unused locals though :cry:)
import * as React from 'react';
import React from 'react';
import { DocumentNode } from 'graphql';
import { parser, DocumentType } from './parser';
import { OperationOption, DataProps, MutateProps } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/hoc-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
const invariant = require('invariant');

import { OperationVariables } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/mutation-hoc.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { DocumentNode } from 'graphql';
const hoistNonReactStatics = require('hoist-non-react-statics');

Expand Down
2 changes: 1 addition & 1 deletion src/query-hoc.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { ApolloError } from 'apollo-client';
import { DocumentNode } from 'graphql';
const hoistNonReactStatics = require('hoist-non-react-statics');
Expand Down
2 changes: 1 addition & 1 deletion src/renderToStringWithData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactElement } from 'react';
import * as ReactDOM from 'react-dom/server';
import ReactDOM from 'react-dom/server';

import { default as getDataFromTree } from './getDataFromTree';

Expand Down
2 changes: 1 addition & 1 deletion src/subscription-hoc.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { DocumentNode } from 'graphql';
const hoistNonReactStatics = require('hoist-non-react-statics');

Expand Down
2 changes: 1 addition & 1 deletion src/test-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import ApolloClient from 'apollo-client';
import { DefaultOptions } from 'apollo-client/ApolloClient';
import { InMemoryCache as Cache } from 'apollo-cache-inmemory';
Expand Down
2 changes: 1 addition & 1 deletion src/withApollo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { OperationOption } from './types';
import ApolloConsumer from './ApolloConsumer';
import { ApolloClient } from 'apollo-client';
Expand Down
2 changes: 1 addition & 1 deletion test/client/ApolloConsumer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import ApolloClient from 'apollo-client';
import { InMemoryCache as Cache } from 'apollo-cache-inmemory';
import { ApolloLink } from 'apollo-link';
Expand Down
6 changes: 3 additions & 3 deletions test/client/ApolloProvider.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import React from 'react';
import PropTypes from 'prop-types';
import { shallow } from 'enzyme';
import * as TestUtils from 'react-dom/test-utils';
import TestUtils from 'react-dom/test-utils';
import ApolloClient from 'apollo-client';
import { InMemoryCache as Cache } from 'apollo-cache-inmemory';
import { ApolloLink } from 'apollo-link';
Expand Down
2 changes: 1 addition & 1 deletion test/client/Mutation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { mount } from 'enzyme';
import gql from 'graphql-tag';
import { ApolloClient } from 'apollo-client';
Expand Down
2 changes: 1 addition & 1 deletion test/client/Query.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import ApolloClient, { ApolloError, NetworkStatus } from 'apollo-client';
import { mount, ReactWrapper } from 'enzyme';
import { InMemoryCache as Cache } from 'apollo-cache-inmemory';
Expand Down
2 changes: 1 addition & 1 deletion test/client/Subscription.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import gql from 'graphql-tag';
import { mount, ReactWrapper } from 'enzyme';

Expand Down
Loading