From 8df670861f40a762684f936fb968e3fbde4f63ba Mon Sep 17 00:00:00 2001 From: Cody Olsen <81981+stipsan@users.noreply.github.com> Date: Tue, 22 Oct 2024 01:24:57 +0200 Subject: [PATCH] fix: stop inlining rxjs and `@sanity/comlink` (#2012) --- .../app/(website)/[locale]/[...path]/page.tsx | 5 +- .../app/(website)/[locale]/layout.tsx | 9 +- .../app/(website)/[locale]/page.tsx | 5 +- .../app/api/disable-draft/route.ts | 4 +- apps/next-with-i18n/app/api/draft/route.ts | 2 +- apps/next-with-i18n/data/sanity/loadQuery.ts | 2 +- .../src/app/api/draft-mode/disable/route.ts | 4 +- apps/next/src/app/compat/layout.tsx | 4 +- apps/next/src/app/compat/page.tsx | 4 +- .../src/app/only-visual-editing/layout.tsx | 6 +- .../next/src/app/only-visual-editing/page.tsx | 4 +- apps/next/src/app/shoes/[slug]/page.tsx | 8 +- apps/next/src/app/shoes/layout.tsx | 4 +- apps/next/src/app/shoes/page.tsx | 4 +- apps/next/src/app/shoes/sanity.ssr.ts | 7 +- apps/page-builder-demo/src/app/layout.tsx | 4 +- .../src/app/pages/[slug]/page.tsx | 4 +- .../src/app/product/[slug]/page.tsx | 7 +- .../src/app/project/[slug]/page.tsx | 7 +- packages/core-loader/package.json | 4 +- packages/preview-kit-compat/package.json | 4 +- packages/visual-editing-helpers/package.json | 1 + packages/visual-editing/package.config.ts | 1 + packages/visual-editing/package.json | 3 +- pnpm-lock.yaml | 285 ++++-------------- 25 files changed, 126 insertions(+), 266 deletions(-) diff --git a/apps/next-with-i18n/app/(website)/[locale]/[...path]/page.tsx b/apps/next-with-i18n/app/(website)/[locale]/[...path]/page.tsx index 36f442e09..f0f75d182 100644 --- a/apps/next-with-i18n/app/(website)/[locale]/[...path]/page.tsx +++ b/apps/next-with-i18n/app/(website)/[locale]/[...path]/page.tsx @@ -2,10 +2,11 @@ import { Page } from '@/components/Page' import { loadPage } from '@/data/sanity' export default async function DynamicRoute({ - params: { path, locale }, + params, }: { - params: { path: string[]; locale: string } + params: Promise<{ path: string[]; locale: string }> }) { + const { path, locale } = await params const pathname = `/${path.join('/')}` const data = await loadPage(pathname, locale) diff --git a/apps/next-with-i18n/app/(website)/[locale]/layout.tsx b/apps/next-with-i18n/app/(website)/[locale]/layout.tsx index d3a0edcd8..8e3a4dce1 100644 --- a/apps/next-with-i18n/app/(website)/[locale]/layout.tsx +++ b/apps/next-with-i18n/app/(website)/[locale]/layout.tsx @@ -18,21 +18,22 @@ const sans = Inter({ }) export default async function RootLayout({ - params: { locale }, + params, children, }: { - params: { locale: string } + params: Promise<{ locale: string }> children: React.ReactNode }) { + const { locale } = await params return (
{children} - {draftMode().isEnabled && ( + {(await draftMode()).isEnabled && (