diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index e6d79ae34e..e61cbba79e 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -30,11 +30,10 @@ if ( !process.env.NEXT_BLOG_ORIGIN && "BLOG_ORIGIN is required in production", ] .filter(Boolean) - .join("; ") + .join("; "), ); } - const ContentSecurityPolicy = ` default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' @@ -246,7 +245,7 @@ const config = { allowedDevOrigins, reactStrictMode: true, images: { - unoptimized: true, + unoptimized: false, remotePatterns: [ { protocol: "https", @@ -750,9 +749,8 @@ const config = { destination: "https://accelerate-speed-test.vercel.app/:path*", }, - - // Proxy canonical docs path to docs infrastructure - { + // Proxy canonical docs path to docs infrastructure + { source: "/docs", destination: `${DOCS_ORIGIN}/docs`, missing: [{ type: "host", value: DOCS_ORIGIN_HOST }], @@ -799,7 +797,6 @@ const config = { // Pages // TODO We have a redirect for this above to /careers, so should probably be removed here? - { source: "/dataguide/:any*", destination: "https://dataguide.vercel.app/dataguide/:any*", diff --git a/apps/site/src/app/about/page.tsx b/apps/site/src/app/about/page.tsx index a472e78757..78ef7d29e1 100644 --- a/apps/site/src/app/about/page.tsx +++ b/apps/site/src/app/about/page.tsx @@ -1,3 +1,4 @@ +import Image from "next/image"; import Antigravity from "../../components/homepage/antigravity"; import { createPageMetadata } from "@/lib/page-metadata"; import { @@ -338,15 +339,19 @@ export default function About() {
- Hero lines - Hero lines
@@ -397,7 +402,14 @@ export default function About() { target="_blank" rel="noopener noreferrer" > - {company.name} + {company.name} ))}
@@ -406,10 +418,13 @@ export default function About() { {investors.people.map((investor: any, idx: number) => (
- {investor.name}
diff --git a/apps/site/src/app/careers/page.tsx b/apps/site/src/app/careers/page.tsx index f61142f69e..d2e6707c51 100644 --- a/apps/site/src/app/careers/page.tsx +++ b/apps/site/src/app/careers/page.tsx @@ -1,4 +1,5 @@ import type { Metadata } from "next"; +import Image from "next/image"; import { Action, Button } from "@prisma/eclipse"; import { CardSection } from "@/components/homepage/card-section/card-section"; import { StatsList } from "@/components/careers/stats-list"; @@ -184,15 +185,19 @@ export default function Careers() {
- Hero lines - Hero lines
diff --git a/apps/site/src/app/client/page.tsx b/apps/site/src/app/client/page.tsx index 2848f7351d..1003a2b26b 100644 --- a/apps/site/src/app/client/page.tsx +++ b/apps/site/src/app/client/page.tsx @@ -1,3 +1,4 @@ +import Image from "next/image"; import { createPageMetadata } from "@/lib/page-metadata"; import { Action, Button, Card } from "@prisma/eclipse"; import API from "@/components/client/api"; @@ -235,7 +236,13 @@ export default function Client() { size="4xl" className="h-[75px]! w-[75px]! hover:bg-background-neutral-strong" > - {db.name} + {db.name} ))} @@ -258,7 +265,13 @@ export default function Client() { size="4xl" className="h-[75px]! w-[75px]! hover:bg-background-neutral-strong" > - {fw.name} + {fw.name} ))} diff --git a/apps/site/src/app/orm/page.tsx b/apps/site/src/app/orm/page.tsx index b4a4a7bab7..ae908498da 100644 --- a/apps/site/src/app/orm/page.tsx +++ b/apps/site/src/app/orm/page.tsx @@ -8,6 +8,7 @@ import { InfoStats } from "@/components/orm/info-stats"; import { cn } from "@/lib/cn"; import { Card as FeatureCard } from "@/components/homepage/bento"; import { YouTubePlayer } from "@prisma-docs/ui/components/youtube-player"; +import Image from "next/image"; const statsSection = [ { @@ -334,13 +335,9 @@ export default function ORM() { - {stat.title} + {stat.title}

{stat.title} diff --git a/apps/site/src/components/homepage/bento.tsx b/apps/site/src/components/homepage/bento.tsx index 16a08757c7..c26a4209bc 100644 --- a/apps/site/src/components/homepage/bento.tsx +++ b/apps/site/src/components/homepage/bento.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import Link from "next/link"; +import Image from "next/image"; import { Action } from "@prisma/eclipse"; import { cn } from "@prisma-docs/ui/lib/cn"; import { useTheme } from "@prisma-docs/ui/components/theme-provider"; @@ -193,14 +194,16 @@ export const Card = ({ card, color }: CardProps) => {

{card.image && ( - // eslint-disable-next-line @next/next/no-img-element - {card.title} )} diff --git a/apps/site/src/components/homepage/card-section/card-section.tsx b/apps/site/src/components/homepage/card-section/card-section.tsx index 03fee4e849..b679139b65 100644 --- a/apps/site/src/components/homepage/card-section/card-section.tsx +++ b/apps/site/src/components/homepage/card-section/card-section.tsx @@ -6,6 +6,7 @@ import { useInView } from "react-intersection-observer"; import { cn } from "../../../lib/cn"; import { useTheme } from "@prisma-docs/ui/components/theme-provider"; import { Action } from "@prisma/eclipse"; +import Image from "next/image"; interface TwoColumnItem { content: ReactNode; @@ -166,8 +167,8 @@ export const CardSection = ({ cardSection }: CardSectionProps) => { )} {item.visualType === "image" && item.imageUrl && ( -
- + { : `${item.imageUrl}.svg` } alt={item.imageAlt || ""} + width={1200} + height={800} + priority={index === 0} + loading={index === 0 ? "eager" : "lazy"} /> {item.mobileImageUrl && ( - { : `${item.mobileImageUrl}.svg` } alt={item.mobileImageAlt || ""} + width={800} + height={600} + priority={index === 0} + loading={index === 0 ? "eager" : "lazy"} /> )}
diff --git a/apps/site/src/components/homepage/testimonials/testimonial-item.tsx b/apps/site/src/components/homepage/testimonials/testimonial-item.tsx index 0eafcb806f..f456ee6929 100644 --- a/apps/site/src/components/homepage/testimonials/testimonial-item.tsx +++ b/apps/site/src/components/homepage/testimonials/testimonial-item.tsx @@ -44,6 +44,7 @@ export const TestimonialItem = ({ imageUrl || "https://avatar.vercel.sh/" + encodeURIComponent(author) } alt={imageAlt || `Profile photo of ${author}`} + loading="lazy" >
- {item.label} diff --git a/apps/site/src/components/postgres.tsx b/apps/site/src/components/postgres.tsx index 046a683914..8516ddefc3 100644 --- a/apps/site/src/components/postgres.tsx +++ b/apps/site/src/components/postgres.tsx @@ -1,5 +1,6 @@ "use client"; +import Image from "next/image"; import parse from "html-react-parser"; import { CodeBlock, @@ -63,36 +64,54 @@ export function PostgresTabs({ data }: { data: HowSectionData }) { {body.image && ( <> {/* Dark mode images - only visible in dark mode */} - {body.title} - {body.title} - {body.title} {/* Light mode images - only visible in light mode */} - {body.title} - {body.title} - {body.title} diff --git a/apps/site/src/components/prisma-with/community-section.tsx b/apps/site/src/components/prisma-with/community-section.tsx index 8a11e93c2f..4139b78995 100644 --- a/apps/site/src/components/prisma-with/community-section.tsx +++ b/apps/site/src/components/prisma-with/community-section.tsx @@ -1,3 +1,4 @@ +import Image from "next/image"; import parse from "html-react-parser"; import { cn } from "../../lib/cn"; import { Card, Action } from "@prisma/eclipse"; @@ -45,9 +46,12 @@ export function CommunitySection({ data }: { data: CommunitySectionData }) { className="self-start flex-none" > {card.image ? ( - ) : ( diff --git a/apps/site/src/components/prisma-with/hero.tsx b/apps/site/src/components/prisma-with/hero.tsx index db165f8c50..53ff858ce4 100644 --- a/apps/site/src/components/prisma-with/hero.tsx +++ b/apps/site/src/components/prisma-with/hero.tsx @@ -1,3 +1,4 @@ +import Image from "next/image"; import parse from "html-react-parser"; import { cn } from "../../lib/cn"; import { Button } from "@prisma/eclipse"; @@ -66,36 +67,56 @@ export function Hero({ data }: { data: HeroData }) {
- {`Prisma + > + {`Prisma +
{data.imageUrlLight && ( - {`Prisma + > + {`Prisma +
)}
- Prisma - Prisma +
+ Prisma +
+
+ Prisma +
diff --git a/packages/eclipse/src/components/avatar.tsx b/packages/eclipse/src/components/avatar.tsx index d0caeb01c8..af305de48c 100644 --- a/packages/eclipse/src/components/avatar.tsx +++ b/packages/eclipse/src/components/avatar.tsx @@ -66,6 +66,10 @@ export interface AvatarProps extends Omit< * Alt text for image format */ alt?: string; + /** + * Loading behavior for image format + */ + loading?: "lazy" | "eager"; /** * Icon or initials content */ @@ -108,6 +112,7 @@ const Avatar = React.forwardRef( format = "image", src, alt, + loading, children, ...props }, @@ -123,6 +128,7 @@ const Avatar = React.forwardRef( {alt ) : ( diff --git a/packages/ui/src/components/footer.tsx b/packages/ui/src/components/footer.tsx index d293cea09e..0f061ca4b1 100644 --- a/packages/ui/src/components/footer.tsx +++ b/packages/ui/src/components/footer.tsx @@ -85,7 +85,7 @@ const Footer = ({ >
{/* Logo and Social Links Column */} -
+
{Logo}