feat!: update next@15.0.0-canary.173, react@19.0.0-rc-3edc000d-20240926 (#8489)

Updates the minimal supported versions of next.js to
[`15.0.0-canary.173`](https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.173)
and react to `19.0.0-rc-3edc000d-20240926`.

Adds neccessary awaits according to this breaking change
https://github.com/vercel/next.js/pull/68812

## Breaking Changes

The `params` and `searchParams` types in
`app/(payload)/admin/[[...segments]]/page.tsx` and
`app/(payload)/admin/[[...segments]]/not-found.tsx` must be changed to
promises:

```diff
- type Args = {
-   params: {
-     segments: string[]
-   }
-   searchParams: {
-     [key: string]: string | string[]
-   }
- }

+ type Args = {
+   params: Promise<{
+     segments: string[]
+   }>
+   searchParams: Promise<{
+     [key: string]: string | string[]
+   }>
+ }

```
This commit is contained in:
Sasha
2024-10-01 20:16:11 +03:00
committed by GitHub
parent d80410b228
commit fa59d4c0b2
27 changed files with 499 additions and 344 deletions

View File

@@ -7,8 +7,12 @@ import { getDoc } from '../../_api/getDoc.js'
import { getDocs } from '../../_api/getDocs.js'
import { PageClient } from './page.client.js'
export default async function Page({ params: { slug = 'home' } }) {
let page: Page | null = null
type Args = {
params: Promise<{ slug?: string }>
}
export default async function Page({ params: paramsPromise }: Args) {
const { slug = 'home' } = await paramsPromise
let page: null | Page = null
try {
page = await getDoc<Page>({

View File

@@ -8,8 +8,15 @@ import { getDoc } from '../../../_api/getDoc.js'
import { getDocs } from '../../../_api/getDocs.js'
import { PostClient } from './page.client.js'
export default async function Post({ params: { slug = '' } }) {
let post: Post | null = null
type Args = {
params: Promise<{
slug?: string
}>
}
export default async function Post({ params: paramsPromise }: Args) {
const { slug = '' } = await paramsPromise
let post: null | Post = null
try {
post = await getDoc<Post>({

View File

@@ -11,7 +11,14 @@ import { Blocks } from '../../../_components/Blocks/index.js'
import { Hero } from '../../../_components/Hero/index.js'
import { RefreshRouteOnSave } from './RefreshRouteOnSave.js'
export default async function SSRAutosavePage({ params: { slug = '' } }) {
type Args = {
params: Promise<{
slug?: string
}>
}
export default async function SSRAutosavePage({ params: paramsPromise }: Args) {
const { slug = '' } = await paramsPromise
const data = await getDoc<Page>({
slug,
collection: ssrAutosavePagesSlug,

View File

@@ -11,7 +11,14 @@ import { Blocks } from '../../../_components/Blocks/index.js'
import { Hero } from '../../../_components/Hero/index.js'
import { RefreshRouteOnSave } from './RefreshRouteOnSave.js'
export default async function SSRPage({ params: { slug = '' } }) {
type Args = {
params: Promise<{
slug?: string
}>
}
export default async function SSRPage({ params: paramsPromise }: Args) {
const { slug = ' ' } = await paramsPromise
const data = await getDoc<Page>({
slug,
collection: ssrPagesSlug,