Skip to content

Commit

Permalink
lighthouse score optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis committed Jun 11, 2024
1 parent 502d342 commit d625f18
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/checkout/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default ({
${dataId ? `data-id="${dataId}"` : ""}
${title ? `title="${title}"` : ""}
class="c_Button c_Button--${variant} ${className} ${rounded ? "c_Button--rounded" : ""} c_Button--size-${size}"
ontouchstart
>
<div class="c_Button__inner">${children}</div>
</${tag}>`;
Expand Down
1 change: 1 addition & 0 deletions src/checkout/components/CompactHeader.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
.c_CompactHeader__logo {
display: block;
width: 175px;
aspect-ratio: 3.5;
}
1 change: 1 addition & 0 deletions src/checkout/components/MiniCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default ({ c }) => {
rounded: true,
href: "/checkout/cart",
className: "c_MiniCart__button",
title: "View Cart",
children: html`
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
7 changes: 6 additions & 1 deletion src/checkout/components/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import Meta from "./Meta.js";

export default ({ content }) => {
return html`<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tractor Store</title>
<meta
name="description"
content="a non-trivial micro frontends example project"
/>
<link rel="stylesheet" href="/explore/static/styles.css" />
<link rel="stylesheet" href="/decide/static/styles.css" />
<link rel="stylesheet" href="/checkout/static/styles.css" />
Expand Down
1 change: 1 addition & 0 deletions src/checkout/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
}

* {
Expand Down
8 changes: 7 additions & 1 deletion src/decide/pages/ProductPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ export default ({ id, sku, c }) => {
const variant = variants.find((v) => v.sku === sku) || variants[0];

return html`<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tractor Store</title>
<meta
name="description"
content="a non-trivial micro frontends example project"
/>
<link rel="stylesheet" href="/explore/static/styles.css" />
<link rel="stylesheet" href="/decide/static/styles.css" />
<link rel="stylesheet" href="/checkout/static/styles.css" />
Expand All @@ -43,6 +48,7 @@ export default ({ id, sku, c }) => {
sizes="400px"
width="400"
height="400"
alt="${name} - ${variant.name}"
/>
<div class="d_ProductPage__productInformation">
<h2 class="d_ProductPage__title">${name}</h2>
Expand Down
1 change: 1 addition & 0 deletions src/decide/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
}

* {
Expand Down
1 change: 0 additions & 1 deletion src/explore/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default ({
${value ? `value="${value}"` : ""}
${dataId ? `data-id="${dataId}"` : ""}
class="e_Button e_Button--${variant} ${className} ${rounded ? "e_Button--rounded" : ""}"
ontouchstart
>
<div class="e_Button__inner">${children}</div>
</${tag}>`;
Expand Down
2 changes: 1 addition & 1 deletion src/explore/components/Footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
margin: 0;
}

.e_Footer__credits h4 {
.e_Footer__credits h3 {
margin: 0;
font-size: 1em;
font-weight: normal;
Expand Down
6 changes: 5 additions & 1 deletion src/explore/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export default () => {
<img
src="${IMAGE_SERVER}/cdn/img/neulandlogo.svg"
alt="neuland - Büro für Informatik"
width="45"
height="40"
/>
<p>
based on
Expand All @@ -26,7 +28,7 @@ export default () => {
<div class="e_Footer__credits">
<!-- replace this details about your implementation and organization -->
<h4>techstack</h4>
<h3>techstack</h3>
<p>
ssr-only, modular monolith, template strings, esbuild, hono,
cloudflare workers
Expand All @@ -36,6 +38,8 @@ export default () => {
<img
src="${IMAGE_SERVER}/cdn/img/neulandlogo.svg"
alt="neuland - Büro für Informatik"
width="15"
height="13"
/>
<a href="https://neuland-bfi.de" target="_blank">neuland</a>
/
Expand Down
1 change: 1 addition & 0 deletions src/explore/components/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
@media (min-width: 500px) {
width: 270px;
}
aspect-ratio: 3.5;
display: block;
}

Expand Down
1 change: 1 addition & 0 deletions src/explore/components/Recommendation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default ({ image, url, name }) => {
class="e_Recommendation_image"
src="${src(image, 200)}"
srcet="${srcset(image, [200, 400])}"
alt=""
sizes="200px"
width="200"
height="200"
Expand Down
7 changes: 6 additions & 1 deletion src/explore/pages/CategoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ export default ({ category, c }) => {
];

return html`<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tractor Store</title>
<meta
name="description"
content="a non-trivial micro frontends example project"
/>
<link rel="stylesheet" href="/explore/static/styles.css" />
<link rel="stylesheet" href="/decide/static/styles.css" />
<link rel="stylesheet" href="/checkout/static/styles.css" />
Expand Down
9 changes: 7 additions & 2 deletions src/explore/pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ import Meta from "../components/Meta.js";
*/
export default ({ c }) => {
return html`<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tractor Store</title>
<meta
name="description"
content="a non-trivial micro frontends example project"
/>
<link rel="stylesheet" href="/explore/static/styles.css" />
<link rel="stylesheet" href="/decide/static/styles.css" />
<link rel="stylesheet" href="/checkout/static/styles.css" />
Expand All @@ -32,7 +37,7 @@ export default ({ c }) => {
src="${src(image, 500)}"
srcet="${srcset(image, [500, 1000])}"
sizes="100vw, (min-width: 500px) 50vw"
alt="${title}"
alt=""
/>
${title}
</a>`,
Expand Down
7 changes: 6 additions & 1 deletion src/explore/pages/StoresPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ import Meta from "../components/Meta.js";
*/
export default ({ c }) => {
return html`<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tractor Store</title>
<meta
name="description"
content="a non-trivial micro frontends example project"
/>
<link rel="stylesheet" href="/explore/static/styles.css" />
<link rel="stylesheet" href="/decide/static/styles.css" />
<link rel="stylesheet" href="/checkout/static/styles.css" />
Expand Down
1 change: 1 addition & 0 deletions src/explore/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
}

* {
Expand Down
10 changes: 9 additions & 1 deletion wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ main = "src/server.cloudflare.js"
compatibility_date = "2024-03-12"

[site]
bucket = "./public"
bucket = "./public"

[[site.headers]]
for = "*"
[site.headers.values]
Cache-Control = "public, max-age=3600"
Access-Control-Allow-Origin = "*"
Access-Control-Allow-Methods = "GET, POST, OPTIONS"
Access-Control-Allow-Headers = "*"

0 comments on commit d625f18

Please sign in to comment.