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

Modify lodash importing #152

Closed
wants to merge 1 commit into from

Conversation

abetomo
Copy link
Contributor

@abetomo abetomo commented Mar 2, 2018

No description provided.

Copy link
Contributor

@dschep dschep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why this worked, bc I depend on the modular versions of those functions in lodash. But it seems (unsurprisingly in hindsight) that lodash is pulled in by the dependency tree anyway.

So, could you also replace the lodash.get, lodash.set and lodash.values in package.json with lodash?

@kichik
Copy link
Contributor

kichik commented Mar 2, 2018

lodash seems to be pulled in because of eslint and archiver.

C:\Dev\serverless-python-requirements>yarn why lodash
yarn why v1.5.1
[1/4] Why do we have the module "lodash"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "lodash@4.17.5"
info Reasons this module exists
   - "eslint" depends on it
   - Hoisted from "eslint#lodash"
   - Hoisted from "archiver#lodash"
   - Hoisted from "eslint#table#lodash"
   - Hoisted from "archiver#async#lodash"
   - Hoisted from "eslint#inquirer#lodash"
   - Hoisted from "archiver#zip-stream#lodash"
   - Hoisted from "archiver#archiver-utils#lodash"

@kichik
Copy link
Contributor

kichik commented Mar 2, 2018

eslint is a dev dependency and we don't actually use archiver. It might be possible to get rid of the full lodash dependency, at least when using the plugin and not developing. Nothing in serverless itself seems to be using it, so that should actually help installation size and speed.

@dschep
Copy link
Contributor

dschep commented Mar 2, 2018

Ah, didn't realize archiver wasn't actually being used. In that case I definitely prefer just removing the archiver dependency and sticking with the modular imports as is.

@kichik
Copy link
Contributor

kichik commented Mar 2, 2018

graceful-fs can also be removed.

@abetomo
Copy link
Contributor Author

abetomo commented Mar 3, 2018

Thank you for review!
I will check the dependency again.

@abetomo abetomo closed this Mar 3, 2018
@abetomo abetomo deleted the modify_lodash_importing branch March 5, 2018 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants