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

consolidate global and require() usages #569

Merged
merged 3 commits into from Mar 25, 2016
Merged

consolidate global and require() usages #569

merged 3 commits into from Mar 25, 2016

Conversation

alexlamsl
Copy link
Collaborator

Hopefully this will keep the source code clean from multiple module import paths, and makes it more readable plus happy with things like webpack etc.

@alexlamsl
Copy link
Collaborator Author

It's commit like this where I wish Github provides a diff mode that ignore whitespace changes... 😅

@alexlamsl
Copy link
Collaborator Author

So this will hopefully solve #568 and more - @oliviertassinari if you can verify this that would be helpful!

And we can actually review the diff with whitespace changes ignored 👏

@@ -1,6 +1,6 @@
(function() {
'use strict';
'use strict';
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a browser file and strict is fine in the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

strict rule from eslint complaints - do you want me to add /* eslint-disable */ instead?

@alexlamsl
Copy link
Collaborator Author

@XhmikosR both comments addressed, PR rebased

@alexlamsl alexlamsl mentioned this pull request Mar 22, 2016
@@ -1,5 +1,8 @@
{
"env": {
"browser": true
},
"rules": {
"strict": "off"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you just tried setting node to false without turning off strict?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No dice 😕

{
  "env": {
    "browser": true,
    "node": false
  }
}

gives

  114:2   error  Use the function form of 'use strict'  strict

Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird, I'd expect it to handle the browser case. How about strict: [2, "function"]? Can you test if it works OK for both cases? Otherwise there is the safe option too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's more to do with the Google Analytics code at the bottom of the script?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If that's the case please just add eslint ignore around the snippet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"node": false would mean I need to add /* global: require */ as well - but okay, I'll get them 😅

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then keep node...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright:

  • keep node: true
  • change to strict: [2, "function"]
  • add /* eslint-disable */ before GA

Sounds about right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@alexlamsl
Copy link
Collaborator Author

@XhmikosR amended last commit to adjust eslint rules

merge browserify tasks into one single pass for online package generation
fixes #295
@alexlamsl
Copy link
Collaborator Author

Editted commit message to close relevant issue.

@XhmikosR
Copy link
Collaborator

Ship it.
On Mar 24, 2016 16:51, "Alex Lam S.L." notifications@github.com wrote:

Editted commit message to close relevant issue.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#569 (comment)

@genintho
Copy link
Contributor

@alexlamsl

It's commit like this where I wish Github provides a diff mode that ignore whitespace changes... 😅

https://github.com/kangax/html-minifier/pull/569/files?w=1

Sadly you can not comment in this mode.

@kangax
Copy link
Owner

kangax commented Mar 24, 2016

Long time coming and is much needed by now! :)

@kangax
Copy link
Owner

kangax commented Mar 24, 2016

Next step — ES6 via babel :)

@XhmikosR
Copy link
Collaborator

Will you make the switch? :)

BTW I'm thinking we might need to find another parser.
On Mar 24, 2016 23:58, "Juriy Zaytsev" notifications@github.com wrote:

Next step — ES6 via babel :)


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#569 (comment)

@alexlamsl
Copy link
Collaborator Author

@genintho yeah, thanks for the tip 😉

@kangax is that the same babel that broke and went onto the news a few days back?

@XhmikosR thanks for the review! To switch HTML parser we'll need to decouple the logical dependencies first, but it's something to think about nonetheless.

@alexlamsl alexlamsl merged commit 4a0ea14 into kangax:gh-pages Mar 25, 2016
@alexlamsl alexlamsl deleted the require branch March 25, 2016 07:34
@alexlamsl alexlamsl mentioned this pull request Mar 25, 2016
@kangax
Copy link
Owner

kangax commented Mar 28, 2016

@kangax is that the same babel that broke and went onto the news a few days back?

Nope, nothing to do with Babel. Babel broke because the author of one of the (npm) dependencies pulled them out.

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.

None yet

4 participants