Skip to content

Commit a76f337

Browse files
[frontend] Update nodejs to latest LTS and bump dependencies (#1670)
* Update frontend nodejs to latest LTS and bump dependencies * changelog --------- Co-authored-by: Pierre Tessier <pierre@pierretessier.com>
1 parent 91c7df4 commit a76f337

File tree

10 files changed

+1715
-1216
lines changed

10 files changed

+1715
-1216
lines changed

CHANGELOG.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ the release.
77

88
## Unreleased
99

10+
* [otel-col] Add docker stats receiver
11+
([#1650](https://github.com/open-telemetry/opentelemetry-demo/pull/1650))
1012
* [otel-col] strip high-cardinality segments of span names
1113
([#1668](https://github.com/open-telemetry/opentelemetry-demo/pull/1668))
1214
* [tests] run trace based tests concurrently
1315
([#1659](https://github.com/open-telemetry/opentelemetry-demo/pull/1659))
16+
* [otel-col] Set OTLP receiver endpoint to avoid breaking changes
17+
([#1662](https://github.com/open-telemetry/opentelemetry-demo/pull/1662))
1418
* [accountingservice] increase memory to 120MB
1519
([#1666](https://github.com/open-telemetry/opentelemetry-demo/pull/1666))
20+
* [frontend] Update nodejs to latest LTS and bump dependencies
21+
([#1670](https://github.com/open-telemetry/opentelemetry-demo/pull/1670))
1622

1723
## 1.11.0
1824

@@ -27,10 +33,6 @@ the release.
2733
([#1619](https://github.com/open-telemetry/opentelemetry-demo/pull/1619))
2834
* [recommendation] updated flag name to match flagd configuration
2935
([#1634](https://github.com/open-telemetry/opentelemetry-demo/pull/1634))
30-
* [otel-col] Add docker stats receiver
31-
([#1650](https://github.com/open-telemetry/opentelemetry-demo/pull/1650))
32-
* [otel-col] Set OTLP receiver endpoint to avoid breaking changes
33-
([#1662](https://github.com/open-telemetry/opentelemetry-demo/pull/1662))
3436

3537
## 1.10.0
3638

src/frontend/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44

5-
FROM node:18-alpine AS deps
5+
FROM node:20-alpine AS deps
66
RUN apk add --no-cache libc6-compat
77

88
WORKDIR /app
99

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

13-
FROM node:18-alpine AS builder
13+
FROM node:20-alpine AS builder
1414
RUN apk add --no-cache libc6-compat protobuf-dev protoc
1515
WORKDIR /app
1616
COPY --from=deps /app/node_modules ./node_modules
@@ -20,7 +20,7 @@ COPY ./src/frontend .
2020
RUN npm run grpc:generate
2121
RUN npm run build
2222

23-
FROM node:18-alpine AS runner
23+
FROM node:20-alpine AS runner
2424
WORKDIR /app
2525
RUN apk add --no-cache protobuf-dev protoc
2626

src/frontend/components/Ad/Ad.styled.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ export const Ad = styled.section`
2020

2121
export const Link = styled(RouterLink)`
2222
color: black;
23+
text-decoration: none;
2324
`;

src/frontend/components/CartItems/CartItems.tsx

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

44
import { useMemo } from 'react';
5-
import { useQuery } from '@tanstack/react-query';
5+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
66
import ApiGateway from '../../gateways/Api.gateway';
77
import { Address, Money } from '../../protos/demo';
88
import { useCurrency } from '../../providers/Currency.provider';
@@ -26,10 +26,13 @@ const CartItems = ({ productList, shouldShowPrice = true }: IProps) => {
2626
zipCode: '94043',
2727
};
2828

29-
const { data: shippingConst = { units: 0, currencyCode: 'USD', nanos: 0 } } = useQuery(['shipping',
30-
productList, selectedCurrency, address], () =>
31-
ApiGateway.getShippingCost(productList, selectedCurrency, address)
32-
);
29+
const queryKey = ['shipping', productList, selectedCurrency, address];
30+
const queryFn = () => ApiGateway.getShippingCost(productList, selectedCurrency, address);
31+
const queryOptions: UseQueryOptions<Money, Error> = {
32+
queryKey,
33+
queryFn,
34+
};
35+
const { data: shippingConst = { units: 0, currencyCode: 'USD', nanos: 0 } } = useQuery(queryOptions);
3336

3437
const total = useMemo<Money>(() => {
3538
const nanoSum =

src/frontend/components/ProductCard/ProductCard.styled.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import styled from 'styled-components';
55
import RouterLink from 'next/link';
66

7-
export const Link = styled(RouterLink)``;
7+
export const Link = styled(RouterLink)`
8+
text-decoration: none;
9+
`;
810

911
export const Image = styled.div<{ $src: string }>`
1012
width: 100%;

src/frontend/components/ProductCard/ProductCard.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Product } from '../../protos/demo';
66
import ProductPrice from '../ProductPrice';
77
import * as S from './ProductCard.styled';
88
import { useState, useEffect } from 'react';
9-
import { RequestInfo } from 'undici-types';
109
import { useNumberFlagValue } from '@openfeature/react-sdk';
1110

1211
interface IProps {
@@ -34,11 +33,12 @@ const ProductCard = ({
3433
const [imageSrc, setImageSrc] = useState<string>('');
3534

3635
useEffect(() => {
36+
const requestInfo = new Request('/images/products/' + picture);
3737
const headers = { 'x-envoy-fault-delay-request': imageSlowLoad.toString(), 'Cache-Control': 'no-cache' };
38-
getImageWithHeaders('/images/products/' + picture, headers).then(blob => {
38+
getImageWithHeaders(requestInfo, headers).then(blob => {
3939
setImageSrc(URL.createObjectURL(blob));
4040
});
41-
}, [picture, imageSlowLoad]);
41+
}, [imageSlowLoad, picture]);
4242

4343
return (
4444
<S.Link href={`/product/${id}`}>

0 commit comments

Comments
 (0)