Skip to content

Commit 62a2c39

Browse files
[frontend] fix build warnings (open-telemetry#2025)
* upgrade to node 22 * fix build warnings * fix build warnings --------- Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
1 parent fded15d commit 62a2c39

File tree

8 files changed

+24
-5
lines changed

8 files changed

+24
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ the release.
8484
([#1954](https://github.com/open-telemetry/opentelemetry-demo/pull/1954))
8585
* [accounting] bump OpenTelemetry .NET Automatic Instrumentation to 1.10.0
8686
([#1998](https://github.com/open-telemetry/opentelemetry-demo/pull/1998))
87+
* [frontend] update to Node 22
88+
([#2025](https://github.com/open-telemetry/opentelemetry-demo/pull/2025))
89+
* [frontend] move page titles to individual pages
90+
([#2025](https://github.com/open-telemetry/opentelemetry-demo/pull/2025))
8791

8892
## 1.12.0
8993

src/frontend/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
FROM node:20-alpine AS deps
4+
FROM node:22-alpine AS deps
55
RUN apk add --no-cache libc6-compat
66

77
WORKDIR /app
88

99
COPY ./src/frontend/package*.json ./
1010
RUN npm ci
1111

12-
FROM node:20-alpine AS builder
12+
FROM node:22-alpine AS builder
1313
RUN apk add --no-cache libc6-compat
1414
WORKDIR /app
1515
COPY --from=deps /app/node_modules ./node_modules
@@ -18,7 +18,7 @@ COPY ./src/frontend .
1818

1919
RUN npm run build
2020

21-
FROM node:20-alpine AS runner
21+
FROM node:22-alpine AS runner
2222
WORKDIR /app
2323

2424
ENV NODE_ENV=production

src/frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "NODE_OPTIONS='-r ./utils/telemetry/Instrumentation.js' next dev",
6+
"dev": "NODE_OPTIONS='--require ./utils/telemetry/Instrumentation.js' next dev",
77
"build": "next build",
88
"start": "node --require ./Instrumentation.js server.js",
99
"lint": "next lint",

src/frontend/pages/_document.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export default class MyDocument extends Document<{ envString: string }> {
5353
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap"
5454
rel="stylesheet"
5555
/>
56-
<title>OTel demo</title>
5756
</Head>
5857
<body>
5958
<Main />

src/frontend/pages/cart/checkout/[orderId]/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NextPage } from 'next';
5+
import Head from 'next/head';
56
import Link from 'next/link';
67
import { useRouter } from 'next/router';
78
import Ad from '../../../../components/Ad';
@@ -23,6 +24,9 @@ const Checkout: NextPage = () => {
2324
productIds={items.map(({ item }) => item?.productId || '')}
2425
contextKeys={[...new Set(items.flatMap(({ item }) => item.product.categories))]}
2526
>
27+
<Head>
28+
<title>Otel Demo - Checkout</title>
29+
</Head>
2630
<Layout>
2731
<S.Checkout>
2832
<S.Container>

src/frontend/pages/cart/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NextPage } from 'next';
5+
import Head from 'next/head';
56
import Footer from '../../components/Footer';
67
import Layout from '../../components/Layout';
78
import Recommendations from '../../components/Recommendations';
@@ -21,6 +22,9 @@ const Cart: NextPage = () => {
2122
productIds={items.map(({ productId }) => productId)}
2223
contextKeys={[...new Set(items.flatMap(({ product }) => product.categories))]}
2324
>
25+
<Head>
26+
<title>Otel Demo - Cart</title>
27+
</Head>
2428
<Layout>
2529
<S.Cart>
2630
{(!!items.length && <CartDetail />) || <EmptyCart />}

src/frontend/pages/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NextPage } from 'next';
5+
import Head from 'next/head';
56
import Footer from '../components/Footer';
67
import Layout from '../components/Layout';
78
import ProductList from '../components/ProductList';
@@ -21,6 +22,9 @@ const Home: NextPage = () => {
2122

2223
return (
2324
<Layout>
25+
<Head>
26+
<title>Otel Demo - Home</title>
27+
</Head>
2428
<S.Home data-cy={CypressFields.HomePage}>
2529
<Banner />
2630
<S.Container>

src/frontend/pages/product/[productId]/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NextPage } from 'next';
5+
import Head from 'next/head';
56
import Image from 'next/image';
67
import { useRouter } from 'next/router';
78
import { useCallback, useState, useEffect } from 'react';
@@ -64,6 +65,9 @@ const ProductDetail: NextPage = () => {
6465
productIds={[productId, ...items.map(({ productId }) => productId)]}
6566
contextKeys={[...new Set(categories)]}
6667
>
68+
<Head>
69+
<title>Otel Demo - Product</title>
70+
</Head>
6771
<Layout>
6872
<S.ProductDetail data-cy={CypressFields.ProductDetail}>
6973
<S.Container>

0 commit comments

Comments
 (0)