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

Customizer: switch to UglifyJS2 #13151

Merged
merged 4 commits into from Apr 20, 2014
Merged

Customizer: switch to UglifyJS2 #13151

merged 4 commits into from Apr 20, 2014

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR added this to the v3.2.0 milestone Mar 23, 2014
@@ -264,9 +264,23 @@ window.onload = function () { // wait for load in a dumb way because B-0
.toArray()
.join('\n')

var uglify = this.UglifyJS
Copy link
Collaborator

Choose a reason for hiding this comment

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

Extract this code into a new function perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

@cvrebert: check the refactor patch. If that's ok with you, I'll squash those two.

@XhmikosR XhmikosR changed the title Customizer: switch to UglifyJS2 (v2.4.13). Customizer: switch to UglifyJS2 Mar 23, 2014
@XhmikosR
Copy link
Member Author

Only issue I see from this, is making debugging harder, even with sourcemaps. For some reason, including the new uglify.min.js pollutes customize.min.js. One workaround would be to include uglify.min.js separately again.

@XhmikosR
Copy link
Member Author

Any thoughts about this? Should I go with the separate include approach?

To reproduce the issue, try to debug with the first patch only.

@cvrebert
Copy link
Collaborator

How's this make debugging harder exactly?

@XhmikosR
Copy link
Member Author

Here is what I get without the last patch; that code is from uglify.
2014-03-28_08-47-50

@XhmikosR
Copy link
Member Author

Apparently it's FF to blame for this; Chrome works as usual.

So, I skipped the last patch and this should be ready to merge.

@@ -11,7 +11,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
' * Bootstrap v3.1.1 (http://getbootstrap.com)\n' +
' * Copyright 2011-2014 Twitter, Inc.\n' +
' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
' */\n\n'
' */\n'
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, you can check the generated minified file; there's no reason for 2 newlines after the license header.

Copy link
Member Author

Choose a reason for hiding this comment

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

On a side note, shouldn't we have the jquery check there too like in dist files?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair enough.
And yes, we ought to...

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Let me know if there's something else.

@cvrebert
Copy link
Collaborator

Looks good otherwise.

@XhmikosR
Copy link
Member Author

I think we should have the license header and the jquery check in one place and use it in Grunt instead of duplicating those. @cvrebert feel free to take care of that after this is merged :)

Otherwise, now customizer's minified build should be identical to the dist builds.

@XhmikosR XhmikosR added the js label Mar 28, 2014
@XhmikosR
Copy link
Member Author

Added the license header to the non minified build too.

@XhmikosR
Copy link
Member Author

Finalized the branch. @cvrebert: thoughts about the license header and stuff?

@cvrebert
Copy link
Collaborator

I don't have any particularly good ideas on how to avoid that duplication. It's not that much text anyway, so I personally don't have a problem with just living with the duplication.

@XhmikosR
Copy link
Member Author

I was just asking if you agreed with the text order :P

The duplication is another thing that could be a problem when bumping the copyright year or changing the license text etc. But that's for another day :)

@cvrebert
Copy link
Collaborator

I don't really care about the order, personally. @mdo Any preference?

@XhmikosR XhmikosR self-assigned this Mar 29, 2014
@mdo
Copy link
Member

mdo commented Apr 2, 2014

Order?

@XhmikosR
Copy link
Member Author

XhmikosR commented Apr 2, 2014

/* license header */
/* customizer's text */

Check out this branch, jekyll serve and get a build from the customizer to see what we are talking about :)

@XhmikosR
Copy link
Member Author

XhmikosR commented Apr 8, 2014

@cvrebert: I think I'm gonna merge this...

For the license, what do you think about combining the customizer gist text into the same comment as the license? Just using 2 new lines.

@XhmikosR
Copy link
Member Author

@cvrebert: any final thoughts about the above comment?

@cvrebert
Copy link
Collaborator

@XhmikosR Whatever you prefer is fine.

XhmikosR added a commit that referenced this pull request Apr 20, 2014
@XhmikosR XhmikosR merged commit e0c3ae6 into master Apr 20, 2014
@XhmikosR XhmikosR deleted the customizer-uglifyjs2 branch April 20, 2014 22:35
@XhmikosR
Copy link
Member Author

I guess we can change that later then.

@mdo mdo mentioned this pull request Apr 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants