Skip to content

Commit

Permalink
Replace lodash per-method packages with scoped imports
Browse files Browse the repository at this point in the history
The per-method packages are zero-dependency modules, so they often
include a bunch of extra code compared to importing from lodash/foo. We
can save some bundle size by using these partial includes instead.

Additionally, if I recall correctly, the per-method packages are all
deprecated and no longer updated, so this is the way to go for lodash
moving forward.
  • Loading branch information
lencioni committed Jun 14, 2017
1 parent 48fe999 commit 49b3e76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
},
"dependencies": {
"eventlistener": "0.0.1",
"lodash.debounce": "^4.0.0",
"lodash.throttle": "^4.0.0",
"lodash": "^4.0.0",
"prop-types": "^15.5.8"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/LazyLoad.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { Children, Component } from 'react';
import PropTypes from 'prop-types';
import { findDOMNode } from 'react-dom';
import { add, remove } from 'eventlistener';
import debounce from 'lodash.debounce';
import throttle from 'lodash.throttle';
import debounce from 'lodash/debounce';
import throttle from 'lodash/throttle';
import parentScroll from './utils/parentScroll';
import inViewport from './utils/inViewport';

Expand Down

0 comments on commit 49b3e76

Please sign in to comment.