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

Fix anchor links and add spinner to the benchmarks page #2205

Merged
merged 2 commits into from
Apr 25, 2019
Merged

Fix anchor links and add spinner to the benchmarks page #2205

merged 2 commits into from
Apr 25, 2019

Conversation

davidjamesstone
Copy link
Contributor

Issue: #2203

@davidjamesstone davidjamesstone changed the title Fix anchor links and add spinner Fix anchor links and add spinner to the benchmarks page Apr 25, 2019
@davidjamesstone
Copy link
Contributor Author

I fixed the recent data and all data links so they redraw the charts via onhashchange.
I initially tried to use a simple document.body.style.cursor = 'wait' toggle to indicate progress but it's buggy in several browsers. I opted for a simple CSS spinner instead.

A minor change was required to the app.js file to return a promise from the drawChartsFromBenchmarkData function, allowing us to know when the drawing was complete so we can hide the spinner.

@@ -153,10 +156,25 @@ <h3 id="syscalls">Syscall count <a href="#syscalls">#</a></h3>
<script type="module">
import { drawCharts } from "./app.js";
window.chartWidth = 800;
const busy = document.getElementById("busy")
Copy link
Member

Choose a reason for hiding this comment

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

I think we should name it more component-like way, like spinner-wrapper, spinner-overlay, or spinner-area

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure spinner-overlay sounds best to me.

}

function updateCharts () {
let u = window.location.hash.match("all") ? "./data.json" : "recent.json";
Copy link
Member

Choose a reason for hiding this comment

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

How about making u const?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree (I didn't add that line).

I see a lot of js code using let where const could (should ?) be used.

I always favour using const and rarely use let but others may disagree.

I'll make the change.

@kt3k
Copy link
Member

kt3k commented Apr 25, 2019

Can you add the gif of this change so that people can (easily) review it aesthetically?

@davidjamesstone
Copy link
Contributor Author

benchmark

The spinner looks choppier in this gif than it appears IRL but hopefully this gives you the idea

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

LGTM

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@ry ry merged commit 098d6ff into denoland:master Apr 25, 2019
@davidjamesstone
Copy link
Contributor Author

Thanks!

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.

3 participants