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

Use lodash-es for ES modules #1344

Merged
merged 5 commits into from
Dec 8, 2017
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
@@ -1,6 +1,9 @@
# Change log

### vNext
- Use lodash-es to allow lodash functions to be used in ES modules [#1344](https://github.com/apollographql/react-apollo/pull/1344)

### 2.0.1

- upgraded required apollo-client for bugfix for subscriptions
- add component name in unhandled error message [#1362](https://github.com/apollographql/react-apollo/pull/1362)
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"bundle":
"rollup -c && rollup -c rollup.browser.config.js && rollup -c rollup.test-utils.config.js",
"compile:browser":
"rm -rf ./dist && mkdir ./dist && NODE_ENV=production browserify ./lib/react-apollo.browser.umd.js --i graphql-tag --i react --i apollo-client -o=./dist/index.js && npm run minify:browser && npm run compress:browser",
"rm -rf ./dist && mkdir ./dist && NODE_ENV=production browserify ./lib/react-apollo.browser.umd.js --i graphql-tag --i react --i apollo-client -o=./dist/index.js -t [ babelify --global true --only lodash-es --presets [ env ] ] && npm run minify:browser && npm run compress:browser",
"minify:browser":
"uglifyjs --compress dead_code=true,unused=true -m -o ./dist/index.min.js -- ./dist/index.js",
"compress:browser": "./scripts/gzip.js --file=./dist/index.min.js",
Expand Down Expand Up @@ -71,6 +71,9 @@
"transform": {
".*": "./preprocessor.js"
},
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!(lodash-es|react-native)/)"
],
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"modulePathIgnorePatterns": [
"<rootDir>/examples",
Expand All @@ -92,7 +95,8 @@
"@types/invariant": "2.2.29",
"@types/isomorphic-fetch": "0.0.34",
"@types/jest": "20.0.8",
"@types/lodash": "4.14.74",
"@types/lodash": "4.14.86",
"@types/lodash-es": "4.17.0",
"@types/node": "8.0.31",
"@types/object-assign": "4.0.30",
"@types/react": "16.0.28",
Expand All @@ -105,8 +109,11 @@
"@types/zen-observable": "0.5.3",
"apollo-cache-inmemory": "1.1.3",
"apollo-client": "2.1.0",
"babel-core": "^6.26.0",
"babel-jest": "20.0.3",
"babel-preset-env": "^1.6.1",
"babel-preset-react-native": "3.0.2",
"babelify": "^8.0.0",
"browserify": "14.4.0",
"bundlesize": "0.14.4",
"cheerio": "0.22.0",
Expand Down Expand Up @@ -159,8 +166,7 @@
"apollo-link": "^1.0.0",
"hoist-non-react-statics": "^2.2.0",
"invariant": "^2.2.1",
"lodash.flowright": "^3.5.0",
"lodash.pick": "^4.4.0",
"lodash-es": "^4.17.4",
"prop-types": "^15.5.8"
}
}
4 changes: 2 additions & 2 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export { withApollo } from './withApollo';
export { getDataFromTree } from './getDataFromTree';

// expose easy way to join queries from redux
import * as compose from 'lodash.flowright';
export { compose };
import flowRight from 'lodash-es/flowRight';
export { flowRight as compose };
2 changes: 1 addition & 1 deletion src/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import shallowEqual from './shallowEqual';

const invariant = require('invariant');
const assign = require('object-assign');
const pick = require('lodash.pick');
import pick from 'lodash-es/pick';

const hoistNonReactStatics = require('hoist-non-react-statics');

Expand Down