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

build(logger): reduce node_modules size #427

Merged
merged 3 commits into from
Jan 7, 2022
Merged

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Jan 6, 2022

Description of your changes

As detailed in #419 the size of node_modules for logger was unnecessarily big, this PR removes the full lodash lib in favor of targeted lodash.x depenencies brigning down the node_modules size to 1.8M from 139M.

Detailed list of changes:

  • Removed lodash & @types/lodash
  • Added lodash.clonedeep, lodash.merge, and lodash.pickby & respective @types/lodash.xxx
  • Updated imports to use new deps
  • Updated calls for merge in main Logger class since it was using the lodash/fp version that swaps the argument order.
  • Swapped npm-shrinkwrap.json for packages-lock.json since it was the last utility to still use it.

How to verify this change

  1. Checkout branch & run unit tests in logger to check that there are no regressions.
  2. Run npm pack
  3. Install the packed version in a clean project
  4. Run du -sh * to measure node_moduels size

(see screenshot below for steps 3 & 4)

Screenshot 2022-01-06 at 20 00 44

Related issues, RFCs

#419

PR status

Is this ready for review?: YES
Is it a breaking change?: NO

Checklist

Breaking change checklist

N/A


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dreamorosi dreamorosi self-assigned this Jan 6, 2022
@dreamorosi dreamorosi added dependencies Changes that touch dependencies, e.g. Dependabot, etc. logger This item relates to the Logger Utility labels Jan 6, 2022
@dreamorosi dreamorosi added this to the production-ready-release milestone Jan 6, 2022
@dreamorosi dreamorosi changed the title deps(logger): Reduce node_modules size build(logger): reduce node_modules size Jan 6, 2022
saragerion
saragerion previously approved these changes Jan 6, 2022
Copy link
Contributor

@saragerion saragerion left a comment

Choose a reason for hiding this comment

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

From 139M to 1.8M! Can't wait to have this one released 🚀

@flochaz
Copy link
Contributor

flochaz commented Jan 6, 2022 via email

@michaelbrewer
Copy link
Contributor

thanks @dreamorosi

@saragerion saragerion linked an issue Jan 6, 2022 that may be closed by this pull request
ijemmy
ijemmy previously approved these changes Jan 7, 2022
packages/logger/src/Logger.ts Show resolved Hide resolved
@dreamorosi dreamorosi dismissed stale reviews from ijemmy and saragerion via bdced91 January 7, 2022 13:26
@dreamorosi
Copy link
Contributor Author

Need to merge #440 before this can be merged, checks fail because of same linting issue.

@dreamorosi
Copy link
Contributor Author

Ready to be reviewed again, all checks passing now.

@dreamorosi dreamorosi merged commit 697a775 into main Jan 7, 2022
@dreamorosi dreamorosi deleted the deps/reduce_logger_size branch January 7, 2022 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes that touch dependencies, e.g. Dependabot, etc. logger This item relates to the Logger Utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: reduce npm_modules size
5 participants