Skip to content

Commit d3d1d89

Browse files
luciancahblueline1984SEOKKAMONI
authored
[no-issue] docs: 10월 문서 업데이트 (#142)
* [#123] docs: use-amp 번역 (#128) * [#125] docs: routing 번역 (#129) * [no-issue] fix: 잘못된 들여쓰기 수정 (#136) * [no-issue] fix: 일관성 및 잘못된 들여쓰기 수정 (#137) * [no-issue] fix: 잘못 입력된 링크 수정 (#138) * [no-issue] fix: 잘못된 들여쓰기 수정 (#139) * [no-issue] fix: 예시 코드 정리 (#140) * [no-issue] fix: 잘못 입력된 링크 수정 & 용어 수정 (#141) --------- Co-authored-by: White <[email protected]> Co-authored-by: 김석진(poki) <[email protected]>
1 parent 714244d commit d3d1d89

File tree

12 files changed

+96
-46
lines changed

12 files changed

+96
-46
lines changed

.all-contributorsrc

+18
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,24 @@
312312
"contributions": [
313313
"content"
314314
]
315+
},
316+
{
317+
"login": "blueline1984",
318+
"name": "White",
319+
"avatar_url": "https://avatars.githubusercontent.com/u/97525377?v=4",
320+
"profile": "http://github.com/blueline1984",
321+
"contributions": [
322+
"content"
323+
]
324+
},
325+
{
326+
"login": "seokkamoni",
327+
"name": "김석진(poki)",
328+
"avatar_url": "https://avatars.githubusercontent.com/u/102217654?v=4",
329+
"profile": "https://blog.seokkamoni.me",
330+
"contributions": [
331+
"content"
332+
]
315333
}
316334
],
317335
"contributorsPerLine": 7,

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.next
22
node_modules
33
.DS_Store
4+
.idea

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
<td align="center" valign="top" width="14.28%"><a href="https://github.com/HarrySeop"><img src="https://avatars.githubusercontent.com/u/141125424?v=4" width="100px;" alt="HarrySeop"/><br /><sub><b>HarrySeop</b></sub></a><br /><a href="#content-HarrySeop" title="Content">🖋</a></td>
7777
<td align="center" valign="top" width="14.28%"><a href="https://velog.io/@lionleeee"><img src="https://avatars.githubusercontent.com/u/51181222?v=4" width="100px;" alt="정훈"/><br /><sub><b>정훈</b></sub></a><br /><a href="#content-lionleeee" title="Content">🖋</a></td>
7878
<td align="center" valign="top" width="14.28%"><a href="https://sangseophwang.tistory.com/"><img src="https://avatars.githubusercontent.com/u/79933417?v=4" width="100px;" alt="SangSeop Hwang"/><br /><sub><b>SangSeop Hwang</b></sub></a><br /><a href="#content-sangseophwang" title="Content">🖋</a></td>
79+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/blueline1984"><img src="https://avatars.githubusercontent.com/u/97525377?v=4" width="100px;" alt="White"/><br /><sub><b>White</b></sub></a><br /><a href="#content-blueline1984" title="Content">🖋</a></td>
80+
</tr>
81+
<tr>
82+
<td align="center" valign="top" width="14.28%"><a href="https://blog.seokkamoni.me"><img src="https://avatars.githubusercontent.com/u/102217654?v=4" width="100px;" alt="김석진(poki)"/><br /><sub><b>김석진(poki)</b></sub></a><br /><a href="#content-seokkamoni" title="Content">🖋</a></td>
7983
</tr>
8084
</tbody>
8185
</table>

pages/docs/app/api-reference/functions/unstable_cache.mdx

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ const data = unstable_cache(fetchData, keyParts, options)()
5151
import { unstable_cache } from 'next/cache';
5252

5353
export default async function Page({ params }: { params: { userID: string } }) {
54-
const getCachedUser = unstable_cache(
55-
async () => {
56-
57-
return { id: params.userID };
54+
const getCachedUser = unstable_cache(
55+
async () => {
56+
return { id: params.userId }
5857
},
5958
[params.userID], // 여기서 userID를 keyParts에 추가하여 Next.js가 서로 다른 userID에 대해 별도의 캐시를 만들 수 있도록 합니다.
6059
{
6160
tags: ["cached-user-tag"],
6261
revalidate: 60,
6362
}
64-
);
63+
);
64+
6565
...
6666
}
6767
```
@@ -70,17 +70,17 @@ export default async function Page({ params }: { params: { userID: string } }) {
7070
import { unstable_cache } from 'next/cache';
7171

7272
export default async function Page({ params }) {
73-
const getCachedUser = unstable_cache(
74-
async () => {
75-
76-
return { id: params.userID };
73+
const getCachedUser = unstable_cache(
74+
async () => {
75+
return { id: params.userId }
7776
},
7877
[params.userID], // 여기서 userID를 keyParts에 추가하여 Next.js가 서로 다른 userID에 대해 별도의 캐시를 만들 수 있도록 합니다.
7978
{
8079
tags: ["cached-user-tag"],
8180
revalidate: 60,
8281
}
83-
);
82+
);
83+
8484
...
8585
}
8686
```

pages/docs/app/building-your-application/data-fetching/fetching.mdx

+1-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ import fetcher from '@/utils/fetcher'
179179

180180
export default function PollingComponent {
181181
// 폴링 간격을 2000 밀리초로 설정
182-
const {
183-
184-
data } = useSWR('/api/data', fetcher, { refreshInterval: 2000 });
182+
const { data } = useSWR('/api/data', fetcher, { refreshInterval: 2000 });
185183

186184
return '...'
187185
}

pages/docs/app/building-your-application/rendering/composition-patterns.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,7 @@ Client와 Server Components를 혼합할 때, UI를 컴포넌트 트리로 시
417417
이러한 클라이언트 하위 트리 내에서는 여전히 Server Components를 중첩하거나 Server Actions를 호출할 수 있지만, 다음 사항을 염두에 두어야 합니다:
418418

419419
- 요청-응답 라이프사이클 동안 코드가 서버에서 클라이언트로 이동합니다. 클라이언트에서 서버의 데이터나 리소스에 접근해야 하는 경우, **새로운** 요청을 서버로 보내는 것이지, 왔다 갔다 하는 것이 아닙니다.
420-
- 새로운 요청이 서버로 전송되면, 모든 Server Components가 먼저 렌더링됩니다. 클라이언트 내에서 중첩된 Server Components를 포함합니다. 렌더링된 결과([RSC Payload](/docs/app/building-your-application/rendering/server-components#what-is-the-react-server
421-
422-
-component-payload-rsc))에는 Client Components의 위치에 대한 참조가 포함됩니다. 그런 다음, 클라이언트에서 React는 RSC Payload를 사용하여 Server와 Client Components를 단일 트리로 조정합니다.
420+
- 새로운 요청이 서버로 전송되면, 모든 Server Components가 먼저 렌더링됩니다. 클라이언트 내에서 중첩된 Server Components를 포함합니다. 렌더링된 결과([RSC Payload](/docs/app/building-your-application/rendering/server-components#what-is-the-react-server-component-payload-rsc))에는 Client Components의 위치에 대한 참조가 포함됩니다. 그런 다음, 클라이언트에서 React는 RSC Payload를 사용하여 Server와 Client Components를 단일 트리로 조정합니다.
423421

424422
{/* Diagram */}
425423

@@ -560,5 +558,5 @@ export default function Page() {
560558

561559
> **참고**:
562560
>
563-
> - 부모 컴포넌트가 다시 렌더링될 때 중첩된 자식 컴포넌트가 다시 렌더링되는 것을 방지하기 위해 "내용을 위로 올리는" 패턴이 사용되었습니다.
561+
> - 부모 컴포넌트가 다시 렌더링될 때 중첩된 자식 컴포넌트가 다시 렌더링되는 것을 방지하기 위해 "lifting content up" 패턴이 사용되었습니다.
564562
> - `children` prop에 국한되지 않습니다. JSX를 전달하는 데 어떤 prop이든 사용할 수 있습니다.

pages/docs/app/building-your-application/routing/middleware.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const config = {
165165
3. 명명된 매개변수( `:`로 시작)에 수정자를 가질 수 있습니다: `/about/:path*``*`*0개 이상*이므로 `/about/a/b/c`와 일치합니다. `?`_0개 또는 1개_, `+`_1개 이상_
166166
4. 괄호로 둘러싸인 정규식을 사용할 수 있습니다: `/about/(.*)``/about/:path*`와 동일합니다
167167

168-
자세한 내용은 [path-to-regexp](https://github.com/pillarjs/path-to-regexp#path-to-regexp-
168+
자세한 내용은 [path-to-regexp](https://github.com/pillarjs/path-to-regexp#path-to-regexp)
169169

170170
1. 문서를 참조하세요.
171171

pages/docs/app/building-your-application/routing/parallel-routes.mdx

+1-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@ export default function Layout({ children }) {
222222
Parallel Routes는 [Intercepting Routes](/docs/app/building-your-application/routing/intercepting-routes)와 함께 사용하여 딥 링크를 지원하는 모달을 생성할 수 있습니다. 이를 통해 모달을 구축할 때 일반적으로 발생하는 문제를 해결할 수 있습니다:
223223

224224
- 모달 콘텐츠를 **URL을 통해 공유 가능**하게 만들기.
225-
- 페이지를 새로 고침할 때 **컨텍스트를 유지**하여 모달을 닫
226-
227-
지 않기.
228-
225+
- 페이지를 새로 고침할 때 **컨텍스트를 유지**하여 모달을 닫지 않기.
229226
- 이전 탐색 시 **모달 닫기**.
230227
- 앞으로 탐색 시 **모달 다시 열기**.
231228

pages/docs/app/building-your-application/routing/route-handlers.mdx

+3-7
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ import { headers } from 'next/headers'
212212

213213
export async function GET(request: Request) {
214214
const headersList = headers()
215-
const referer = headersList.get('refer
216-
217-
er')
215+
const referer = headersList.get('referer')
218216

219217
return new Response('Hello, Next.js!', {
220218
status: 200,
@@ -510,9 +508,7 @@ export async function GET(request) {
510508

511509
> **알아두면 좋은 점**:
512510
>
513-
> - 여러 Route Handlers에 CORS 헤더를 추가하려면 [Middleware](/docs/app/building-your-application/routing/middleware#cors) 또는 [`
514-
515-
next.config.js` 파일](/docs/app/api-reference/next-config-js/headers#cors)을 사용할 수 있습니다.
511+
> - 여러 Route Handlers에 CORS 헤더를 추가하려면 [Middleware](/docs/app/building-your-application/routing/middleware#cors) 또는 [`next.config.js` 파일](/docs/app/api-reference/next-config-js/headers#cors)을 사용할 수 있습니다.
516512
517513
> - 또는 [CORS 예제](https://github.com/vercel/examples/blob/main/edge-functions/cors/lib/cors.ts) 패키지를 참조하세요.
518514
@@ -558,7 +554,7 @@ export async function POST(request) {
558554

559555
### Non-UI Responses
560556

561-
Route Handlers를 사용하여 UI가 아닌 콘텐츠를 반환할 수 있습니다. [`sitemap.xml`](/docs/app/api-reference/file-conventions/metadata/sitemap#generating-a-sitemap-using-code-js-ts), [`robots.txt`](/docs/app/api-reference/file-conventions/metadata/robots#generate-a-robots-file), [`app icons`](/docs/app/api-reference/file-conventions/metadata/app-icons#generate-icons-using-code-js-ts-tsx), [open graph images](/docs/app/api-reference/file-conventions/metadata/opengraph-image) 등은 모두 기본적으로 지원됩니다.
557+
Route Handlers를 사용하여 UI가 아닌 콘텐츠를 반환할 수 있습니다. [`sitemap.xml`](/docs/app/api-reference/file-conventions/metadata/sitemap#generating-a-sitemap-using-code-js-ts), [`robots.txt`](/docs/app/api-reference/file-conventions/metadata/robots#generate-a-robots-file), [`app icons`](/docs/app/api-reference/file-conventions/metadata/app-icons#generate-icons-using-code-js-ts-tsx), [`open graph images`](/docs/app/api-reference/file-conventions/metadata/opengraph-image) 등은 모두 기본적으로 지원됩니다.
562558

563559
```ts filename="app/rss.xml/route.ts" switcher
564560
export async function GET() {

pages/docs/pages/api-reference/functions/use-amp.mdx

+18-16
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,33 @@ title: useAmp
33
description: Enable AMP in a page, and control the way Next.js adds AMP to the page with the AMP config.
44
---
55

6+
# useAMP
7+
68
<details>
79
<summary>Examples</summary>
810

911
- [AMP](https://github.com/vercel/next.js/tree/canary/examples/amp)
1012

1113
</details>
1214

13-
> AMP support is one of our advanced features, you can [read more about AMP here](/docs/pages/building-your-application/configuring/amp).
15+
> AMP 지원은 고급 기능 중 하나이며, [여기에서 AMP에 대해 더 읽어보실 수 있습니다](/docs/pages/building-your-application/configuring/amp).
1416
15-
To enable AMP, add the following config to your page:
17+
AMP를 활성화하려면, 다음과 같은 설정을 페이지에 추가하세요:
1618

1719
```jsx filename="pages/index.js"
1820
export const config = { amp: true }
1921
```
2022

21-
The `amp` config accepts the following values:
23+
`amp` 설정은 다음의 값을 허용합니다:
2224

23-
- `true` - The page will be AMP-only
24-
- `'hybrid'` - The page will have two versions, one with AMP and another one with HTML
25+
- `true` - 페이지가 AMP-only 상태가 됩니다
26+
- `hybrid` - 페이지에 AMP 버전과 HTML 버전이 모두 존재하게 됩니다
2527

26-
To learn more about the `amp` config, read the sections below.
28+
`amp` 구성에 대해 더 알아보려면, 아래 섹션을 읽어보세요.
2729

2830
## AMP First Page
2931

30-
Take a look at the following example:
32+
다음 예제를 살펴보세요:
3133

3234
```jsx filename="pages/about.js"
3335
export const config = { amp: true }
@@ -39,15 +41,15 @@ function About(props) {
3941
export default About
4042
```
4143

42-
The page above is an AMP-only page, which means:
44+
위의 예시 페이지는 AMP-only 페이지로, 다음을 의미합니다:
4345

44-
- The page has no Next.js or React client-side runtime
45-
- The page is automatically optimized with [AMP Optimizer](https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer), an optimizer that applies the same transformations as AMP caches (improves performance by up to 42%)
46-
- The page has a user-accessible (optimized) version of the page and a search-engine indexable (unoptimized) version of the page
46+
- 페이지에 Next.js 또는 React 클라이언트 측 런타임이 없습니다
47+
- 페이지는 자동으로 [AMP Optimizer](https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer)로 최적화되며, 이 최적화 도구는 AMP 캐시와 동일한 변환을 적용합니다(성능이 최대 42% 향상됨)
48+
- 페이지는 사용자 접근이 가능한 최적화된 버전과 검색 엔진에 인덱싱 가능한 최적화되지 않은 버전을 갖습니다
4749

4850
## Hybrid AMP Page
4951

50-
Take a look at the following example:
52+
다음 예제를 살펴보세요:
5153

5254
```jsx filename="pages/about.js"
5355
import { useAmp } from 'next/amp'
@@ -78,9 +80,9 @@ function About(props) {
7880
export default About
7981
```
8082

81-
The page above is a hybrid AMP page, which means:
83+
위의 예시 페이지는 Hybrid AMP 페이지로, 다음을 의미합니다:
8284

83-
- The page is rendered as traditional HTML (default) and AMP HTML (by adding `?amp=1` to the URL)
84-
- The AMP version of the page only has valid optimizations applied with AMP Optimizer so that it is indexable by search-engines
85+
- 페이지는 기존의 HTML(기본값)과 AMP HTML(URL에 `?amp=1` 추가하는 것을 통해)로 렌더링됩니다
86+
- 페이지의 AMP 버전은 AMP Optimizer로 적용된 유효한 최적화만 적용되어 검색 엔진에 인덱싱됩니다
8587

86-
The page uses `useAmp` to differentiate between modes, it's a [React Hook](https://react.dev/reference/react) that returns `true` if the page is using AMP, and `false` otherwise.
88+
이 페이지는 `useAmp`를 사용하여 모드를 구분하며, 이 함수(`useAmp`)는 페이지가 AMP를 사용하는 경우 `true`를, 그렇지 않은 경우 `false`를 반환하는 [React Hook](https://react.dev/reference/react)입니다.

pages/docs/pages/building-your-application/Routing.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ title: Routing
33
description: Learn the fundamentals of routing for front-end applications with the Pages Router.
44
---
55

6-
The Pages Router has a file-system based router built on concepts of pages. When a file is added to the `pages` directory it's automatically available as a route. Learn more about routing in the Pages Router:
6+
Pages Router는 페이지 컨셉을 기반으로 한 파일 시스템 라우터를 가지고 있습니다. `pages` 디렉토리에 파일을 추가하면 자동으로 해당 파일이 경로로 사용될 수 있습니다. Pages Router의 라우팅에 대해 더 알아보세요:

pages/index.mdx

+36
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,42 @@ Next.js 공식 문서 한글 번역 프로젝트입니다. by [@luciancah](https
610610
🖋
611611
</a>
612612
</td>
613+
<td align="center" valign="top" width="14.28%">
614+
<a href="https://github.com/blueline1984">
615+
<img
616+
src="https://avatars.githubusercontent.com/u/97525377?v=4"
617+
width="100px;"
618+
alt="White"
619+
/>
620+
<br />
621+
<sub>
622+
<b>White</b>
623+
</sub>
624+
</a>
625+
<br />
626+
<a href="#content-blueline1984" title="Content">
627+
🖋
628+
</a>
629+
</td>
630+
</tr>
631+
<tr>
632+
<td align="center" valign="top" width="14.28%">
633+
<a href="https://blog.seokkamoni.me">
634+
<img
635+
src="https://avatars.githubusercontent.com/u/102217654?v=4"
636+
width="100px;"
637+
alt="김석진(poki)"
638+
/>
639+
<br />
640+
<sub>
641+
<b>김석진(poki)</b>
642+
</sub>
643+
</a>
644+
<br />
645+
<a href="#content-seokkamoni" title="Content">
646+
🖋
647+
</a>
648+
</td>
613649
</tr>
614650
</tbody>
615651
</table>

0 commit comments

Comments
 (0)