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

Update prettier, change print width to 120, and enable dangling commas for functions #371

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"arrowParens": "always",
Copy link
Member

Choose a reason for hiding this comment

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

Why are we making all these other changes to prettier?

Copy link
Contributor Author

@julienw julienw Nov 6, 2024

Choose a reason for hiding this comment

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

You can find out more if you look at the individual commits, as there's one commit for each logical change.

In short a lot of them are the defaults (see 3rd commit), except printWidth and trailingComma which are the changes by this PR.

Changing trailingComma is beneficial because it makes better diffs: with the old style, there's no trailing comma, and therefore when function parameters or array properties or object properties are added or removed, the previous line also shows up in a diff. If it has a trailing comma, then it isn't changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not removing the default ones would make this PR easier to review/less scary

"bracketSameLine": false,
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"printWidth": 250,
"semi": true,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": false
"printWidth": 120,
"tabWidth": 4
}
2 changes: 1 addition & 1 deletion InteractiveRunner.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Expand Down
193 changes: 155 additions & 38 deletions about.html

Large diffs are not rendered by default.

41 changes: 32 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html data-visible-section="home">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Expand All @@ -16,10 +16,15 @@
<div class="version">3.0</div>
</a>
<div class="content">
<p>Speedometer is a browser benchmark that measures the responsiveness of Web applications. It uses demo web applications to simulate user actions such as adding to-do items.</p>
<p>
Speedometer is a browser benchmark that measures the responsiveness of Web applications. It uses
demo web applications to simulate user actions such as adding to-do items.
</p>
<p id="screen-size-warning">
<strong>
Your browser window is too small. For most accurate results, please make the view port size at least <span id="min-screen-width">850px</span> by <span id="min-screen-height">650px</span>.<br />
Your browser window is too small. For most accurate results, please make the view port size
at least <span id="min-screen-width">850px</span> by
<span id="min-screen-height">650px</span>.<br />
It's currently <span id="screen-size"></span>.
</strong>
</p>
Expand Down Expand Up @@ -64,7 +69,9 @@ <h1>Score</h1>
<div id="confidence-number"></div>
<div class="buttons">
<div class="button-row">
<a class="button" href="#details" id="show-details" title="Show detailed results data.">Details</a>
<a class="button" href="#details" id="show-details" title="Show detailed results data."
>Details</a
>
</div>
</div>
</section>
Expand All @@ -89,13 +96,29 @@ <h2>Test Metrics Details</h2>
</div>
<div class="buttons section-footer">
<div class="button-row">
<a class="button" href="#summary" title="Go back to the simplified summary view.">Summary</a>
<a class="button" href="#summary" title="Go back to the simplified summary view."
>Summary</a
>
</div>
<div class="button-row export-buttons">
<button id="copy-full-json" title="Copy full result metrics as json string.">Copy JSON</button>
<a class="button" id="download-full-json" title="Download full result metrics as json string.">Download JSON</a>
<a class="button" id="download-classic-json" title="Download backwards-compatible result metrics as json string.">Download Classic JSON</a>
<a class="button" id="download-csv" title="Download all result metrics as CSV string.">Download CSV</a>
<button id="copy-full-json" title="Copy full result metrics as json string.">
Copy JSON
</button>
<a
class="button"
id="download-full-json"
title="Download full result metrics as json string."
>Download JSON</a
>
<a
class="button"
id="download-classic-json"
title="Download backwards-compatible result metrics as json string."
>Download Classic JSON</a
>
<a class="button" id="download-csv" title="Download all result metrics as CSV string."
>Download CSV</a
>
<button id="copy-csv" title="Copy all result metrics as CSV string.">Copy CSV</button>
</div>
</div>
Expand Down
17 changes: 13 additions & 4 deletions instructions.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
Copy link
Member

Choose a reason for hiding this comment

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

What's up with these DOCTYPE change? These don't seem desirable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comes from the prettier update to v3 (see https://prettier.io/blog/2023/07/05/3.0.0.html#html). There's also no option to disable this behavior.

The doctype is case insensitive so IMO it's not important. I'm glad somebody else has an opinion about it so that I don't need to have one.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Expand All @@ -18,13 +18,22 @@
<div class="section-grid">
<h1 class="section-header">Speedometer 3 General Instructions</h1>
<div class="section-content">
<p>To get reasonably accurate results your device and browser need to be focused on the benchmark. Here are some basic instructions to allow that:</p>
<p>
To get reasonably accurate results your device and browser need to be focused on the
benchmark. Here are some basic instructions to allow that:
</p>
<ul class="compact">
<li>Ensure you are running the latest stable browser version.</li>
<li>Prefer using a separate clean browser profile — extensions and non-default browser settings can have a large impact on the score.</li>
<li>
Prefer using a separate clean browser profile — extensions and non-default browser
settings can have a large impact on the score.
</li>
<li>Don't run any programs in the background.</li>
<li>Restart the browser and close all other tabs and windows.</li>
<li>Keep the Speedometer page focused and do not interact with the device while running the benchmark.</li>
<li>
Keep the Speedometer page focused and do not interact with the device while running the
benchmark.
</li>
<li>Keep your battery-powered device plugged into a charger.</li>
<li>Some devices might need time to cool down between consecutive runs.</li>
</ul>
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"@babel/core": "^7.21.3",
"@babel/eslint-parser": "^7.21.3",
"@babel/plugin-proposal-decorators": "^7.21.0",
"@nuxt/eslint-config": "^0.1.1",
"@next/eslint-plugin-next": "^13.4.5",
"@nuxt/eslint-config": "^0.1.1",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"command-line-args": "^5.2.1",
Expand All @@ -44,7 +44,7 @@
"expect.js": "^0.3.1",
"http-server": "^14.1.1",
"mocha": "^10.2.0",
"prettier": "^2.8.3",
"prettier": "^3.3.1",
"selenium-webdriver": "^4.8.0",
"sinon": "^17.0.1",
"typescript": "^5.0.4"
Expand Down
2 changes: 1 addition & 1 deletion resources/charts/chartjs.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
11 changes: 8 additions & 3 deletions resources/charts/developer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -17,9 +17,14 @@
<body>
<div id="app">
<h1>Demo page (not intended for workload)</h1>
<p>This page shows the various workloads to help with local development. The runner should open only one of them.</p>
<p>
This page shows the various workloads to help with local development. The runner should open only one of
them.
</p>
<details open>
<summary><strong>Observable Plot</strong> (<a href="./observable-plot.html">open in full page</a>)</summary>
<summary>
<strong>Observable Plot</strong> (<a href="./observable-plot.html">open in full page</a>)
</summary>
<iframe src="./observable-plot.html"></iframe>
</details>
<details open>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/charts/dist/chartjs.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
11 changes: 8 additions & 3 deletions resources/charts/dist/developer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -17,9 +17,14 @@
<body>
<div id="app">
<h1>Demo page (not intended for workload)</h1>
<p>This page shows the various workloads to help with local development. The runner should open only one of them.</p>
<p>
This page shows the various workloads to help with local development. The runner should open only one of
them.
</p>
<details open>
<summary><strong>Observable Plot</strong> (<a href="./observable-plot.html">open in full page</a>)</summary>
<summary>
<strong>Observable Plot</strong> (<a href="./observable-plot.html">open in full page</a>)
</summary>
<iframe src="./observable-plot.html"></iframe>
</details>
<details open>
Expand Down
6 changes: 4 additions & 2 deletions resources/charts/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand All @@ -10,6 +10,8 @@ <h1>Charting workloads</h1>
<li><a href="./observable-plot.html">Observable Plot</a></li>
<li><a href="./chartjs.html">Chart.js</a></li>
</ul>
<p>You can also find the <a href="./developer.html">developer page</a> that includes all workloads in iframes.</p>
<p>
You can also find the <a href="./developer.html">developer page</a> that includes all workloads in iframes.
</p>
</body>
</html>
4 changes: 2 additions & 2 deletions resources/charts/dist/observable-plot.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -15,7 +15,7 @@
min-width: 30px;
}
</style>
<script type="module" crossorigin src="./assets/plot-562fbdb6.js"></script>
<script type="module" crossorigin src="./assets/plot-c239951a.js"></script>
<link rel="modulepreload" crossorigin href="./assets/flights-airports-9a9e6422.js">
</head>
<body>
Expand Down
6 changes: 4 additions & 2 deletions resources/charts/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand All @@ -10,6 +10,8 @@ <h1>Charting workloads</h1>
<li><a href="./observable-plot.html">Observable Plot</a></li>
<li><a href="./chartjs.html">Chart.js</a></li>
</ul>
<p>You can also find the <a href="./developer.html">developer page</a> that includes all workloads in iframes.</p>
<p>
You can also find the <a href="./developer.html">developer page</a> that includes all workloads in iframes.
</p>
</body>
</html>
2 changes: 1 addition & 1 deletion resources/charts/observable-plot.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
13 changes: 10 additions & 3 deletions resources/charts/observable-plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ function addStackedBars() {
x: "state",
y: "total",
fill: "index",
title: (d) => `${d.iata === "Other" ? "Other" : `${d.name}, ${d.city} (${d.iata})`}\n${d3Format(",")(d.total)} flights`,
title: (d) =>
`${d.iata === "Other" ? "Other" : `${d.name}, ${d.city} (${d.iata})`}\n${d3Format(",")(d.total)} flights`,
}),
Plot.text(preparedData.stateInformationSortedArray, {
x: "state",
y: "total",
text: (d) => d3Format(".2~s")(d.total),
dy: -10,
}),
Plot.text(preparedData.stateInformationSortedArray, { x: "state", y: "total", text: (d) => d3Format(".2~s")(d.total), dy: -10 }),
Plot.ruleY([0]),
],
};
Expand Down Expand Up @@ -183,7 +189,8 @@ function addDottedBars() {
r: 4,
stroke: "value",
strokeWidth: 3,
title: (d) => `${d.iata === "Other" ? "Other" : `${d.name}, ${d.city} (${d.iata})`}\n${d3Format(",")(Math.abs(d.value))} ${d.value > 0 ? "inward" : "outward"} flights`,
title: (d) =>
`${d.iata === "Other" ? "Other" : `${d.name}, ${d.city} (${d.iata})`}\n${d3Format(",")(Math.abs(d.value))} ${d.value > 0 ? "inward" : "outward"} flights`,
}),
Plot.ruleY([0]),
],
Expand Down
Loading
Loading