Open
Conversation
Contributor
|
ref #79 |
chaejunlee
reviewed
Jul 20, 2023
Contributor
chaejunlee
left a comment
There was a problem hiding this comment.
기여해주셔서 감사합니다! 커멘트 확인해주시고 수정해주세요!
| --- | ||
|
|
||
| The `generateStaticParams` function can be used in combination with [dynamic route segments](/docs/app/building-your-application/routing/dynamic-routes) to [**statically generate**](/docs/app/building-your-application/rendering/static-and-dynamic-rendering#static-rendering-default) routes at build time instead of on-demand at request time. | ||
| `generateStaticParams` 함수는 요청 타임 대신에 빌드 타임에 [dynamic route segments](/docs/app/building-your-application/routing/dynamic-routes) to [**statically generate**](/docs/app/building-your-application/rendering/static-and-dynamic-rendering#static-rendering-default) routes 와 함께 사용 가능합니다. |
Contributor
There was a problem hiding this comment.
Suggested change
| `generateStaticParams` 함수는 요청 타임 대신에 빌드 타임에 [dynamic route segments](/docs/app/building-your-application/routing/dynamic-routes) to [**statically generate**](/docs/app/building-your-application/rendering/static-and-dynamic-rendering#static-rendering-default) routes 와 함께 사용 가능합니다. | |
| `generateStaticParams` 함수는 [동적 라우트 세그먼트](/docs/app/building-your-application/routing/dynamic-routes)와 함께 사용하여 요청 시에 실시간으로 라우트를 만드는 것이 아닌 빌드 타임에 라우트를 [**정적으로 생성**](/docs/app/building-your-application/rendering/static-and-dynamic-rendering#static-rendering-default) 할 수 있습니다. |
번역 놓치신 부분이 있네요!
| ``` | ||
|
|
||
| > **Good to know** | ||
| > **알아두면 좋은 점** |
Contributor
There was a problem hiding this comment.
Suggested change
| > **알아두면 좋은 점** | |
| > **참고** |
기여 가이드에 따라 참고로 수정해주세요!
| > - During `next build`, `generateStaticParams` runs before the corresponding Layouts or Pages are generated. | ||
| > - During revalidation (ISR), `generateStaticParams` will not be called again. | ||
| > - `generateStaticParams` replaces the [`getStaticPaths`](/docs/pages/api-reference/functions/get-static-paths) function in the Pages Router. | ||
| > - `generateStaticParams`로 생성되지 않은 동적 세그먼트를 조회했을 때 일어나는 것들을 [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) 세그먼트 컨피그 옵션을 사용해 제어할 수 있습니다. |
Contributor
There was a problem hiding this comment.
Suggested change
| > - `generateStaticParams`로 생성되지 않은 동적 세그먼트를 조회했을 때 일어나는 것들을 [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) 세그먼트 컨피그 옵션을 사용해 제어할 수 있습니다. | |
| > - `generateStaticParams`로 생성되지 않은 동적 세그먼트를 조회했을 때의 동작을 [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) 세그먼트 설정 옵션을 사용해 제어할 수 있습니다. |
| > - During revalidation (ISR), `generateStaticParams` will not be called again. | ||
| > - `generateStaticParams` replaces the [`getStaticPaths`](/docs/pages/api-reference/functions/get-static-paths) function in the Pages Router. | ||
| > - `generateStaticParams`로 생성되지 않은 동적 세그먼트를 조회했을 때 일어나는 것들을 [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) 세그먼트 컨피그 옵션을 사용해 제어할 수 있습니다. | ||
| > - `next dev`가 실행되는 동안, `generateStaticParams` 는 route 로 이동하는 할 때 호출될 것입니다. |
Contributor
There was a problem hiding this comment.
Suggested change
| > - `next dev`가 실행되는 동안, `generateStaticParams` 는 route 로 이동하는 할 때 호출될 것입니다. | |
| > - `next dev`가 실행되는 동안, `generateStaticParams`는 라우트로 이동할 때 호출됩니다. |
| > - `generateStaticParams`로 생성되지 않은 동적 세그먼트를 조회했을 때 일어나는 것들을 [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) 세그먼트 컨피그 옵션을 사용해 제어할 수 있습니다. | ||
| > - `next dev`가 실행되는 동안, `generateStaticParams` 는 route 로 이동하는 할 때 호출될 것입니다. | ||
| > - `next build`가 실행되는 동안, `generateStaticParams` 는 일치하는 레이아웃 또는 페이지가 생성되기 전에 실행됩니다. | ||
| > - revalidation 이 일어나는 동안(ISR), `generateStaticParams` 는 다시 호출되지 않습니다. |
Contributor
There was a problem hiding this comment.
Suggested change
| > - revalidation 이 일어나는 동안(ISR), `generateStaticParams` 는 다시 호출되지 않습니다. | |
| > - 재검증(ISR)이 일어나는 동안, `generateStaticParams`는 다시 호출되지 않습니다. |
| 하위 경로 세그먼트의 `generateStaticParams` 함수는 상위 `generateStaticParams`가 생성하는 각 세그먼트에 대해 한 번씩 실행됩니다. | ||
|
|
||
| The child `generateStaticParams` function can use the `params` returned from the parent `generateStaticParams` function to dynamically generate its own segments. | ||
| 하위 `generateStaticParams` 함수는 상위 `generateStaticParams` 함수에서 반환된 `params`를 사용해 자체 세그먼트를 동적으로 생성할 수 있습니다. |
Contributor
There was a problem hiding this comment.
Suggested change
| 하위 `generateStaticParams` 함수는 상위 `generateStaticParams` 함수에서 반환된 `params`를 사용해 자체 세그먼트를 동적으로 생성할 수 있습니다. | |
| 자식 `generateStaticParams` 함수는 부모 `generateStaticParams` 함수에서 반환된 `params`를 사용해 자체 세그먼트를 동적으로 생성할 수 있습니다. |
| ```tsx filename="app/products/[category]/[product]/page.tsx" switcher | ||
| // Generate segments for [product] using the `params` passed from | ||
| // the parent segment's `generateStaticParams` function | ||
| // 상위 세그먼트의 `generateStaticParams` 함수에서 전달된 `params`를 사용하여 |
Contributor
There was a problem hiding this comment.
Suggested change
| // 상위 세그먼트의 `generateStaticParams` 함수에서 전달된 `params`를 사용하여 | |
| // 부모 세그먼트의 `generateStaticParams` 함수에서 전달된 `params`를 사용하여 |
| ```jsx filename="app/products/[category]/[product]/page.js" switcher | ||
| // Generate segments for [product] using the `params` passed from | ||
| // the parent segment's `generateStaticParams` function | ||
| // 상위 세그먼트의 `generateStaticParams` 함수에서 전달된 `params`를 사용하여 |
Contributor
There was a problem hiding this comment.
Suggested change
| // 상위 세그먼트의 `generateStaticParams` 함수에서 전달된 `params`를 사용하여 | |
| // 부모 세그먼트의 `generateStaticParams` 함수에서 전달된 `params`를 사용하여 |
| ``` | ||
|
|
||
| > **Good to know**: When rendering a route, Next.js will [automatically deduplicate `fetch` requests](/docs/app/building-your-application/data-fetching#automatic-fetch-request-deduping) for the same data across `generateMetadata`, `generateStaticParams`, Layouts, Pages, and Server Components. React [`cache` can be used](/docs/app/building-your-application/data-fetching/caching#react-cache) if `fetch` is unavailable. | ||
| > **알아두면 좋은 점**: 경로를 렌더링할 때, Next.js 는 `generateMetadata`, `generateStaticParams`, 레이아웃, 페이지와 서버 컴포넌트에서 동일한 데이터에 대한 요청이 있다면 [자동으로 `fetch` 요청에 대해 중복건을 제거](/docs/app/building-your-application/data-fetching#automatic-fetch-request-deduping) 할 것입니다. 리액트에서 `fetch` 가 사용이 불가하다면 [`캐시` 를 사용할 수 있습니다.](/docs/app/building-your-application/data-fetching/caching#react-cache) |
Contributor
There was a problem hiding this comment.
Suggested change
| > **알아두면 좋은 점**: 경로를 렌더링할 때, Next.js 는 `generateMetadata`, `generateStaticParams`, 레이아웃, 페이지와 서버 컴포넌트에서 동일한 데이터에 대한 요청이 있다면 [자동으로 `fetch` 요청에 대해 중복건을 제거](/docs/app/building-your-application/data-fetching#automatic-fetch-request-deduping) 할 것입니다. 리액트에서 `fetch` 가 사용이 불가하다면 [`캐시` 를 사용할 수 있습니다.](/docs/app/building-your-application/data-fetching/caching#react-cache) | |
| > **참고**: 경로를 렌더링할 때, Next.js 는 `generateMetadata`, `generateStaticParams`, 레이아웃, 페이지와 서버 컴포넌트에 걸쳐서 동일한 데이터에 대한 [`fetch` 요청의 중복을 자동으로 제거](/docs/app/building-your-application/data-fetching#automatic-fetch-request-deduping)합니다. 리액트에서 `fetch`를 사용할 수 없다면 [`cache`를 사용할 수 있습니다.](/docs/app/building-your-application/data-fetching/caching#react-cache) |
| | 버전 | 변경사항 | | ||
| | --------- | ---------------------------------- | | ||
| | `v13.0.0` | `generateStaticParams` introduced. | | ||
| | `v13.0.0` | `generateStaticParams` 안내 | |
Contributor
There was a problem hiding this comment.
Suggested change
| | `v13.0.0` | `generateStaticParams` 안내 | | |
| | `v13.0.0` | `generateStaticParams` 도입 | |
chaejunlee
reviewed
Jul 20, 2023
Member
|
@kordobby 리뷰 이후 작업이 몇일 동안 이뤄지지 않아 9월 13일까지 작업이 없을 경우 이슈를 close하고 새로운 분에게 할당하겠습니다! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
기여자용
문서 개선
pnpm prettier-fix를 실행하여 서식 문제를 해결합니다. - 문서 기여 가이드를 읽고 문서 지침을 따르는지 확인하세요: https://github.com/Nextjs-kr/Nextjs.ko/blob/main/packages/next/README.mdProgress
pnpm prettier-fixcloses #79