Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Split polyfill #617

wants to merge 3 commits into


None yet
2 participants

shalecraig commented Oct 17, 2012

I modified String.prototype.trim to a smaller version, which is attributed to MDN.

Before my revision we were at:

Minified: 24.916k
Minified and gzipped: 9.080k, compression factor 5.599

Now, we're at:

Minified: 24.897k
Minified and gzipped: 9.080k, compression factor 5.608

I'm not sure how to remove commit 4c557d1, but it's already been merged.

shalecraig added some commits Oct 5, 2012

Commit to reduce the size of Zepto.
Now using the official MDN String.prototype.trim polyfill, as
opposed to our own home-baked one.

The Uglifyjs compiler doesn't make this optimization, but Google's
Closure uses inferred types to make "safe" changes like this:

if (x === undefined) {
    x = foo();


x = x || foo();

UglifyJS doesn't make these changes. We might want to consider
moving to Closure compiler, if our aim is to produce the smallest js

@madrobby madrobby closed this in 3771d17 Mar 3, 2013

lopper added a commit to buddydvd/zepto that referenced this pull request Apr 24, 2013

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