Skip to content

Don't use ES6 syntax in gulp task definitions#9107

Merged
jridgewell merged 3 commits intoampproject:masterfrom
rsimha:2017-05-02-FixVisualDiff
May 2, 2017
Merged

Don't use ES6 syntax in gulp task definitions#9107
jridgewell merged 3 commits intoampproject:masterfrom
rsimha:2017-05-02-FixVisualDiff

Conversation

@rsimha
Copy link
Copy Markdown
Contributor

@rsimha rsimha commented May 2, 2017

This PR fixes all instances of ES6 syntax in visual-diff.js.

FIxes #9106

@rsimha rsimha requested a review from jridgewell May 2, 2017 21:33
@rsimha rsimha self-assigned this May 2, 2017
@rsimha rsimha added this to the Sprint H1 May milestone May 2, 2017
@rsimha rsimha requested a review from taymonbeal May 2, 2017 21:35
Copy link
Copy Markdown
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

  • All the consts
  • String#includes on L58

var p =
child_process.spawnSync('/bin/sh', ['-c', cmd], {'stdio': 'inherit'});
if (p.status != 0) {
console/*OK*/.log(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No template strings in ES5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

var percyArgs = extractPercyArgs();
commandLine.push('--baseurl /' + percyArgs.webpage);
commandLine.push('--widths ' + percyArgs.widths);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No arrow functions in ES5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@rsimha
Copy link
Copy Markdown
Contributor Author

rsimha commented May 2, 2017

I tested my original PR by running "gulp test" before submitting it. Could this be a difference between running gulp test on macOS vs. Linux?

@taymonbeal
Copy link
Copy Markdown
Member

What version of Node are you running? (node -v)

@rsimha
Copy link
Copy Markdown
Contributor Author

rsimha commented May 2, 2017

I'm using node v7.9.0.

@taymonbeal
Copy link
Copy Markdown
Member

Ah, that version supports most of ES6. I'm using v4.8.3, which, according to package.json, is the version that AMP officially supports. Should we consider just bumping the required Node version and then use ES6 freely in Node scripts?

@taymonbeal
Copy link
Copy Markdown
Member

Also, I observe that Travis is configured to run against the latest stable release.

@rsimha
Copy link
Copy Markdown
Contributor Author

rsimha commented May 2, 2017

Yes. I noticed that there is ES6 syntax in other js files in build-system. There certainly is ES6 code in pr-check.js, which runs against every PR. I'll keep this in mind for later. Meanwhile, I still think there's value in checking in the changes in this PR, since others on the team are likely to run into what you just saw.

I've pushed a new commit with (hopefully) all the changes you requested.

@rsimha
Copy link
Copy Markdown
Contributor Author

rsimha commented May 2, 2017

@jridgewell or @taymonbeal, could one of you merge this PR? (I don't have permissions yet.)

@jridgewell jridgewell merged commit 36cd5a6 into ampproject:master May 2, 2017
@rsimha rsimha deleted the 2017-05-02-FixVisualDiff branch May 2, 2017 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gulp test fails without running any tests

5 participants