From 931024689e2fcd06abc8f3294038464344375d4f Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Apr 2024 10:10:55 +0800 Subject: [PATCH 1/9] Parcel frontend starts from html instead of Vue --- site/frontend/package.json | 30 +++++++++---------- .../pages => src/templates}/bootstrap.html | 4 +-- .../pages => src/templates}/compare.html | 6 ++-- .../pages => src/templates}/dashboard.html | 4 +-- .../templates}/detailed-query.html | 2 +- .../pages => src/templates}/graphs.html | 6 ++-- .../pages => src/templates}/help.html | 0 site/frontend/{ => src}/templates/layout.html | 10 +++---- .../pages => src/templates}/status.html | 4 +-- 9 files changed, 34 insertions(+), 32 deletions(-) rename site/frontend/{templates/pages => src/templates}/bootstrap.html (86%) rename site/frontend/{templates/pages => src/templates}/compare.html (84%) rename site/frontend/{templates/pages => src/templates}/dashboard.html (94%) rename site/frontend/{templates/pages => src/templates}/detailed-query.html (97%) rename site/frontend/{templates/pages => src/templates}/graphs.html (81%) rename site/frontend/{templates/pages => src/templates}/help.html (100%) rename site/frontend/{ => src}/templates/layout.html (63%) rename site/frontend/{templates/pages => src/templates}/status.html (53%) diff --git a/site/frontend/package.json b/site/frontend/package.json index a6e54552e..8272ca624 100644 --- a/site/frontend/package.json +++ b/site/frontend/package.json @@ -30,32 +30,32 @@ }, "targets": { "dashboard": { - "source": "src/pages/dashboard.ts", - "distDir": "dist/scripts" + "source": "src/templates/dashboard.html", + "distDir": "dist/" }, "status": { - "source": "src/pages/status.ts", - "distDir": "dist/scripts" + "source": "src/templates/status.html", + "distDir": "dist/" }, "bootstrap": { - "source": "src/pages/bootstrap.ts", - "distDir": "dist/scripts" + "source": "src/templates/bootstrap.html", + "distDir": "dist/" }, "graphs": { - "source": "src/pages/graphs.ts", - "distDir": "dist/scripts" + "source": "src/templates/graphs.html", + "distDir": "dist/" }, "compare": { - "source": "src/pages/compare.ts", - "distDir": "dist/scripts" + "source": "src/templates/compare.html", + "distDir": "dist/" }, "detailed-query": { - "source": "src/pages/detailed-query.ts", - "distDir": "dist/scripts" + "source": "src/templates/detailed-query.html", + "distDir": "dist/" }, - "uplot": { - "source": "node_modules/uplot/dist/uPlot.min.css", - "distDir": "dist/styles" + "layout": { + "source": "src/templates/layout.html", + "distDir": "dist/" } }, "browserslist": "> 0.5%, last 3 years, not dead", diff --git a/site/frontend/templates/pages/bootstrap.html b/site/frontend/src/templates/bootstrap.html similarity index 86% rename from site/frontend/templates/pages/bootstrap.html rename to site/frontend/src/templates/bootstrap.html index 2610f0c70..b5d1de7f6 100644 --- a/site/frontend/templates/pages/bootstrap.html +++ b/site/frontend/src/templates/bootstrap.html @@ -1,6 +1,6 @@ {% extends "layout.html" %} {% block head %} - + - + {% endblock %} {% block content %} {% raw %} @@ -79,5 +79,5 @@ {% endraw %} {% endblock %} {% block script %} - + {% endblock %} diff --git a/site/frontend/templates/pages/dashboard.html b/site/frontend/src/templates/dashboard.html similarity index 94% rename from site/frontend/templates/pages/dashboard.html rename to site/frontend/src/templates/dashboard.html index 8010544be..7ee81483f 100644 --- a/site/frontend/templates/pages/dashboard.html +++ b/site/frontend/src/templates/dashboard.html @@ -34,5 +34,5 @@
{% endblock %} {% block script %} - -{% endblock %} \ No newline at end of file + +{% endblock %} diff --git a/site/frontend/templates/pages/detailed-query.html b/site/frontend/src/templates/detailed-query.html similarity index 97% rename from site/frontend/templates/pages/detailed-query.html rename to site/frontend/src/templates/detailed-query.html index dbec34f59..d566609db 100644 --- a/site/frontend/templates/pages/detailed-query.html +++ b/site/frontend/src/templates/detailed-query.html @@ -103,5 +103,5 @@

Artifact Size

{% endblock content %} {% block script %} - + {% endblock script %} diff --git a/site/frontend/templates/pages/graphs.html b/site/frontend/src/templates/graphs.html similarity index 81% rename from site/frontend/templates/pages/graphs.html rename to site/frontend/src/templates/graphs.html index c1b20f59b..3a4856937 100644 --- a/site/frontend/templates/pages/graphs.html +++ b/site/frontend/src/templates/graphs.html @@ -1,6 +1,6 @@ {% extends "layout.html" %} {% block head %} - + + + {% endblock %} {% block content %}
{% endblock %} {% block script %} - + {% endblock %} diff --git a/site/frontend/templates/pages/help.html b/site/frontend/src/templates/help.html similarity index 100% rename from site/frontend/templates/pages/help.html rename to site/frontend/src/templates/help.html diff --git a/site/frontend/templates/layout.html b/site/frontend/src/templates/layout.html similarity index 63% rename from site/frontend/templates/layout.html rename to site/frontend/src/templates/layout.html index 44ce25427..dc355f011 100644 --- a/site/frontend/templates/layout.html +++ b/site/frontend/src/templates/layout.html @@ -1,16 +1,16 @@ - + rustc performance data - - - + + + {% block head %}{% endblock %} -
> graphs, compare, +
> graphs, compare, dashboard, bootstrap, status, help.
diff --git a/site/frontend/templates/pages/status.html b/site/frontend/src/templates/status.html similarity index 53% rename from site/frontend/templates/pages/status.html rename to site/frontend/src/templates/status.html index fc1900e45..0a1372461 100644 --- a/site/frontend/templates/pages/status.html +++ b/site/frontend/src/templates/status.html @@ -1,10 +1,10 @@ {% extends "layout.html" %} {% block head %} - + {% endblock %} {% block content %}
{% endblock %} {% block script %} - + {% endblock %} From 1a9c589dc05a6a6b394c79a16453390e1876e350 Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Apr 2024 10:20:08 +0800 Subject: [PATCH 2/9] Fit the frontend import path --- site/src/resources.rs | 2 +- site/src/server.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/site/src/resources.rs b/site/src/resources.rs index 71a3ffbcf..78fe3c809 100644 --- a/site/src/resources.rs +++ b/site/src/resources.rs @@ -23,7 +23,7 @@ struct StaticCompiledAssets; /// HTML template files that will be rendered by `tera`. #[derive(RustEmbed)] -#[folder = "frontend/templates/"] +#[folder = "frontend/dist"] #[include = "*.html"] struct TemplateAssets; diff --git a/site/src/server.rs b/site/src/server.rs index 6bb155bbd..6aa6c8f8c 100644 --- a/site/src/server.rs +++ b/site/src/server.rs @@ -624,15 +624,12 @@ async fn handle_fs_path( } async fn resolve_template(path: &str) -> Vec { - TEMPLATES - .get_template(&format!("pages/{}", path)) - .await - .unwrap() + TEMPLATES.get_template(&path).await.unwrap() } let relative_path = path.trim_start_matches('/'); let source = match path { - "" | "/" | "/index.html" => resolve_template("graphs.html").await, + "" | "/" | "/index.html" | "/graphs.html" => resolve_template("graphs.html").await, "/bootstrap.html" | "/compare.html" | "/dashboard.html" From f44b3ea302b9187476643dbc6bf77a36d060ba71 Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Apr 2024 10:41:38 +0800 Subject: [PATCH 3/9] add testcase for path "" --- site/src/server.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/site/src/server.rs b/site/src/server.rs index 6aa6c8f8c..03068644d 100644 --- a/site/src/server.rs +++ b/site/src/server.rs @@ -815,3 +815,26 @@ impl ResponseHeaders for http::response::Builder { self } } + +#[cfg(test)] +mod tests { + use super::*; + #[tokio::test] + async fn handle_fs_path_html() { + // Test case 1: Path is "" + let req = Request::default(); + let path = ""; + let use_compression = false; + let response = handle_fs_path(&req, path, use_compression).await.unwrap(); + // "", "/", "/index.html", "/graphs.html" map to "graphs.html" + let expected_body = TEMPLATES.get_template("graphs.html").await.unwrap(); + let expected_response = http::Response::builder() + .header_typed(ETag::from_str(&format!(r#""{}""#, *VERSION_UUID)).unwrap()) + .header(CACHE_CONTROL, "max-age=60, stale-while-revalidate=86400") + .header_typed(ContentType::html()) + .body(hyper::Body::from(expected_body)) + .unwrap(); + assert_eq!(response.headers(), expected_response.headers()); + assert_eq!(hyper::body::to_bytes(response.into_body()).await.unwrap(), hyper::body::to_bytes(expected_response.into_body()).await.unwrap()); + } +} From 85f3114937429607adfb96ce636f3f59cc4036be Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Apr 2024 10:44:48 +0800 Subject: [PATCH 4/9] add testcase fror path "/compare.html" --- site/src/server.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/site/src/server.rs b/site/src/server.rs index 03068644d..f6a3d5544 100644 --- a/site/src/server.rs +++ b/site/src/server.rs @@ -836,5 +836,20 @@ mod tests { .unwrap(); assert_eq!(response.headers(), expected_response.headers()); assert_eq!(hyper::body::to_bytes(response.into_body()).await.unwrap(), hyper::body::to_bytes(expected_response.into_body()).await.unwrap()); + + // Test case 2: Path is "/compare.html" + let req = Request::default(); + let path = "/compare.html"; + let use_compression = false; + let response = handle_fs_path(&req, path, use_compression).await.unwrap(); + let expected_body = TEMPLATES.get_template("compare.html").await.unwrap(); + let expected_response = http::Response::builder() + .header_typed(ETag::from_str(&format!(r#""{}""#, *VERSION_UUID)).unwrap()) + .header(CACHE_CONTROL, "max-age=60, stale-while-revalidate=86400") + .header_typed(ContentType::html()) + .body(hyper::Body::from(expected_body)) + .unwrap(); + assert_eq!(response.headers(), expected_response.headers()); + assert_eq!(hyper::body::to_bytes(response.into_body()).await.unwrap(), hyper::body::to_bytes(expected_response.into_body()).await.unwrap()); } } From 34deec24397ce9098303784ef146f67fede13735 Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Apr 2024 10:53:53 +0800 Subject: [PATCH 5/9] Fix typo --- site/src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/server.rs b/site/src/server.rs index f6a3d5544..4578600c4 100644 --- a/site/src/server.rs +++ b/site/src/server.rs @@ -624,7 +624,7 @@ async fn handle_fs_path( } async fn resolve_template(path: &str) -> Vec { - TEMPLATES.get_template(&path).await.unwrap() + TEMPLATES.get_template(path).await.unwrap() } let relative_path = path.trim_start_matches('/'); From ffdde647f5a5863eb28ef35b4251d219fd3f8f32 Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Apr 2024 20:44:50 +0800 Subject: [PATCH 6/9] Update CI workflow to use Node.js 20.x and build frontend for testing --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e702d65db..3129ae11f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ jobs: test_and_deploy: name: Test and deploy runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: - name: Checkout the source code uses: actions/checkout@v2 @@ -30,6 +34,17 @@ jobs: - uses: Swatinem/rust-cache@v2 with: key: linux + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Build frontend for testing + run: | + npm ci + npm run build + working-directory: ./site/frontend - name: Run unit tests run: cargo test --all From a7ac0c8cfdec34cd8dab86fecfe22aa00ea171bb Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sun, 28 Apr 2024 09:21:06 +0800 Subject: [PATCH 7/9] formatting --- site/frontend/src/templates/bootstrap.html | 79 ++++---- site/frontend/src/templates/compare.html | 119 ++++++----- site/frontend/src/templates/dashboard.html | 3 +- .../src/templates/detailed-query.html | 187 +++++++++--------- site/frontend/src/templates/graphs.html | 79 ++++---- site/frontend/src/templates/help.html | 84 ++++---- site/frontend/src/templates/layout.html | 54 +++-- site/frontend/src/templates/status.html | 9 +- site/src/server.rs | 14 +- 9 files changed, 329 insertions(+), 299 deletions(-) diff --git a/site/frontend/src/templates/bootstrap.html b/site/frontend/src/templates/bootstrap.html index b5d1de7f6..21a158df7 100644 --- a/site/frontend/src/templates/bootstrap.html +++ b/site/frontend/src/templates/bootstrap.html @@ -1,52 +1,49 @@ -{% extends "layout.html" %} -{% block head %} - +{% extends "layout.html" %} {% block head %} + -{% endblock %} -{% block content %} +{% endblock %} {% block content %}
-{% endblock %} -{% block script %} +{% endblock %} {% block script %} {% endblock %} diff --git a/site/frontend/src/templates/compare.html b/site/frontend/src/templates/compare.html index 2e3a40c0d..549934ee8 100644 --- a/site/frontend/src/templates/compare.html +++ b/site/frontend/src/templates/compare.html @@ -1,83 +1,78 @@ -{% extends "layout.html" %} -{% block head %} - +{% extends "layout.html" %} {% block head %} + -{% endblock %} -{% block content %} -{% raw %} +{% endblock %} {% block content %} {% raw %}
-{% endraw %} -{% endblock %} -{% block script %} +{% endraw %} {% endblock %} {% block script %} {% endblock %} diff --git a/site/frontend/src/templates/dashboard.html b/site/frontend/src/templates/dashboard.html index 7ee81483f..5d9d2a06b 100644 --- a/site/frontend/src/templates/dashboard.html +++ b/site/frontend/src/templates/dashboard.html @@ -32,7 +32,6 @@
-{% endblock %} -{% block script %} +{% endblock %} {% block script %} {% endblock %} diff --git a/site/frontend/src/templates/detailed-query.html b/site/frontend/src/templates/detailed-query.html index d566609db..d39f24c2a 100644 --- a/site/frontend/src/templates/detailed-query.html +++ b/site/frontend/src/templates/detailed-query.html @@ -1,107 +1,116 @@ -{% extends "layout.html" %} -{% block head %} +{% extends "layout.html" %} {% block head %} -{% endblock %} -{% block content %} +{% endblock %} {% block content %}
-
-

-
-

Artifact Size

- - - - - - - - - - -
ArtifactSizeSize delta
-

'Time (%)' is the percentage of the cpu-clock time spent on this query (we do not use - wall-time as we want to account for parallelism).

-

Executions do not include cached executions.

- - - - - - - - - - - - - - - -
Query/FunctionTime (%)Time (s)Time deltaExecutionsExecutions delta - Incremental loading (s)Incremental loading delta
-
+
+

+
+

Artifact Size

+ + + + + + + + + +
ArtifactSizeSize delta
+

+ 'Time (%)' is the percentage of the cpu-clock time spent on this query (we + do not use wall-time as we want to account for parallelism). +

+

Executions do not include cached executions.

+ + + + + + + + + + + + + + +
Query/FunctionTime (%)Time (s) + Time delta + Executions + Executions delta + + Incremental loading (s) + + Incremental loading delta +
+
-{% endblock content %} -{% block script %} +{% endblock content %} {% block script %} {% endblock script %} diff --git a/site/frontend/src/templates/graphs.html b/site/frontend/src/templates/graphs.html index 3a4856937..954ccf55c 100644 --- a/site/frontend/src/templates/graphs.html +++ b/site/frontend/src/templates/graphs.html @@ -1,54 +1,51 @@ -{% extends "layout.html" %} -{% block head %} - +{% extends "layout.html" %} {% block head %} + -{% endblock %} -{% block content %} +{% endblock %} {% block content %}
-{% endblock %} -{% block script %} +{% endblock %} {% block script %} {% endblock %} diff --git a/site/frontend/src/templates/help.html b/site/frontend/src/templates/help.html index 06b184c9c..abcbd5352 100644 --- a/site/frontend/src/templates/help.html +++ b/site/frontend/src/templates/help.html @@ -1,48 +1,60 @@ -{% extends "layout.html" %} -{% block head %} +{% extends "layout.html" %} {% block head %} -{% endblock %} - -{% block content %} +{% endblock %} {% block content %}
-

@rust-timer commands

-

@rust-timer supports several commands, the most common (and simple) being - @rust-timer queue. This command is usually invoked as @bors try @rust-timer queue, - which starts a bors "try" run (not a merge). @rust-timer will wait for the try run to finish, - and if it succeeds will then queue a perf run. +

+ @rust-timer commands +

+

+ @rust-timer supports several commands, the most common (and + simple) being @rust-timer queue. This command is usually + invoked as @bors try @rust-timer queue, which starts a bors + "try" run (not a merge). @rust-timer will wait for the try run + to finish, and if it succeeds will then queue a perf run. +

+

+ @rust-timer queue has a few extra options that can be useful:

-

@rust-timer queue has a few extra options that can be useful:

-

@rust-timer build $commit will queue a perf run for the given commit $commit. - It is usually invoked with the commit from a successful "try" run. (The - queue command can be seen as a shortcut that automatically selects the - "try" run's commit for the build command) - This command also supports the same include, exclude, and runs options - as @rust-timer queue. +

+ @rust-timer build $commit will queue a perf run for the given + commit $commit. It is usually invoked with the commit from a + successful "try" run. (The queue command can be seen as a + shortcut that automatically selects the "try" run's commit for the + build command) This command also supports the same + include, exclude, and runs options as + @rust-timer queue.

{% endblock %} diff --git a/site/frontend/src/templates/layout.html b/site/frontend/src/templates/layout.html index dc355f011..58bde0e2d 100644 --- a/site/frontend/src/templates/layout.html +++ b/site/frontend/src/templates/layout.html @@ -1,23 +1,37 @@ - - - rustc performance data - - - - - {% block head %}{% endblock %} - - -
> graphs, compare, - dashboard, bootstrap, - status, help. -
- {% block content %}{% endblock %} -
- Contribute on GitHub -
- {% block script %}{% endblock %} - + + + rustc performance data + + + + + {% block head %}{% endblock %} + + +
+ > graphs, compare, + dashboard, + bootstrap, status, + help. +
+ {% block content %}{% endblock %} +
+ Contribute on GitHub +
+ {% block script %}{% endblock %} + diff --git a/site/frontend/src/templates/status.html b/site/frontend/src/templates/status.html index 0a1372461..e33bf17c5 100644 --- a/site/frontend/src/templates/status.html +++ b/site/frontend/src/templates/status.html @@ -1,10 +1,7 @@ -{% extends "layout.html" %} -{% block head %} +{% extends "layout.html" %} {% block head %} -{% endblock %} -{% block content %} +{% endblock %} {% block content %}
-{% endblock %} -{% block script %} +{% endblock %} {% block script %} {% endblock %} diff --git a/site/src/server.rs b/site/src/server.rs index 4578600c4..1ce753271 100644 --- a/site/src/server.rs +++ b/site/src/server.rs @@ -835,7 +835,12 @@ mod tests { .body(hyper::Body::from(expected_body)) .unwrap(); assert_eq!(response.headers(), expected_response.headers()); - assert_eq!(hyper::body::to_bytes(response.into_body()).await.unwrap(), hyper::body::to_bytes(expected_response.into_body()).await.unwrap()); + assert_eq!( + hyper::body::to_bytes(response.into_body()).await.unwrap(), + hyper::body::to_bytes(expected_response.into_body()) + .await + .unwrap() + ); // Test case 2: Path is "/compare.html" let req = Request::default(); @@ -850,6 +855,11 @@ mod tests { .body(hyper::Body::from(expected_body)) .unwrap(); assert_eq!(response.headers(), expected_response.headers()); - assert_eq!(hyper::body::to_bytes(response.into_body()).await.unwrap(), hyper::body::to_bytes(expected_response.into_body()).await.unwrap()); + assert_eq!( + hyper::body::to_bytes(response.into_body()).await.unwrap(), + hyper::body::to_bytes(expected_response.into_body()) + .await + .unwrap() + ); } } From 99599be7c7a83f5051dbfa724fa680c9244076b5 Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sun, 28 Apr 2024 10:09:48 +0800 Subject: [PATCH 8/9] Update windows CI workflow to build frontend for testing --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3129ae11f..bbcc2e9f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,10 @@ jobs: test_on_windows: name: Test on Windows runs-on: windows-latest + strategy: + matrix: + node-version: [20.x] + steps: - name: Checkout the source code uses: actions/checkout@v2 @@ -102,6 +106,17 @@ jobs: env: RUSTFLAGS: -Dwarnings + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Build frontend for testing + run: | + npm ci + npm run build + working-directory: ./site/frontend + - name: Run unit tests run: cargo test --all From fcdd6118650f74fe85e0252083cbcda34b9b58fa Mon Sep 17 00:00:00 2001 From: R4 Cheng Date: Sat, 27 Jul 2024 15:38:03 +0800 Subject: [PATCH 9/9] Use `posthtml-include` to embed layout to other HTMLs So that we do not need to bundle `layout.html` using parcel ref: * https://parceljs.org/languages/html/#posthtml --- site/frontend/.posthtmlrc | 5 + site/frontend/package-lock.json | 58 +++++ site/frontend/package.json | 10 +- site/frontend/src/templates/bootstrap.html | 92 ++++---- site/frontend/src/templates/compare.html | 133 ++++++----- site/frontend/src/templates/dashboard.html | 68 +++--- .../src/templates/detailed-query.html | 222 ++++++++++-------- site/frontend/src/templates/graphs.html | 94 ++++---- site/frontend/src/templates/help.html | 127 +++++----- site/frontend/src/templates/layout.html | 37 --- .../frontend/src/templates/layout/footer.html | 3 + site/frontend/src/templates/layout/head.html | 6 + .../frontend/src/templates/layout/navbar.html | 6 + site/frontend/src/templates/status.html | 18 +- 14 files changed, 485 insertions(+), 394 deletions(-) create mode 100644 site/frontend/.posthtmlrc delete mode 100644 site/frontend/src/templates/layout.html create mode 100644 site/frontend/src/templates/layout/footer.html create mode 100644 site/frontend/src/templates/layout/head.html create mode 100644 site/frontend/src/templates/layout/navbar.html diff --git a/site/frontend/.posthtmlrc b/site/frontend/.posthtmlrc new file mode 100644 index 000000000..28fd562f6 --- /dev/null +++ b/site/frontend/.posthtmlrc @@ -0,0 +1,5 @@ +{ + "plugins": { + "posthtml-include": {} + } +} \ No newline at end of file diff --git a/site/frontend/package-lock.json b/site/frontend/package-lock.json index 62f3be4a0..3fc517a58 100644 --- a/site/frontend/package-lock.json +++ b/site/frontend/package-lock.json @@ -22,6 +22,7 @@ "@parcel/compressor-brotli": "^2.8.3", "@parcel/transformer-vue": "^2.8.3", "@types/msgpack-lite": "^0.1.8", + "posthtml-include": "^2.0.1", "prettier": "2.8.8", "typescript": "^5.0.2", "vue-tsc": "^1.8.3" @@ -2753,6 +2754,12 @@ "resolved": "https://registry.npmjs.org/event-lite/-/event-lite-0.1.3.tgz", "integrity": "sha512-8qz9nOz5VeD2z96elrEKD2U433+L3DWdUdDkOINLGOJvx1GsMBbMn0aCeu28y8/e85A6mCigBiFlYMnTBEGlSw==" }, + "node_modules/fclone": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz", + "integrity": "sha512-GDqVQezKzRABdeqflsgMr7ktzgF9CyS+p2oe0jJqUY6izSSbhPIQJDpoU4PtGcD7VPM9xh/dVrTu6z1nwgmEGw==", + "dev": true + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -3574,6 +3581,57 @@ "node": ">=12.0.0" } }, + "node_modules/posthtml-expressions": { + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/posthtml-expressions/-/posthtml-expressions-1.11.4.tgz", + "integrity": "sha512-tJI6KhKLcePRO0/i4d01MNXfcaBa2jIu4MuVLixvGwCRzxdY2D7LLm17ijNyQNQu3xOhCffBLtUMju0K64smmQ==", + "dev": true, + "dependencies": { + "fclone": "^1.0.11", + "posthtml": "^0.16.5", + "posthtml-match-helper": "^1.0.1", + "posthtml-parser": "^0.10.0", + "posthtml-render": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/posthtml-include": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/posthtml-include/-/posthtml-include-2.0.1.tgz", + "integrity": "sha512-1YXy4QWeJldosTKLPz6ecbI4e26jHmo3R97NNTKMQqITvZOY025+yvX/RUgvcD1VghLeACs0Y2P3GjtJo5s27Q==", + "dev": true, + "dependencies": { + "posthtml": "^0.16.6", + "posthtml-expressions": "^1.7.1", + "posthtml-parser": "^0.11.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/posthtml-include/node_modules/posthtml-parser": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.11.0.tgz", + "integrity": "sha512-QecJtfLekJbWVo/dMAA+OSwY79wpRmbqS5TeXvXSX+f0c6pW4/SE6inzZ2qkU7oAMCPqIDkZDvd/bQsSFUnKyw==", + "dev": true, + "dependencies": { + "htmlparser2": "^7.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/posthtml-match-helper": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/posthtml-match-helper/-/posthtml-match-helper-1.0.4.tgz", + "integrity": "sha512-Tj9orTIBxHdnraCxoEGjoizsFsTGvukzwcuhOjYQGmDG6gTlaRbMrGgi1J+FwKTN8hsCQENHYY0Deqs9a89BVg==", + "dev": true, + "peerDependencies": { + "posthtml": ">=0.5.0" + } + }, "node_modules/posthtml-parser": { "version": "0.10.2", "resolved": "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.10.2.tgz", diff --git a/site/frontend/package.json b/site/frontend/package.json index 8272ca624..eec041202 100644 --- a/site/frontend/package.json +++ b/site/frontend/package.json @@ -15,10 +15,16 @@ "@parcel/compressor-brotli": "^2.8.3", "@parcel/transformer-vue": "^2.8.3", "@types/msgpack-lite": "^0.1.8", + "posthtml-include": "^2.0.1", "prettier": "2.8.8", "typescript": "^5.0.2", "vue-tsc": "^1.8.3" }, + "@parcel/bundler-default": { + "minBundles": 999, + "minBundleSize": 9999999, + "maxParallelRequests": 20 + }, "dependencies": { "date-fns": "^2.30.0", "highcharts": "^11.4.1", @@ -52,10 +58,6 @@ "detailed-query": { "source": "src/templates/detailed-query.html", "distDir": "dist/" - }, - "layout": { - "source": "src/templates/layout.html", - "distDir": "dist/" } }, "browserslist": "> 0.5%, last 3 years, not dead", diff --git a/site/frontend/src/templates/bootstrap.html b/site/frontend/src/templates/bootstrap.html index 21a158df7..d3187ce1d 100644 --- a/site/frontend/src/templates/bootstrap.html +++ b/site/frontend/src/templates/bootstrap.html @@ -1,49 +1,55 @@ -{% extends "layout.html" %} {% block head %} - - -{% endblock %} {% block content %} -
-{% endblock %} {% block script %} - -{% endblock %} + body { + padding: 1em; + margin: 0; + } + + + + +
+ + + + diff --git a/site/frontend/src/templates/compare.html b/site/frontend/src/templates/compare.html index 549934ee8..4277760c4 100644 --- a/site/frontend/src/templates/compare.html +++ b/site/frontend/src/templates/compare.html @@ -1,78 +1,81 @@ -{% extends "layout.html" %} {% block head %} - + + + + + + - - -{% endblock %} {% block content %} {% raw %} -
-{% endraw %} {% endblock %} {% block script %} - -{% endblock %} + .slightly-negative { + color: #74b374; + } + + + + +
+ + + + diff --git a/site/frontend/src/templates/dashboard.html b/site/frontend/src/templates/dashboard.html index 5d9d2a06b..3f731b95b 100644 --- a/site/frontend/src/templates/dashboard.html +++ b/site/frontend/src/templates/dashboard.html @@ -1,37 +1,45 @@ -{% extends "layout.html" %} -{% block head %} - -{% endblock %} -{% block content %} -
- What data is in the dashboard? + } + + + + +
+ What data is in the dashboard? - The dashboard shows performance results for all stable Rust releases going back to - 1.28.0, along with the latest beta release. The displayed - duration is an arithmetic mean amongst all - stable - benchmarks. The dashboard also shows the average duration of runtime benchmarks, which measure the performance of - Rust programs - compiled by a given version of the Rust compiler. -
+ The dashboard shows performance results for all stable Rust releases going + back to + 1.28.0, along with the latest beta release. The + displayed duration is an arithmetic mean amongst all + stable + benchmarks. The dashboard also shows the average duration of runtime + benchmarks, which measure the performance of Rust programs compiled by a + given version of the Rust compiler. +
-
-
-
-
-
-
-
-
-{% endblock %} {% block script %} - -{% endblock %} +
+
+
+
+
+
+
+
+ + + + diff --git a/site/frontend/src/templates/detailed-query.html b/site/frontend/src/templates/detailed-query.html index d39f24c2a..a69c33804 100644 --- a/site/frontend/src/templates/detailed-query.html +++ b/site/frontend/src/templates/detailed-query.html @@ -1,116 +1,130 @@ -{% extends "layout.html" %} {% block head %} - -{% endblock %} {% block content %} -
-
-

-
-

Artifact Size

- - - - - - - - - -
ArtifactSizeSize delta
-

- 'Time (%)' is the percentage of the cpu-clock time spent on this query (we - do not use wall-time as we want to account for parallelism). -

-

Executions do not include cached executions.

- - - - - - - - - - - - - - -
Query/FunctionTime (%)Time (s) - Time delta - Executions - Executions delta - - Incremental loading (s) - - Incremental loading delta -
-
-
-{% endblock content %} {% block script %} - -{% endblock script %} + #artifact-table td { + padding: 0 0 0 20px; + } + + + + + < +
+
+

+
+

Artifact Size

+ + + + + + + + + +
ArtifactSizeSize delta
+

+ 'Time (%)' is the percentage of the cpu-clock time spent on this query + (we do not use wall-time as we want to account for parallelism). +

+

Executions do not include cached executions.

+ + + + + + + + + + + + + + +
+ Query/Function + Time (%)Time (s) + Time delta + Executions + Executions delta + + Incremental loading (s) + + Incremental loading delta +
+
+
+ + + + diff --git a/site/frontend/src/templates/graphs.html b/site/frontend/src/templates/graphs.html index 954ccf55c..da4c8c1ae 100644 --- a/site/frontend/src/templates/graphs.html +++ b/site/frontend/src/templates/graphs.html @@ -1,51 +1,55 @@ -{% extends "layout.html" %} {% block head %} - - - - -{% endblock %} {% block content %} -
-{% endblock %} {% block script %} - -{% endblock %} + body { + padding: 1em; + margin: 0; + } + + + + +
+ + + + diff --git a/site/frontend/src/templates/help.html b/site/frontend/src/templates/help.html index abcbd5352..d031f74b4 100644 --- a/site/frontend/src/templates/help.html +++ b/site/frontend/src/templates/help.html @@ -1,60 +1,69 @@ -{% extends "layout.html" %} {% block head %} - -{% endblock %} {% block content %} -
-

- @rust-timer commands -

-

- @rust-timer supports several commands, the most common (and - simple) being @rust-timer queue. This command is usually - invoked as @bors try @rust-timer queue, which starts a bors - "try" run (not a merge). @rust-timer will wait for the try run - to finish, and if it succeeds will then queue a perf run. -

-

- @rust-timer queue has a few extra options that can be useful: -

-
    -
  • - include=<INCLUDE> is a comma-separated list of - benchmark prefixes. A benchmark is included in the run only if its name - matches one of the given prefixes. -
  • -
  • - exclude=<EXCLUDE> is a comma-separated list of - benchmark prefixes, and the inverse of include=. A benchmark - is excluded from the run if its name matches one of the given prefixes. -
  • -
  • - runs=<RUNS> configures how many times the benchmark is - run. <RUNS> is an integer. All benchmarks run at least - once by default, but some run more than one time. You can use the - runs option to override the default run count and make every - benchmark run for <RUNS> times. -
  • -
-

- @rust-timer build $commit will queue a perf run for the given - commit $commit. It is usually invoked with the commit from a - successful "try" run. (The queue command can be seen as a - shortcut that automatically selects the "try" run's commit for the - build command) This command also supports the same - include, exclude, and runs options as - @rust-timer queue. -

-
-{% endblock %} + .help-content code { + background: #eee; + border-radius: 5px; + padding: 2px; + } + + + + +
+

+ @rust-timer commands +

+

+ @rust-timer supports several commands, the most common (and + simple) being @rust-timer queue. This command is usually + invoked as @bors try @rust-timer queue, which starts a bors + "try" run (not a merge). @rust-timer will wait for the try + run to finish, and if it succeeds will then queue a perf run. +

+

+ @rust-timer queue has a few extra options that can be + useful: +

+
    +
  • + include=<INCLUDE> is a comma-separated list of + benchmark prefixes. A benchmark is included in the run only if its + name matches one of the given prefixes. +
  • +
  • + exclude=<EXCLUDE> is a comma-separated list of + benchmark prefixes, and the inverse of include=. A + benchmark is excluded from the run if its name matches one of the + given prefixes. +
  • +
  • + runs=<RUNS> configures how many times the benchmark + is run. <RUNS> is an integer. All benchmarks run at + least once by default, but some run more than one time. You can use + the runs option to override the default run count and + make every benchmark run for <RUNS> times. +
  • +
+

+ @rust-timer build $commit will queue a perf run for the + given commit $commit. It is usually invoked with the commit + from a successful "try" run. (The queue command can be seen + as a shortcut that automatically selects the "try" run's commit for the + build command) This command also supports the same + include, exclude, and + runs options as @rust-timer queue. +

+
+ + + diff --git a/site/frontend/src/templates/layout.html b/site/frontend/src/templates/layout.html deleted file mode 100644 index 58bde0e2d..000000000 --- a/site/frontend/src/templates/layout.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - rustc performance data - - - - - {% block head %}{% endblock %} - - -
- > graphs, compare, - dashboard, - bootstrap, status, - help. -
- {% block content %}{% endblock %} -
- Contribute on GitHub -
- {% block script %}{% endblock %} - - diff --git a/site/frontend/src/templates/layout/footer.html b/site/frontend/src/templates/layout/footer.html new file mode 100644 index 000000000..6403e12f9 --- /dev/null +++ b/site/frontend/src/templates/layout/footer.html @@ -0,0 +1,3 @@ +
+ Contribute on GitHub +
diff --git a/site/frontend/src/templates/layout/head.html b/site/frontend/src/templates/layout/head.html new file mode 100644 index 000000000..806df1db3 --- /dev/null +++ b/site/frontend/src/templates/layout/head.html @@ -0,0 +1,6 @@ + +rustc performance data + + + + diff --git a/site/frontend/src/templates/layout/navbar.html b/site/frontend/src/templates/layout/navbar.html new file mode 100644 index 000000000..2cc6c0861 --- /dev/null +++ b/site/frontend/src/templates/layout/navbar.html @@ -0,0 +1,6 @@ +
+ > graphs, compare, + dashboard, + bootstrap, status, + help. +
diff --git a/site/frontend/src/templates/status.html b/site/frontend/src/templates/status.html index e33bf17c5..196ac2fa3 100644 --- a/site/frontend/src/templates/status.html +++ b/site/frontend/src/templates/status.html @@ -1,7 +1,11 @@ -{% extends "layout.html" %} {% block head %} - -{% endblock %} {% block content %} -
-{% endblock %} {% block script %} - -{% endblock %} + + + + + + + +
+ + +