From 18eef34aae22efd9f2b36c06abaae8272e44c178 Mon Sep 17 00:00:00 2001 From: Jim O'Donnell Date: Sat, 31 Aug 2024 16:40:32 +0100 Subject: [PATCH 1/5] refactor(lib-content): use lite-youtube-embed for video embeds Use `YouTubeEmbed`, from `@next/third-parties/google`, for video embeds on the home page. This should reduce the JS download size by ~2.5MB per video. --- packages/lib-content/package.json | 1 + .../DefaultHome/components/Introduction.js | 11 +++++----- .../DefaultHome/components/Researchers.js | 21 +++++++++---------- yarn.lock | 12 +++++++++++ 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/lib-content/package.json b/packages/lib-content/package.json index 167f19fa2d..f3fa32364b 100644 --- a/packages/lib-content/package.json +++ b/packages/lib-content/package.json @@ -30,6 +30,7 @@ "build-storybook": "storybook build" }, "dependencies": { + "@next/third-parties": "~14.2.7", "@zooniverse/async-states": "~0.0.1", "@zooniverse/react-components": "~1.13.0", "dayjs": "~1.11.11", diff --git a/packages/lib-content/src/screens/Home/DefaultHome/components/Introduction.js b/packages/lib-content/src/screens/Home/DefaultHome/components/Introduction.js index 7fb573d810..04770dac98 100644 --- a/packages/lib-content/src/screens/Home/DefaultHome/components/Introduction.js +++ b/packages/lib-content/src/screens/Home/DefaultHome/components/Introduction.js @@ -6,6 +6,7 @@ import { useTranslation } from '../../../../translations/i18n.js' import Stats from '../../../../components/Stats/Stats.js' import SubHeading from '../../../../components/HeadingForAboutNav/SubHeading.js' +import { YouTubeEmbed } from '@next/third-parties/google' const StyledSignIn = styled(Button)` width: 47%; @@ -115,13 +116,11 @@ export default function Introduction() { -