-
Notifications
You must be signed in to change notification settings - Fork 46
Prototype for viewing a diff on wpt.fyi #310
Prototype for viewing a diff on wpt.fyi #310
Conversation
Considerations:
|
@lukebjerring ping for rebase—thanks! |
@rwaldron sync'd. |
@lukebjerring Github is still reporting that there are conflicts, which I can confirm by pulling this locally. Can you run this in your local branch:
Resolve the conflicts, commit, then...
|
Not sure what you're seeing, but I see:
|
I just nuked everything local and started fresh and now I cannot reproduce this conflict that Github claims, so we're back on track. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing the following warning in the console:
property-accessors.html:341 Polymer::Attributes: couldn't decode Array as JSON:
_deserializeValue @ property-accessors.html:341
And the following Uncaught exception:
Uncaught (in promise) TypeError: Cannot read property 'map' of null
test-file-results.html:107
Is this display intentional?
components/runs.html
Outdated
@@ -41,7 +41,7 @@ | |||
async connectedCallback () { | |||
super.connectedCallback() | |||
|
|||
if (!this.testRuns) { | |||
if (this.testRunResources) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand this change—I don't see any other changes that involve this.testRunResources
. Any details would be appreciated 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestRun is an array of the JSON objects, which can be passed in directly. TestRunResources are URLs to fetch the JSON objects. This PR uses both (the TestRun for the diff is passed as a JSON object).
This will probably change anyway, since the single-result view 'diff' isn't needed, so will probably keep 'diff' as a separate property on the Polymer element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the details!
components/runs.html
Outdated
@@ -57,7 +57,7 @@ | |||
.reduce((sum, item) => { | |||
return Array.isArray(item) ? sum.concat(item) : [...sum, item] | |||
}, []) | |||
this.testRuns = flattened | |||
this.testRuns = this.testRuns ? [...flattened, ...this.testRuns] : flattened |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.testRuns = flattened.concat(this.testRuns || [])
wdyt?
components/wpt-results.html
Outdated
@@ -364,6 +364,14 @@ | |||
: '&' | |||
path += 'sha=' + this.sha | |||
} | |||
var diffRuns = this.testRuns.filter(r => r['revision'] == 'diff') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use MemberExpression.IdentifierName: r.revision == 'diff'
components/wpt-results.html
Outdated
? '?' | ||
: '&' | ||
path += 'before=' + this.testRuns[0]['browser_name'] + '@' + this.testRuns[0]['revision'] | ||
path += '&after=' + this.testRuns[1]['browser_name'] + '@' + this.testRuns[1]['revision'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- use destructuring to unpack
this.testRuns[0]
andthis.testRuns[1]
:let [before, after] = this.testRuns;
- use MemberExpression.IdentifierName (for all cases here and throughout):
before.browser_name
,before.revision
,after.browser_name
&after.revision
- use template string:
path += `before=${before.browser_name}@${before.revision}`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL about unpack.
Looks like the doubling-up of runs is a bug on single test-files, will fix along with other issues. |
I'm not seeing this on master—where are you seeing it? |
Sorry, edited comment to clarify what I meant.
…On Mon, 4 Dec 2017 at 14:13 Rick Waldron ***@***.***> wrote:
doubling-up of runs is already a bug
I'm not seeing this on master—where are you seeing it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#310 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAve5Ji7XC3fZFJqYztOPxYm_Yeuyp8Dks5s9EROgaJpZM4Qtzme>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last minor change needed and this can be merged (feel free to merge once you make the change)
components/runs.html
Outdated
@@ -41,7 +41,7 @@ | |||
async connectedCallback () { | |||
super.connectedCallback() | |||
|
|||
if (!this.testRuns) { | |||
if (this.testRunResources) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the details!
@@ -144,6 +145,9 @@ | |||
} | |||
|
|||
resultsURL (testRun, testFile) { | |||
if (testRun.revision == 'diff') { | |||
return testRun.results_url + '&path=' + encodeURI(testFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed a template string update here.
components/wpt-results.html
Outdated
path += '&after=' + this.testRuns[1]['browser_name'] + '@' + this.testRuns[1]['revision'] | ||
let [before, after] = this.testRuns | ||
path += `before=${before.browser_name}@${before.revision}` | ||
path += `&after=${after.browser_name}@${after.revision}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
Add-on for #301
Running at https://diff-visualizer-dot-wptdashboard.appspot.com
Example:
https://diff-visualizer-dot-wptdashboard.appspot.com/?before=edge@1db039e5b6&after=edge