Skip to content

Remove lodash and use our own utils #535

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

Merged
merged 7 commits into from
Mar 12, 2018
Merged

Conversation

itsmichaeldiego
Copy link
Member

@itsmichaeldiego itsmichaeldiego commented Mar 12, 2018

This PR is just one proposal to use specific packages from lodash instead of importing the whole library.

I came across with the problem that we tried to remove lodash here: 670fadd#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R72 but we actually moved to devDependencies.

But accidentally, because it was there, @ZAKdev used fp from lodash, as it was still in the devdependencies, in #441.

After that, I also used isEmpty from lodash in #533

This increased the build size to 797kb standard and 201kb minified.

This PR decreases it to 140kb and 47.5kb minified.

Output: Size decreased by almost 4 times.

Prev:

screen shot 2018-03-11 at 2 00 52 pm

Now:

screen shot 2018-03-11 at 7 43 57 pm

@itsmichaeldiego itsmichaeldiego changed the title Remove lodash use our Remove lodash use our own libraries Mar 12, 2018
@itsmichaeldiego
Copy link
Member Author

itsmichaeldiego commented Mar 12, 2018

@ZAKdev Let me know if this change works with your heatmaps. I would really prefer you to make a PR on its own but I can go either way.

@itsmichaeldiego itsmichaeldiego changed the title Remove lodash use our own libraries Remove lodash and use our own libraries Mar 12, 2018
@itsmichaeldiego itsmichaeldiego changed the title Remove lodash and use our own libraries Remove lodash and use our own utils Mar 12, 2018
option => instance.set(option, options[option]),
Object.keys(options || {})
);
Object.keys(options).map(option => instance.set(option, options[option]));
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know why but i am not able to run entire project, so everything looks good to me just map over an empty object as well if there is no options, like below.

Object.keys(options || {}).map(option => instance.set(option, options[option]));

Copy link
Member Author

Choose a reason for hiding this comment

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

@ZAKdev Done, instead of doing what you said I've set a default value for the parameter. LMK How that works. I am merging this as for now.

@ZAKdev
Copy link
Contributor

ZAKdev commented Mar 12, 2018

This is what i am getting from every branch.

screen shot 2018-03-12 at 19 35 13

@itsmichaeldiego
Copy link
Member Author

@ZAKdev Fixed this in #537, you should be looking good now, please start from latest master

@itsmichaeldiego itsmichaeldiego merged commit 8cb6939 into master Mar 12, 2018
@itsmichaeldiego itsmichaeldiego deleted the remove-lodash-use-our branch March 12, 2018 22:56
@ZAKdev
Copy link
Contributor

ZAKdev commented Apr 15, 2018

@itsmichaeldiego, i can't push any of my code, seems like not having access.

@itsmichaeldiego
Copy link
Member Author

@ZAKdev sorry, push to where?

@ZAKdev
Copy link
Contributor

ZAKdev commented Apr 17, 2018

@itsmichaeldiego, i added weight in my heapmap implementation but i am not able to push my code to this repo.

Do we have any slack channel where we can comminicate or via email, here is my email zainahmedkhan@gmail.com

@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants