A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
perf(web): remove homepage video from the LCP path
Amruth Pillai1e665fbe7e5a
diff --git a/apps/web/index.html b/apps/web/index.htmlindex 8a8ae51f5..8ae633e64 100644--- a/apps/web/index.html+++ b/apps/web/index.html@@ -16,7 +16,7 @@<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" type="image/png" sizes="180x180 any" /><link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials" />- <title>Reactive Resume</title>+ <title>Reactive Resume — A free and open-source resume builder</title></head><body><!-- Keep #app empty: main.tsx only mounts React when rootElement has no children. -->@@ -56,6 +56,6 @@clip: rect(0 0 0 0);}</style>- <script type="module" src="/src/main.tsx"></script>+ <script type="module" data-cfasync="false" src="/src/main.tsx"></script></body></html>diff --git a/apps/web/public/videos/timelapse.mp4 b/apps/web/public/videos/timelapse-v1.mp4similarity index 100%rename from apps/web/public/videos/timelapse.mp4rename to apps/web/public/videos/timelapse-v1.mp4diff --git a/apps/web/public/videos/timelapse-v1.webp b/apps/web/public/videos/timelapse-v1.webpnew file mode 100644index 000000000..6fd9f69f4Binary files /dev/null and b/apps/web/public/videos/timelapse-v1.webp differdiff --git a/apps/web/src/routes/_home/-sections/hero.test.tsx b/apps/web/src/routes/_home/-sections/hero.test.tsxnew file mode 100644index 000000000..9838abf0d--- /dev/null+++ b/apps/web/src/routes/_home/-sections/hero.test.tsx@@ -0,0 +1,48 @@+// @vitest-environment happy-dom++import type { PropsWithChildren } from "react";+import { render } from "@testing-library/react";+import { describe, expect, it, vi } from "vitest";+import { i18n } from "@lingui/core";+import { I18nProvider } from "@lingui/react";++type LinkProps = PropsWithChildren<{+ to: string;+}>;++vi.mock("@tanstack/react-router", () => ({+ Link: ({ children, to, ...rest }: LinkProps) => (+ <a href={to} {...rest}>+ {children}+ </a>+ ),+}));++vi.mock("@/components/animation/comet-card", () => ({+ CometCard: ({ children }: PropsWithChildren) => <div>{children}</div>,+}));++vi.mock("@/components/animation/spotlight", () => ({+ Spotlight: () => <div data-testid="spotlight" />,+}));++i18n.loadAndActivate({ locale: "en", messages: {} });++const { Hero } = await import("./hero");++describe("Hero", () => {+ it("shows a poster and waits for user interaction before loading the video", () => {+ const { container } = render(+ <I18nProvider i18n={i18n}>+ <Hero />+ </I18nProvider>,+ );+ const video = container.querySelector("video");++ expect(video).toHaveAttribute("poster", "/videos/timelapse-v1.webp");+ expect(video).toHaveAttribute("preload", "none");+ expect(video).toHaveAttribute("src", "/videos/timelapse-v1.mp4");+ expect(video).toHaveAttribute("controls");+ expect(video).not.toHaveAttribute("autoplay");+ });+});diff --git a/apps/web/src/routes/_home/-sections/hero.tsx b/apps/web/src/routes/_home/-sections/hero.tsxindex 1f3b7cb3d..901af6ac4 100644--- a/apps/web/src/routes/_home/-sections/hero.tsx+++ b/apps/web/src/routes/_home/-sections/hero.tsx@@ -29,15 +29,15 @@ export function Hero() {<videoloopmuted- autoPlay+ controlsplaysInline+ preload="none"width={1146}height={720}- src="/videos/timelapse.mp4"+ poster="/videos/timelapse-v1.webp"+ src="/videos/timelapse-v1.mp4"aria-label={t`Timelapse demonstration of building a resume with Reactive Resume`}- // Reserve the intrinsic aspect ratio so the box height is known before the video- // metadata loads — otherwise it reflows the centered hero column and causes CLS (~0.10).- className="pointer-events-none aspect-[1146/720] w-full rounded-md border object-cover"+ className="aspect-[1146/720] w-full rounded-md border object-cover"/><divdiff --git a/apps/web/src/routes/_home/index.tsx b/apps/web/src/routes/_home/index.tsxindex e188f2cb3..67e01e842 100644--- a/apps/web/src/routes/_home/index.tsx+++ b/apps/web/src/routes/_home/index.tsx@@ -18,7 +18,10 @@ export const Route = createFileRoute("/_home/")({const canonicalUrl = getCanonicalRootUrl(appUrl);return {- links: [{ rel: "canonical", href: canonicalUrl }],+ links: [+ { rel: "canonical", href: canonicalUrl },+ { rel: "preload", href: "/videos/timelapse-v1.webp", as: "image", fetchPriority: "high" },+ ],scripts: [createRootStructuredDataScript(canonicalUrl)],};},