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

Support YUI compressor. #6

Open
grssam opened this issue Jul 29, 2013 · 11 comments
Open

Support YUI compressor. #6

grssam opened this issue Jul 29, 2013 · 11 comments

Comments

@grssam
Copy link
Contributor

grssam commented Jul 29, 2013

It would be really nice if YUI compression worked on aulx.js and aulx-ui.js . Right now, it just gives errors and produces half-compressed code.

@espadrine
Copy link
Owner

What kind of compression fails? It isn't a linter, right? The JS code is valid JS, right? What kind of errors do we get?

@grssam
Copy link
Contributor Author

grssam commented Jul 31, 2013

They are all syntax errors. I did not look at them into detail yet. You can try it out at http://refresh-sf.com/yui/ .

@espadrine
Copy link
Owner

A quick look gives me intuition that YUI compressor fails to parse ES5. It can only parse ES3. Indeed, it seems to forbid the delete keyword as an object literal key. ES5 specifically permits an IdentifierName there, not an Identifier, which would forbid keywords.

@grssam
Copy link
Contributor Author

grssam commented Jul 31, 2013

Hrmm. Weird . I have minified so much code via YUI and never had an issue. I don;t think that YUI cannot parse ES5. Infact the yui compressor code itself uses delete everywhere in the code : https://github.com/yui/yuicompressor/blob/master/nodejs/index.js

@espadrine
Copy link
Owner

You misunderstand me. The following is valid ES5 and invalid ES3.

var foo = {
  delete: "something",
  get 0() { return 'zero'; }
};

@grssam
Copy link
Contributor Author

grssam commented Jul 31, 2013

Ah.. Shall we open an issue in their github repo ?

@espadrine
Copy link
Owner

You may! Point to this bug if you want.

(I know little of their project goals for YUI compressor; maybe ES5 is simply out of scope for them.)

@grssam
Copy link
Contributor Author

grssam commented Aug 1, 2013

See the conversation at yui/yuicompressor#98

Basically its because of Rhino,

@espadrine
Copy link
Owner

I feel like changing the code for a tangential project which acknowledges that it is lacking is wrong. May I consider this issue closed?

@grssam
Copy link
Contributor Author

grssam commented Aug 1, 2013

How much change in our code are we talking ? If it is simply adding quotes around certain keywords, then why not go ahead and do it ?

PS: come online on IRC man!

@espadrine
Copy link
Owner

Why not simply use a better minifier, instead of changing the project to fit through a specific incorrect minifier?

PS: I'm just back, I'm getting set up again.

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

No branches or pull requests

2 participants