Allow ES6 features in Treeherder

RESOLVED FIXED

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: wlach, Assigned: wlach)

Tracking

Details

Attachments

(2 attachments)

Somewhat inspired by :jgraham's post to m.tools.treeherder, I decided to use the ES6 arrow function for some frontend work in bug 1258861. Unfortunately this currently breaks our linter, but that's easy enough to fix.
Created attachment 8784388 [details] [review]
[treeherder] wlach:1297722 > mozilla:master
Attachment #8784388 - Flags: review?(emorley)
Attachment #8784388 - Flags: review?(emorley) → review+
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
So I found out this wasn't enough to enable ES6 features in Treeherder, since the grunt build step was failing. I'm going to morph this bug into a more general attempt at making this work: looks like the easiest route is to babelify our ES6 sources back down to ES5, since uglify doesn't yet support ES6 (https://github.com/mishoo/UglifyJS2/issues/659).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: Allow ES6 features to pass eslint → Allow ES6 features in Treeherder
Created attachment 8784481 [details] [review]
Takd 2

Sadly just changing the eslint parameters wasn't enough and we need a babel step to transpile the source back to ES5.
Attachment #8784481 - Flags: review?(emorley)
Attachment #8784481 - Flags: review?(emorley) → review+

Comment 5

2 years ago
Commits pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/83b079c682a7b1cb1c310f393c0ec0912227789a
Bug 1297722 - Use babel to transpile es6 code to es5

The uglify step of the grunt build won't work otherwise. Not crazy about the
way I did this, but I couldn't find any better way offhand.

https://github.com/mozilla/treeherder/commit/9d170609deca2ee5f7d108f1ebb74dadccf5e86a
Bug 1297722 - Use the ES6 '=>' operator to make sure transpiling works

https://github.com/mozilla/treeherder/commit/0f936eb7e132f269079381871e502fe5c3f232c9
Merge pull request #1807 from wlach/1297722-2

Bug 1297722 - Fix ES6 use in production
I think we can call this done now, let's see where uglify is with es6 support in a few months, maybe we can remove the babel workaround then.
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED

Comment 7

2 years ago
Commits pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/b35fb496a9ad9130a74140357ffb02dae7c9dad7
Bug 1297722 - Use babel to transpile es6 code to es5

The uglify step of the grunt build won't work otherwise. Not crazy about the
way I did this, but I couldn't find any better way offhand.

https://github.com/mozilla/treeherder/commit/95c1c06c70e3a4d30f0b47912f66f034e36f2c40
Bug 1297722 - Use the ES6 '=>' operator to make sure transpiling works
Some issues with angular clipboard and babel, filed bug 1297722 to track that.
You need to log in before you can comment on or make changes to this bug.