Skip to content

Commit f7dacee

Browse files
authored
fix: pass all scene data to Remotion + eliminate ISR write explosion
Two urgent fixes:\n\n1. mapInputProps() now spreads full scene object (...s) instead of cherry-picking 6 fields. This passes sceneType, code, comparison, mockup, list, infographicUrl, and wordTimestamps through to Remotion — enabling all 6 scene components (CodeMorph, ComparisonGrid, IsometricMockup, DynamicList, InfographicScene, narration).\n\n2. ISR write explosion fix: removed generateStaticParams from 11 pages, removed revalidate exports from 17 pages (all use defineLive/sanityFetch for real-time updates). Webhook now skips pipeline doc types (automatedVideo, contentIdea, sponsorLead, config singletons) that were triggering mass revalidation on every cron run.
1 parent e4d2a98 commit f7dacee

File tree

19 files changed

+38
-125
lines changed

19 files changed

+38
-125
lines changed

app/(main)/(author)/author/[slug]/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Metadata, ResolvingMetadata } from "next";
2-
import { groq, type PortableTextBlock } from "next-sanity";
2+
import { type PortableTextBlock } from "next-sanity";
33
import { notFound } from "next/navigation";
44

55
import PortableText from "@/components/portable-text";
@@ -9,7 +9,6 @@ import type {
99
AuthorQueryWithRelatedResult,
1010
} from "@/sanity/types";
1111
import { sanityFetch } from "@/sanity/lib/live";
12-
import { client } from "@/sanity/lib/client";
1312
import { authorQuery, authorQueryWithRelated } from "@/sanity/lib/queries";
1413
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
1514
import CoverMedia from "@/components/cover-media";
@@ -20,7 +19,6 @@ import UserRelated from "@/components/user-related";
2019

2120
type Params = Promise<{ slug: string }>;
2221

23-
export const revalidate = 3600;
2422

2523
export async function generateMetadata(
2624
{ params }: { params: Params },
@@ -48,12 +46,6 @@ export async function generateMetadata(
4846
} satisfies Metadata;
4947
}
5048

51-
export async function generateStaticParams() {
52-
const slugs = await client.fetch<string[]>(
53-
groq`*[_type == "author" && defined(slug.current)].slug.current`,
54-
);
55-
return slugs.map((slug) => ({ slug }));
56-
}
5749

5850
export default async function AuthorPage({ params }: { params: Params }) {
5951
const { slug } = await params;

app/(main)/(author)/authors/page/[num]/page.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
import MoreContent from "@/components/more-content";
22
import type { DocCountResult } from "@/sanity/types";
33
import { sanityFetch } from "@/sanity/lib/live";
4-
import { client } from "@/sanity/lib/client";
54

65
import PaginateList from "@/components/paginate-list";
76
import { docCount } from "@/sanity/lib/queries";
8-
import { groq } from "next-sanity";
97

108
const LIMIT = 10;
119

1210
type Params = Promise<{ num: string }>;
1311

14-
export const revalidate = 60;
1512

16-
export async function generateStaticParams() {
17-
const count = await client.fetch<number>(
18-
groq`count(*[_type == "author" && defined(slug.current)])`,
19-
);
20-
const perPage = LIMIT;
21-
const pages = Math.ceil(count / perPage);
22-
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
23-
}
2413

2514
export default async function Page({ params }: { params: Params }) {
2615
const { num } = await params;

app/(main)/(guest)/guest/[slug]/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Metadata, ResolvingMetadata } from "next";
2-
import { groq, type PortableTextBlock } from "next-sanity";
2+
import { type PortableTextBlock } from "next-sanity";
33
import { notFound } from "next/navigation";
44

55
import PortableText from "@/components/portable-text";
@@ -9,7 +9,6 @@ import type {
99
GuestQueryWithRelatedResult,
1010
} from "@/sanity/types";
1111
import { sanityFetch } from "@/sanity/lib/live";
12-
import { client } from "@/sanity/lib/client";
1312
import { guestQuery, guestQueryWithRelated } from "@/sanity/lib/queries";
1413
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
1514
import CoverMedia from "@/components/cover-media";
@@ -21,7 +20,6 @@ import Avatar from "@/components/avatar";
2120

2221
type Params = Promise<{ slug: string }>;
2322

24-
export const revalidate = 3600;
2523

2624
export async function generateMetadata(
2725
{ params }: { params: Params },
@@ -48,12 +46,6 @@ export async function generateMetadata(
4846
} satisfies Metadata;
4947
}
5048

51-
export async function generateStaticParams() {
52-
const slugs = await client.fetch<string[]>(
53-
groq`*[_type == "guest" && defined(slug.current)].slug.current`,
54-
);
55-
return slugs.map((slug) => ({ slug }));
56-
}
5749

5850
export default async function GuestPage({ params }: { params: Params }) {
5951
const { slug } = await params;

app/(main)/(guest)/guests/page/[num]/page.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
import MoreContent from "@/components/more-content";
22
import type { DocCountResult } from "@/sanity/types";
33
import { sanityFetch } from "@/sanity/lib/live";
4-
import { client } from "@/sanity/lib/client";
54

65
import PaginateList from "@/components/paginate-list";
76
import { docCount } from "@/sanity/lib/queries";
8-
import { groq } from "next-sanity";
97

108
const LIMIT = 10;
119

1210
type Params = Promise<{ num: string }>;
1311

14-
export const revalidate = 60;
1512

16-
export async function generateStaticParams() {
17-
const count = await client.fetch<number>(
18-
groq`count(*[_type == "guest" && defined(slug.current)])`,
19-
);
20-
const perPage = LIMIT;
21-
const pages = Math.ceil(count / perPage);
22-
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
23-
}
2413

2514
export default async function Page({ params }: { params: Params }) {
2615
const [count] = (

app/(main)/(podcast)/podcast/[slug]/page.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import type { Metadata, ResolvingMetadata } from "next";
22
import { notFound } from "next/navigation";
33
import type { PodcastQueryResult } from "@/sanity/types";
44
import { sanityFetch } from "@/sanity/lib/live";
5-
import { client } from "@/sanity/lib/client";
65
import { podcastQuery } from "@/sanity/lib/queries";
76
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
87
import Podcast from "../Podcast";
9-
import { groq } from "next-sanity";
108

119
type Params = Promise<{ slug: string }>;
1210

13-
export const revalidate = 3600;
1411

1512
export async function generateMetadata(
1613
{ params }: { params: Params },
@@ -41,12 +38,6 @@ export async function generateMetadata(
4138
} satisfies Metadata;
4239
}
4340

44-
export async function generateStaticParams() {
45-
const slugs = await client.fetch<string[]>(
46-
groq`*[_type == "podcast" && defined(slug.current)].slug.current`,
47-
);
48-
return slugs.map((slug) => ({ slug }));
49-
}
5041

5142
export default async function PodcastPage({ params }: { params: Params }) {
5243
const { slug } = await params;

app/(main)/(podcast)/podcasts/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import MoreHeader from "@/components/more-header";
1616

1717
import PodmatchBadge from "@/components/podmatch-badge";
1818

19-
export const revalidate = 60;
2019
function HeroPodcast({
2120
title,
2221
slug,

app/(main)/(podcast)/podcasts/page/[num]/page.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
import MoreContent from "@/components/more-content";
22
import type { DocCountResult } from "@/sanity/types";
33
import { sanityFetch } from "@/sanity/lib/live";
4-
import { client } from "@/sanity/lib/client";
54

65
import PaginateList from "@/components/paginate-list";
76
import { docCount } from "@/sanity/lib/queries";
8-
import { groq } from "next-sanity";
97

108
const LIMIT = 10;
119

1210
type Params = Promise<{ num: string }>;
1311

14-
export const revalidate = 60;
1512

16-
export async function generateStaticParams() {
17-
const count = await client.fetch<number>(
18-
groq`count(*[_type == "podcast" && defined(slug.current)])`,
19-
);
20-
const perPage = LIMIT;
21-
const pages = Math.ceil(count / perPage);
22-
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
23-
}
2413

2514
export default async function Page({ params }: { params: Params }) {
2615
const [count] = (

app/(main)/(post)/blog/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { Separator } from "@/components/ui/separator";
1515

1616
import MoreHeader from "@/components/more-header";
1717

18-
export const revalidate = 60;
1918
function HeroPost({
2019
title,
2120
slug,

app/(main)/(post)/blog/page/[num]/page.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
import MoreContent from "@/components/more-content";
22
import type { DocCountResult } from "@/sanity/types";
33
import { sanityFetch } from "@/sanity/lib/live";
4-
import { client } from "@/sanity/lib/client";
54

65
import PaginateList from "@/components/paginate-list";
76
import { docCount } from "@/sanity/lib/queries";
8-
import { groq } from "next-sanity";
97

108
const LIMIT = 10;
119

1210
type Params = Promise<{ num: string }>;
1311

14-
export const revalidate = 60;
1512

16-
export async function generateStaticParams() {
17-
const count = await client.fetch<number>(
18-
groq`count(*[_type == "post" && defined(slug.current)])`,
19-
);
20-
const perPage = LIMIT;
21-
const pages = Math.ceil(count / perPage);
22-
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
23-
}
2413

2514
export default async function Page({ params }: { params: Params }) {
2615
const [count] = (

app/(main)/(post)/post/[slug]/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Metadata, ResolvingMetadata } from "next";
2-
import { groq, type PortableTextBlock } from "next-sanity";
2+
import { type PortableTextBlock } from "next-sanity";
33
import { notFound } from "next/navigation";
44
import { Suspense } from "react";
55

@@ -10,7 +10,6 @@ import PortableText from "@/components/portable-text";
1010

1111
import type { PostQueryResult } from "@/sanity/types";
1212
import { sanityFetch } from "@/sanity/lib/live";
13-
import { client } from "@/sanity/lib/client";
1413
import { postQuery } from "@/sanity/lib/queries";
1514
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
1615
import CoverMedia from "@/components/cover-media";
@@ -20,7 +19,6 @@ import SponsorCard from "@/components/sponsor-card";
2019

2120
type Params = Promise<{ slug: string }>;
2221

23-
export const revalidate = 3600;
2422

2523
export async function generateMetadata(
2624
{ params }: { params: Params },
@@ -51,12 +49,6 @@ export async function generateMetadata(
5149
} satisfies Metadata;
5250
}
5351

54-
export async function generateStaticParams() {
55-
const slugs = await client.fetch<string[]>(
56-
groq`*[_type == "post" && defined(slug.current)].slug.current`,
57-
);
58-
return slugs.map((slug) => ({ slug }));
59-
}
6052

6153
export default async function PostPage({ params }: { params: Params }) {
6254
const { slug } = await params;

0 commit comments

Comments
 (0)