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

[DO NOT MERGE] Experiment: Use cherry picked lodash modules #379

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@balloob
Contributor

balloob commented Mar 30, 2017

So as a quick experiment to see if I could reduce the bundle size even more, I tried to replace the lodash dependencies with cherry picked functions from the lodash lib. The idea was that we would be able to dedupe overlapping code between the individual lodash packages.

Result: did not reduce bundle size.

Leaving PR here so people can learn from the results.

It is caused because Rollup can't 100% decide if some code is side-effect free. It will caution on the safe side and end up including more then is needed. See Rollup wiki

Type Size
Current (function per package) 111kB
Import from lodash/func-name 127kB
Import named from lodash-es/func-name 124kB
Import named from lodash Forgot, but was > 200kB

screen shot 2017-03-30 at 2 26 48 pm

Paulus Schoutsen

@balloob balloob closed this Mar 30, 2017

@TheSharpieOne

This comment has been minimized.

Show comment
Hide comment
@TheSharpieOne

TheSharpieOne Mar 30, 2017

Member

Funny, I was noticing that and was thinking the same thing. At my job we recently did the same thing... with the help of babel-plugin-lodash though I am honest surprised that "Import named from lodash-es/func-name" did not make it smaller.

Member

TheSharpieOne commented Mar 30, 2017

Funny, I was noticing that and was thinking the same thing. At my job we recently did the same thing... with the help of babel-plugin-lodash though I am honest surprised that "Import named from lodash-es/func-name" did not make it smaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment