mozilla / universal-search-content

the iframe that we put inside the autocomplete dropdown
7 stars 7 forks source link

Replace lodash dependency with more specific modules #129

Closed pdehaan closed 8 years ago

pdehaan commented 8 years ago

I noticed that we're including all of lodash, as well as dependencies for lodash.debounce and lodash.throttle.

$ grep -irnl "from 'lodash" . --exclude-dir=node_modules
WHERE WHAT
./src/adapters/recommended_adapter.js:2 import debounce from 'lodash.debounce';
./src/adapters/search_suggestions_adapter.js:2 import _c from 'lodash/collection'; ... _c.collect(...)
./src/views/base_view.js:3 import flatten from 'lodash/array/flatten';
./src/views/base_view.js:4 import invoke from 'lodash/collection/invoke';
./src/views/index_view.js:13 import throttle from 'lodash.throttle';

I think we can probably remove the lodash dependency switch to the following smaller modules:

jaredhirsch commented 8 years ago

PRs welcome. I'd much rather just include all of lodash, because nobody cares about 10 extra KB.