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

Save over 500KB with one weird trick #1561

Merged
merged 1 commit into from
Mar 27, 2019
Merged

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Mar 26, 2019

This PR cuts more than half a megabyte from any app that uses mirage.

The problem is that:

import _ from 'lodash';
let item = _(value);

needs to put methods on item for every possible thing lodash supports. Most of which aren't needed.

This isn't one of the cases where a more aggressive module bundler could try to optimize them out. This style really just can't be statically optimized. It's a pity, because the chaining style is easier to read IMO.

@samselikoff
Copy link
Collaborator

boss.

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.

2 participants