From 8f4c92e66ac737aeba1acd78a1e443d19afdd726 Mon Sep 17 00:00:00 2001 From: Ellie Re'em Date: Fri, 13 Oct 2023 13:10:35 +0200 Subject: [PATCH 1/2] Update next 13.5.4, react 18.2, react-dom 18, react-player 2.13 --- components/common/Link.tsx | 7 +- components/layout/Footer.tsx | 4 +- components/layout/Header.tsx | 6 +- components/storyblok/StoryblokAudio.tsx | 4 +- components/storyblok/StoryblokVideo.tsx | 4 +- components/video/Video.tsx | 22 +- next-env.d.ts | 1 + package.json | 10 +- tsconfig.json | 25 ++- yarn.lock | 280 +++++++++++++----------- 10 files changed, 203 insertions(+), 160 deletions(-) diff --git a/components/common/Link.tsx b/components/common/Link.tsx index b6e61d0da..977f2ecff 100644 --- a/components/common/Link.tsx +++ b/components/common/Link.tsx @@ -36,9 +36,9 @@ export const NextLinkComposed = React.forwardRef - - + ref={ref} + {...other} + /> ); }, ); @@ -89,6 +89,7 @@ const Link = React.forwardRef(function Link(props, { return ( - - {tS(partner.logoAlt)} + + {tS(partner.logoAlt)} {tS(partner.footerLine1)} diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index b7bd43fd7..791ed4949 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -77,11 +77,7 @@ const Header = (props: HeaderProps) => { } = props; const tS = useTranslations('Shared'); - const imageAltText = translatedImageAlt - ? translatedImageAlt - : imageAlt - ? tS(imageAlt) - : undefined; + const imageAltText = translatedImageAlt ? translatedImageAlt : imageAlt ? tS(imageAlt) : ''; return ( diff --git a/components/storyblok/StoryblokAudio.tsx b/components/storyblok/StoryblokAudio.tsx index 45ed3476d..a94c0f378 100644 --- a/components/storyblok/StoryblokAudio.tsx +++ b/components/storyblok/StoryblokAudio.tsx @@ -1,6 +1,8 @@ import { Box } from '@mui/system'; -import ReactPlayer from 'react-player/lazy'; +import dynamic from 'next/dynamic'; import { richtextContentStyle } from '../../styles/common'; +// See React Player Hydration issue https://github.com/cookpete/react-player/issues/1474 +const ReactPlayer = dynamic(() => import('react-player/lazy'), { ssr: false }); const audioContainerStyle = { position: 'relative', diff --git a/components/storyblok/StoryblokVideo.tsx b/components/storyblok/StoryblokVideo.tsx index b6e8ba191..3a863d8d1 100644 --- a/components/storyblok/StoryblokVideo.tsx +++ b/components/storyblok/StoryblokVideo.tsx @@ -1,6 +1,8 @@ import { Box } from '@mui/system'; -import ReactPlayer from 'react-player/lazy'; +import dynamic from 'next/dynamic'; import { richtextContentStyle } from '../../styles/common'; +// See React Player Hydration issue https://github.com/cookpete/react-player/issues/1474 +const ReactPlayer = dynamic(() => import('react-player/lazy'), { ssr: false }); const videoContainerStyle = { position: 'relative', diff --git a/components/video/Video.tsx b/components/video/Video.tsx index 9332e6bf2..2f918091c 100644 --- a/components/video/Video.tsx +++ b/components/video/Video.tsx @@ -1,9 +1,12 @@ -import { Theme } from '@mui/material'; +import { debounce, Theme } from '@mui/material'; import Box from '@mui/material/Box'; import { SxProps } from '@mui/system'; +import dynamic from 'next/dynamic'; import { Dispatch, SetStateAction, useRef, useState } from 'react'; -import ReactPlayer from 'react-player/lazy'; +import { OnProgressProps } from 'react-player/base'; import logEvent from '../../utils/logEvent'; +// See React Player Hydration issue https://github.com/cookpete/react-player/issues/1474 +const ReactPlayer = dynamic(() => import('react-player/lazy'), { ssr: false }); const videoContainerStyle = { position: 'relative', @@ -27,8 +30,9 @@ interface VideoProps { const Video = (props: VideoProps) => { const { url, eventData, eventPrefix, containerStyles, setVideoStarted } = props; const [videoDuration, setVideoDuration] = useState(0); - const player = useRef(null); + const [videoTimePlayed, setVideoTimePlayed] = useState(0); + const player = useRef(null); const videoStarted = () => { setVideoStarted && setVideoStarted(true); if (player.current) { @@ -47,13 +51,12 @@ const Video = (props: VideoProps) => { const videoPausedOrPlayed = (played: boolean) => { if (player.current) { - const currentTime = Math.round(player.current.getCurrentTime()); - const playedPercentage = Math.round((currentTime / videoDuration) * 100); + const playedPercentage = Math.round((videoTimePlayed / videoDuration) * 100); logEvent(played ? `${eventPrefix}_VIDEO_PLAYED` : `${eventPrefix}_VIDEO_PAUSED`, { ...eventData, video_duration: videoDuration, - video_current_time: currentTime, + video_current_time: videoTimePlayed, video_current_percentage: playedPercentage, }); @@ -65,6 +68,12 @@ const Video = (props: VideoProps) => { } } }; + const handleProgress: ((state: OnProgressProps) => void) | undefined = debounce( + (state: OnProgressProps) => { + setVideoTimePlayed(state.playedSeconds); + }, + 300, + ); const containerStyle = { ...containerStyles, @@ -82,6 +91,7 @@ const Video = (props: VideoProps) => { onPause={() => videoPausedOrPlayed(false)} onPlay={() => videoPausedOrPlayed(true)} onEnded={videoEnded} + onProgress={handleProgress} style={videoStyle} width="100%" height="100%" diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03dc..fd36f9494 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/package.json b/package.json index 129ce7cff..feb418b9a 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,15 @@ "gemoji": "^8.1.0", "js-cookie": "^3.0.1", "material-ui-phone-number": "^3.0.0", - "next": "^12.2.5", + "next": "^v13.5.4", "next-intl": "^2.0.5", "next-redux-wrapper": "^8.1.0", "phone": "^3.1.33", - "react": "17.0.2", + "react": "18.2.0", "react-cookie-consent": "^8.0.1", - "react-dom": "17.0.2", + "react-dom": "18.0.0", "react-hotjar": "^5.0.0", - "react-player": "^2.9.0", + "react-player": "^2.13.0", "react-redux": "^8.0.5", "rollbar": "^2.24.0", "sharp": "^0.30.5", @@ -63,6 +63,6 @@ "prettier": "^2.4.1", "react-test-renderer": "^17.0.2", "ts-jest": "^27.0.5", - "typescript": "4.4.3" + "typescript": "4.5.2" } } diff --git a/tsconfig.json b/tsconfig.json index d1b15d5fe..3212ca78a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -13,8 +17,21 @@ "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", - "incremental": true + "incremental": true, + "plugins": [ + { + "name": "next" + } + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules", "cypress"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules", + "cypress" + ] } diff --git a/yarn.lock b/yarn.lock index 6319b2354..984d920c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1373,10 +1373,10 @@ prop-types "^15.7.2" react-is "^17.0.2" -"@next/env@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.5.tgz#d908c57b35262b94db3e431e869b72ac3e1ad3e3" - integrity sha512-vLPLV3cpPGjUPT3PjgRj7e3nio9t6USkuew3JE/jMeon/9Mvp1WyR18v3iwnCuX7eUAm1HmAbJHHLAbcu/EJcw== +"@next/env@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.4.tgz#777c3af16de2cf2f611b6c8126910062d13d222c" + integrity sha512-LGegJkMvRNw90WWphGJ3RMHMVplYcOfRWf2Be3td3sUa+1AaxmsYyANsA+znrGCBjXJNi4XAQlSoEfUxs/4kIQ== "@next/eslint-plugin-next@11.1.2": version "11.1.2" @@ -1385,70 +1385,50 @@ dependencies: glob "7.1.7" -"@next/swc-android-arm-eabi@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.5.tgz#903a5479ab4c2705d9c08d080907475f7bacf94d" - integrity sha512-cPWClKxGhgn2dLWnspW+7psl3MoLQUcNqJqOHk2BhNcou9ARDtC0IjQkKe5qcn9qg7I7U83Gp1yh2aesZfZJMA== - -"@next/swc-android-arm64@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.2.5.tgz#2f9a98ec4166c7860510963b31bda1f57a77c792" - integrity sha512-vMj0efliXmC5b7p+wfcQCX0AfU8IypjkzT64GiKJD9PgiA3IILNiGJr1fw2lyUDHkjeWx/5HMlMEpLnTsQslwg== - -"@next/swc-darwin-arm64@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.5.tgz#31b1c3c659d54be546120c488a1e1bad21c24a1d" - integrity sha512-VOPWbO5EFr6snla/WcxUKtvzGVShfs302TEMOtzYyWni6f9zuOetijJvVh9CCTzInnXAZMtHyNhefijA4HMYLg== - -"@next/swc-darwin-x64@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.5.tgz#2e44dd82b2b7fef88238d1bc4d3bead5884cedfd" - integrity sha512-5o8bTCgAmtYOgauO/Xd27vW52G2/m3i5PX7MUYePquxXAnX73AAtqA3WgPXBRitEB60plSKZgOTkcpqrsh546A== - -"@next/swc-freebsd-x64@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.5.tgz#e24e75d8c2581bfebc75e4f08f6ddbd116ce9dbd" - integrity sha512-yYUbyup1JnznMtEBRkK4LT56N0lfK5qNTzr6/DEyDw5TbFVwnuy2hhLBzwCBkScFVjpFdfiC6SQAX3FrAZzuuw== - -"@next/swc-linux-arm-gnueabihf@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.5.tgz#46d8c514d834d2b5f67086013f0bd5e3081e10b9" - integrity sha512-2ZE2/G921Acks7UopJZVMgKLdm4vN4U0yuzvAMJ6KBavPzqESA2yHJlm85TV/K9gIjKhSk5BVtauIUntFRP8cg== - -"@next/swc-linux-arm64-gnu@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.5.tgz#91f725ac217d3a1f4f9f53b553615ba582fd3d9f" - integrity sha512-/I6+PWVlz2wkTdWqhlSYYJ1pWWgUVva6SgX353oqTh8njNQp1SdFQuWDqk8LnM6ulheVfSsgkDzxrDaAQZnzjQ== - -"@next/swc-linux-arm64-musl@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.5.tgz#e627e8c867920995810250303cd9b8e963598383" - integrity sha512-LPQRelfX6asXyVr59p5sTpx5l+0yh2Vjp/R8Wi4X9pnqcayqT4CUJLiHqCvZuLin3IsFdisJL0rKHMoaZLRfmg== - -"@next/swc-linux-x64-gnu@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.5.tgz#83a5e224fbc4d119ef2e0f29d0d79c40cc43887e" - integrity sha512-0szyAo8jMCClkjNK0hknjhmAngUppoRekW6OAezbEYwHXN/VNtsXbfzgYOqjKWxEx3OoAzrT3jLwAF0HdX2MEw== - -"@next/swc-linux-x64-musl@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.5.tgz#be700d48471baac1ec2e9539396625584a317e95" - integrity sha512-zg/Y6oBar1yVnW6Il1I/08/2ukWtOG6s3acdJdEyIdsCzyQi4RLxbbhkD/EGQyhqBvd3QrC6ZXQEXighQUAZ0g== - -"@next/swc-win32-arm64-msvc@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.5.tgz#a93e958133ad3310373fda33a79aa10af2a0aa97" - integrity sha512-3/90DRNSqeeSRMMEhj4gHHQlLhhKg5SCCoYfE3kBjGpE63EfnblYUqsszGGZ9ekpKL/R4/SGB40iCQr8tR5Jiw== - -"@next/swc-win32-ia32-msvc@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.5.tgz#4f5f7ba0a98ff89a883625d4af0125baed8b2e19" - integrity sha512-hGLc0ZRAwnaPL4ulwpp4D2RxmkHQLuI8CFOEEHdzZpS63/hMVzv81g8jzYA0UXbb9pus/iTc3VRbVbAM03SRrw== - -"@next/swc-win32-x64-msvc@12.2.5": - version "12.2.5" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.5.tgz#20fed129b04a0d3f632c6d0de135345bb623b1e4" - integrity sha512-7h5/ahY7NeaO2xygqVrSG/Y8Vs4cdjxIjowTZ5W6CKoTKn7tmnuxlUc2h74x06FKmbhAd9agOjr/AOKyxYYm9Q== +"@next/swc-darwin-arm64@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.4.tgz#241957774fef3f876dc714cfc0ca6f00f561737e" + integrity sha512-Df8SHuXgF1p+aonBMcDPEsaahNo2TCwuie7VXED4FVyECvdXfRT9unapm54NssV9tF3OQFKBFOdlje4T43VO0w== + +"@next/swc-darwin-x64@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.4.tgz#fa11bb97bf06cd45cbd554354b46bf93e22c025b" + integrity sha512-siPuUwO45PnNRMeZnSa8n/Lye5ZX93IJom9wQRB5DEOdFrw0JjOMu1GINB8jAEdwa7Vdyn1oJ2xGNaQpdQQ9Pw== + +"@next/swc-linux-arm64-gnu@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.4.tgz#dd3a482cd6871ed23b049066a0f3c4c2f955dc88" + integrity sha512-l/k/fvRP/zmB2jkFMfefmFkyZbDkYW0mRM/LB+tH5u9pB98WsHXC0WvDHlGCYp3CH/jlkJPL7gN8nkTQVrQ/2w== + +"@next/swc-linux-arm64-musl@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.4.tgz#ed6d7abaf5712cff2752ce5300d6bacc6aff1b18" + integrity sha512-YYGb7SlLkI+XqfQa8VPErljb7k9nUnhhRrVaOdfJNCaQnHBcvbT7cx/UjDQLdleJcfyg1Hkn5YSSIeVfjgmkTg== + +"@next/swc-linux-x64-gnu@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.4.tgz#977a040388e8a685a3a85e0dbdff90a4ee2a7189" + integrity sha512-uE61vyUSClnCH18YHjA8tE1prr/PBFlBFhxBZis4XBRJoR+txAky5d7gGNUIbQ8sZZ7LVkSVgm/5Fc7mwXmRAg== + +"@next/swc-linux-x64-musl@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.4.tgz#3e29a0ad8efc016196c3a120da04397eea328b2a" + integrity sha512-qVEKFYML/GvJSy9CfYqAdUexA6M5AklYcQCW+8JECmkQHGoPxCf04iMh7CPR7wkHyWWK+XLt4Ja7hhsPJtSnhg== + +"@next/swc-win32-arm64-msvc@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.4.tgz#18a236c3fe5a48d24b56d939e6a05488bb682b7e" + integrity sha512-mDSQfqxAlfpeZOLPxLymZkX0hYF3juN57W6vFHTvwKlnHfmh12Pt7hPIRLYIShk8uYRsKPtMTth/EzpwRI+u8w== + +"@next/swc-win32-ia32-msvc@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.4.tgz#255132243ab6fb20d3c7c92a585e2c4fa50368fe" + integrity sha512-aoqAT2XIekIWoriwzOmGFAvTtVY5O7JjV21giozBTP5c6uZhpvTWRbmHXbmsjZqY4HnEZQRXWkSAppsIBweKqw== + +"@next/swc-win32-x64-msvc@13.5.4": + version "13.5.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.4.tgz#cc542907b55247c5634d9a8298e1c143a1847e25" + integrity sha512-cyRvlAxwlddlqeB9xtPSfNSCRy8BOa4wtMo0IuI9P7Y0XT2qpDrpFKRyZ7kUngZis59mPVla5k8X1oOJ8RxDYg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1568,10 +1548,10 @@ resolved "https://registry.yarnpkg.com/@storyblok/storyblok-editable/-/storyblok-editable-1.1.0.tgz#a355a9ea149d862db262e41514efaf260fbdfb28" integrity sha512-D/OtU2O2pjK+dZaTnWqyhlpz8jGnzZ+8DkZg7O+FTf/r5612RyO7jzRyEkS/opOyYuyFHtw1NwkSVCvnYURf1A== -"@swc/helpers@0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.3.tgz#16593dfc248c53b699d4b5026040f88ddb497012" - integrity sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA== +"@swc/helpers@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.2.tgz#85ea0c76450b61ad7d10a37050289eded783c27d" + integrity sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw== dependencies: tslib "^2.4.0" @@ -2269,6 +2249,13 @@ buffer@^5.5.0, buffer@^5.6.0: base64-js "^1.3.1" ieee754 "^1.1.13" +busboy@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + cachedir@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" @@ -2302,10 +2289,10 @@ caniuse-lite@^1.0.30001261: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001264.tgz#88f625a60efb6724c7c62ac698bc8dbd9757e55b" integrity sha512-Ftfqqfcs/ePiUmyaySsQ4PUsdcYyXG2rfoBVsk3iY1ahHaJEw65vfb7Suzqm+cEkwwPIv/XWkg27iCpRavH4zA== -caniuse-lite@^1.0.30001332: - version "1.0.30001375" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001375.tgz#8e73bc3d1a4c800beb39f3163bf0190d7e5d7672" - integrity sha512-kWIMkNzLYxSvnjy0hL8w1NOaWNr2rn39RTAVyIwcw8juu60bZDWiF1/loOYANzjtJmy6qPgNmn38ro5Pygagdw== +caniuse-lite@^1.0.30001406: + version "1.0.30001547" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz#d4f92efc488aab3c7f92c738d3977c2a3180472b" + integrity sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA== caseless@~0.12.0: version "0.12.0" @@ -2391,6 +2378,11 @@ cli-truncate@^2.1.0: slice-ansi "^3.0.0" string-width "^4.2.0" +client-only@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" + integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== + cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -3542,6 +3534,11 @@ glob-parent@^5.1.2: dependencies: is-glob "^4.0.1" +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + glob@7.1.7: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" @@ -4943,10 +4940,10 @@ nanocolors@^0.2.12: resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.12.tgz#4d05932e70116078673ea4cc6699a1c56cc77777" integrity sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug== -nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +nanoid@^3.3.6: + version "3.3.6" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" + integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== napi-build-utils@^1.0.1: version "1.0.2" @@ -4970,31 +4967,28 @@ next-redux-wrapper@^8.1.0: resolved "https://registry.yarnpkg.com/next-redux-wrapper/-/next-redux-wrapper-8.1.0.tgz#d9c135f1ceeb2478375bdacd356eb9db273d3a07" integrity sha512-2hIau0hcI6uQszOtrvAFqgc0NkZegKYhBB7ZAKiG3jk7zfuQb4E7OV9jfxViqqojh3SEHdnFfPkN9KErttUKuw== -next@^12.2.5: - version "12.2.5" - resolved "https://registry.yarnpkg.com/next/-/next-12.2.5.tgz#14fb5975e8841fad09553b8ef41fe1393602b717" - integrity sha512-tBdjqX5XC/oFs/6gxrZhjmiq90YWizUYU6qOWAfat7zJwrwapJ+BYgX2PmiacunXMaRpeVT4vz5MSPSLgNkrpA== - dependencies: - "@next/env" "12.2.5" - "@swc/helpers" "0.4.3" - caniuse-lite "^1.0.30001332" - postcss "8.4.14" - styled-jsx "5.0.4" - use-sync-external-store "1.2.0" +next@^v13.5.4: + version "13.5.4" + resolved "https://registry.yarnpkg.com/next/-/next-13.5.4.tgz#7e6a93c9c2b9a2c78bf6906a6c5cc73ae02d5b4d" + integrity sha512-+93un5S779gho8y9ASQhb/bTkQF17FNQOtXLKAj3lsNgltEcF0C5PMLLncDmH+8X1EnJH1kbqAERa29nRXqhjA== + dependencies: + "@next/env" "13.5.4" + "@swc/helpers" "0.5.2" + busboy "1.6.0" + caniuse-lite "^1.0.30001406" + postcss "8.4.31" + styled-jsx "5.1.1" + watchpack "2.4.0" optionalDependencies: - "@next/swc-android-arm-eabi" "12.2.5" - "@next/swc-android-arm64" "12.2.5" - "@next/swc-darwin-arm64" "12.2.5" - "@next/swc-darwin-x64" "12.2.5" - "@next/swc-freebsd-x64" "12.2.5" - "@next/swc-linux-arm-gnueabihf" "12.2.5" - "@next/swc-linux-arm64-gnu" "12.2.5" - "@next/swc-linux-arm64-musl" "12.2.5" - "@next/swc-linux-x64-gnu" "12.2.5" - "@next/swc-linux-x64-musl" "12.2.5" - "@next/swc-win32-arm64-msvc" "12.2.5" - "@next/swc-win32-ia32-msvc" "12.2.5" - "@next/swc-win32-x64-msvc" "12.2.5" + "@next/swc-darwin-arm64" "13.5.4" + "@next/swc-darwin-x64" "13.5.4" + "@next/swc-linux-arm64-gnu" "13.5.4" + "@next/swc-linux-arm64-musl" "13.5.4" + "@next/swc-linux-x64-gnu" "13.5.4" + "@next/swc-linux-x64-musl" "13.5.4" + "@next/swc-win32-arm64-msvc" "13.5.4" + "@next/swc-win32-ia32-msvc" "13.5.4" + "@next/swc-win32-x64-msvc" "13.5.4" node-abi@^3.3.0: version "3.8.0" @@ -5346,12 +5340,12 @@ pkg-up@^2.0.0: dependencies: find-up "^2.1.0" -postcss@8.4.14: - version "8.4.14" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" - integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== +postcss@8.4.31: + version "8.4.31" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== dependencies: - nanoid "^3.3.4" + nanoid "^3.3.6" picocolors "^1.0.0" source-map-js "^1.0.2" @@ -5526,14 +5520,13 @@ react-cookie-consent@^8.0.1: dependencies: js-cookie "^2.2.1" -react-dom@17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" - integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== +react-dom@18.0.0: + version "18.0.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.0.0.tgz#26b88534f8f1dbb80853e1eabe752f24100d8023" + integrity sha512-XqX7uzmFo0pUceWFCt7Gff6IyIMzFUn7QMZrbrQfGxtaxXZIcGQzoNpRLE3fQLnS4XzLLPMZX2T9TRcSrasicw== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler "^0.20.2" + scheduler "^0.21.0" react-fast-compare@^3.0.1: version "3.2.0" @@ -5560,10 +5553,10 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react-player@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/react-player/-/react-player-2.9.0.tgz#ef7fe7073434087565f00ff219824e1e02c4b046" - integrity sha512-jNUkTfMmUhwPPAktAdIqiBcVUKsFKrVGH6Ocutj6535CNfM91yrvWxHg6fvIX8Y/fjYUPoejddwh7qboNV9vGA== +react-player@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/react-player/-/react-player-2.13.0.tgz#b6fb252bf70574608ac711f6c83d7057c8fb0c14" + integrity sha512-gkY7ZdbVFztlKFFhCPcnDrFQm+L399b8fhWsKatZ+b2wpKJwfUHBXQFMRxqYQGT0ic1/wQ7D7EZEWy7ZBqk2pw== dependencies: deepmerge "^4.0.0" load-script "^1.0.0" @@ -5611,13 +5604,12 @@ react-transition-group@^4.4.2: loose-envify "^1.4.0" prop-types "^15.6.2" -react@17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" - integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== +react@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" read-pkg-up@^3.0.0: version "3.0.0" @@ -5863,6 +5855,13 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.21.0: + version "0.21.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.21.0.tgz#6fd2532ff5a6d877b6edb12f00d8ab7e8f308820" + integrity sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ== + dependencies: + loose-envify "^1.1.0" + selenium-webdriver@4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.1.2.tgz#d463b4335632d2ea41a9e988e435a55dc41f5314" @@ -6094,6 +6093,11 @@ storyblok-rich-text-react-renderer@^2.9.0: resolved "https://registry.yarnpkg.com/storyblok-rich-text-react-renderer/-/storyblok-rich-text-react-renderer-2.9.0.tgz#a3e77541c6803b8b5a897a6b798e8756ea9de8c1" integrity sha512-AEcWGVrs7Y5O3cFn5kbhy+Odesk5Rf5JTXAhJrFPgIXybrAfVpzZeOUYuIjjPgGvQ3M/f7PieZg/SHUQVq34QA== +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -6199,10 +6203,12 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -styled-jsx@5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.4.tgz#5b1bd0b9ab44caae3dd1361295559706e044aa53" - integrity sha512-sDFWLbg4zR+UkNzfk5lPilyIgtpddfxXEULxhujorr5jtePTUqiPDc5BC0v1NRqTr/WaFBGQQUoYToGlF4B2KQ== +styled-jsx@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.1.tgz#839a1c3aaacc4e735fed0781b8619ea5d0009d1f" + integrity sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw== + dependencies: + client-only "0.0.1" stylis@4.0.13: version "4.0.13" @@ -6480,10 +6486,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== +typescript@4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== unbox-primitive@^1.0.1: version "1.0.1" @@ -6545,7 +6551,7 @@ use-intl@^2.0.5: dependencies: intl-messageformat "^9.3.18" -use-sync-external-store@1.2.0, use-sync-external-store@^1.0.0: +use-sync-external-store@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== @@ -6617,6 +6623,14 @@ walker@^1.0.7: dependencies: makeerror "1.0.x" +watchpack@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From 32ab6dc21bdab09a1b468f76b8e2679ee0ab82b9 Mon Sep 17 00:00:00 2001 From: Ellie Re'em Date: Fri, 13 Oct 2023 15:40:12 +0200 Subject: [PATCH 2/2] Update next-intl to 2.20 and use NextIntlClientProvider --- components/layout/PartnerAdminHeader.tsx | 2 +- package.json | 2 +- pages/_app.tsx | 6 +-- yarn.lock | 48 +++++++++++++++++++----- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/components/layout/PartnerAdminHeader.tsx b/components/layout/PartnerAdminHeader.tsx index 8e5620ecb..2b4873307 100644 --- a/components/layout/PartnerAdminHeader.tsx +++ b/components/layout/PartnerAdminHeader.tsx @@ -33,7 +33,7 @@ const PartnerAdminHeader = (props: PartnerAdminHeaderProps) => { {title} {partnerLogoAlt && partnerLogoSrc && ( - {tS(partnerLogoAlt)} + {tS(partnerLogoAlt)} )} ); diff --git a/package.json b/package.json index feb418b9a..638de8b28 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "js-cookie": "^3.0.1", "material-ui-phone-number": "^3.0.0", "next": "^v13.5.4", - "next-intl": "^2.0.5", + "next-intl": "^2.20.0", "next-redux-wrapper": "^8.1.0", "phone": "^3.1.33", "react": "18.2.0", diff --git a/pages/_app.tsx b/pages/_app.tsx index 70539ae73..594d81415 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -2,7 +2,7 @@ import { CacheProvider, EmotionCache } from '@emotion/react'; import CssBaseline from '@mui/material/CssBaseline'; import { ThemeProvider } from '@mui/material/styles'; // Import the functions you need from the SDKs you need -import { NextIntlProvider } from 'next-intl'; +import { NextIntlClientProvider } from 'next-intl'; import type { AppProps } from 'next/app'; import Head from 'next/head'; import { useRouter } from 'next/router'; @@ -89,7 +89,7 @@ function MyApp(props: MyAppProps) { }; return ( - + Bloom @@ -108,7 +108,7 @@ function MyApp(props: MyAppProps) { - + ); } diff --git a/yarn.lock b/yarn.lock index 984d920c7..9aebfd6a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -948,6 +948,14 @@ "@formatjs/intl-localematcher" "0.2.21" tslib "^2.1.0" +"@formatjs/ecma402-abstract@^1.11.4": + version "1.17.2" + resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.17.2.tgz#d197c6e26b9fd96ff7ba3b3a0cc2f25f1f2dcac3" + integrity sha512-k2mTh0m+IV1HRdU0xXM617tSQTi53tVR2muvYOsBeYcUgEAyxV1FOC7Qj279th3fBVQ+Dj6muvNJZcHSPNdbKg== + dependencies: + "@formatjs/intl-localematcher" "0.4.2" + tslib "^2.4.0" + "@formatjs/fast-memoize@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.2.0.tgz#1123bfcc5d21d761f15d8b1c32d10e1b6530355d" @@ -979,6 +987,20 @@ dependencies: tslib "^2.1.0" +"@formatjs/intl-localematcher@0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.4.2.tgz#7e6e596dbaf2f0c5a7c22da5a01d5c55f4c37e9a" + integrity sha512-BGdtJFmaNJy5An/Zan4OId/yR9Ih1OojFjcduX/xOvq798OgWSyDtd6Qd5jqJXwJs1ipe4Fxu9+cshic5Ox2tA== + dependencies: + tslib "^2.4.0" + +"@formatjs/intl-localematcher@^0.2.32": + version "0.2.32" + resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.32.tgz#00d4d307cd7d514b298e15a11a369b86c8933ec1" + integrity sha512-k/MEBstff4sttohyEpXxCmC3MqbUn9VvHGlZ8fauLzkbwXmVrEeyzS+4uhrvAk9DWU9/7otYWxyDox4nT/KVLQ== + dependencies: + tslib "^2.4.0" + "@grpc/grpc-js@^1.3.2": version "1.4.4" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.4.4.tgz#59336f13d77bc446bbdf2161564a32639288dc5b" @@ -4955,12 +4977,19 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -next-intl@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/next-intl/-/next-intl-2.0.5.tgz#af9d8247284bddc4fcd58755bf18bc604c45f0c6" - integrity sha512-5oY4kPDARPI4HkeTGGvPXVHB7FIWD8boEGiUwrQn2VHQdeNvbo7K5N3tX92BAz2yeYRxMo6/Gola+hJo9ZoqzQ== +negotiator@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +next-intl@^2.20.0: + version "2.20.2" + resolved "https://registry.yarnpkg.com/next-intl/-/next-intl-2.20.2.tgz#c7045fb9f5d915d01661cd81896db1e21c50d549" + integrity sha512-28IarFfRzuOjPo6fjAY2RMWVdeejuvzW7jzwVnBfHU6EB0GYwQPWIq1G5YK4gWb44R6dqnjjVDqphWrLwKE+Vw== dependencies: - use-intl "^2.0.5" + "@formatjs/intl-localematcher" "^0.2.32" + negotiator "^0.6.3" + use-intl "^2.20.2" next-redux-wrapper@^8.1.0: version "8.1.0" @@ -6544,11 +6573,12 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -use-intl@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/use-intl/-/use-intl-2.0.5.tgz#436febab07dc3985be83be495e6cd64bfc0d62a5" - integrity sha512-akFJE2ElSxguSPRwnwk+Xj/f1Dv7i3i87UL9f9mspDeBzyNYU9iyyZHu6Nw+GFQXpHVuCXA5lBUANw03PiDyig== +use-intl@^2.20.2: + version "2.20.2" + resolved "https://registry.yarnpkg.com/use-intl/-/use-intl-2.20.2.tgz#f57c3ed83ad86ffe30f6c3af41236396363e2b37" + integrity sha512-Mvd16M2nAlXcOqm17jWCK69DmsSgn4h9dgvcZ6UbYAzdJQiuu5TFBVxd1f3xRRs2qXb94/E2j/1AcqzmN9TMtg== dependencies: + "@formatjs/ecma402-abstract" "^1.11.4" intl-messageformat "^9.3.18" use-sync-external-store@^1.0.0: