Skip to content

Update dependencies; fix uglify options from recent update#3710

Closed
timmywil wants to merge 2 commits intojquery:masterfrom
timmywil:compression
Closed

Update dependencies; fix uglify options from recent update#3710
timmywil wants to merge 2 commits intojquery:masterfrom
timmywil:compression

Conversation

@timmywil
Copy link
Member

@timmywil timmywil commented Jul 3, 2017

Summary

  • Updates sinon and husky patch versions
  • Fixes uglify options for recent update

Uglify transforms typeof statements, causing elem.getAttribute to invoke the method despite the lack of parens (the reason we do typeof in the first place). I opened a ticket on uglify-js, as I didn't think this transformation should occur unless unsafe is set to true. The resolution turned out better than I expected. Uglify added a new compress option: typeofs that disables only this transformation. The result? -16 bytes to -79 bytes (gzipped).

Checklist

@mention-bot
Copy link

@timmywil, thanks for your PR! By analyzing the history of the files in this pull request, we identified @gibson042, @mgol and @markelog to be potential reviewers.

options: {
preserveComments: false,
sourceMap: true,
ASCIIOnly: true,
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

This option was removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or rather, replaced and taken care of by output.ascii_only.

Gruntfile.js Outdated
preserveComments: false,
sourceMap: true,
ASCIIOnly: true,
ie8: true,
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment explaining why that's needed with a link to the UglifyJS bug (and maybe a support comment for IE<11)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

Gruntfile.js Outdated
sourceMap: true,
ASCIIOnly: true,

// Support: IE<11
Copy link
Member

Choose a reason for hiding this comment

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

There should be a space before <. Otherwise looks good.

- Uses new typeofs option for compression
- See mishoo/UglifyJS#2198

Close jquerygh-3710
@timmywil timmywil closed this in 0bf499c Jul 10, 2017
@timmywil timmywil deleted the compression branch July 10, 2017 15:54
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants