Skip to content

Commit 885dbd8

Browse files
committed
Update debugging.md
1 parent 250a8ae commit 885dbd8

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed
Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
11
---
2-
title: Debugging and Troubleshooting
2+
title: 디버깅 및 문제 ν•΄κ²°
33
---
44

55
<Intro>
6-
This guide helps you identify and fix issues when using React Compiler. Learn how to debug compilation problems and resolve common issues.
6+
이 κ°€μ΄λ“œμ—μ„œλŠ” React 컴파일러 μ‚¬μš© μ‹œ λ°œμƒν•˜λŠ” 문제λ₯Ό μ‹λ³„ν•˜κ³  ν•΄κ²°ν•˜λŠ” 방법을 μ•Œμ•„λ΄…λ‹ˆλ‹€. 컴파일 문제λ₯Ό λ””λ²„κΉ…ν•˜κ³  일반적인 문제λ₯Ό ν•΄κ²°ν•˜λŠ” 방법을 λ°°μ›λ‹ˆλ‹€.
77
</Intro>
88

99
<YouWillLearn>
1010

11-
* The difference between compiler errors and runtime issues
12-
* Common patterns that break compilation
13-
* Step-by-step debugging workflow
11+
* 컴파일러 였λ₯˜μ™€ λŸ°νƒ€μž„ 문제의 차이
12+
* μ»΄νŒŒμΌμ„ λ°©ν•΄ν•˜λŠ” 일반적인 νŒ¨ν„΄
13+
* 단계별 디버깅 μ›Œν¬ν”Œλ‘œμš°
1414

1515
</YouWillLearn>
1616

17-
## Understanding Compiler Behavior {/*understanding-compiler-behavior*/}
17+
## 컴파일러 λ™μž‘ μ΄ν•΄ν•˜κΈ° {/*understanding-compiler-behavior*/}
1818

19-
React Compiler is designed to handle code that follows the [Rules of React](/reference/rules). When it encounters code that might break these rules, it safely skips optimization rather than risk changing your app's behavior.
19+
React μ»΄νŒŒμΌλŸ¬λŠ” [React의 κ·œμΉ™](/reference/rules)을 λ”°λ₯΄λŠ” μ½”λ“œλ₯Ό μ²˜λ¦¬ν•˜λ„λ‘ μ„€κ³„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ κ·œμΉ™μ„ μœ„λ°˜ν•  수 μžˆλŠ” μ½”λ“œλ₯Ό λ§Œλ‚˜λ©΄ μ•±μ˜ λ™μž‘μ„ λ³€κ²½ν•˜λŠ” μœ„ν—˜μ„ κ°μˆ˜ν•˜κΈ°λ³΄λ‹€ μ•ˆμ „ν•˜κ²Œ μ΅œμ ν™”λ₯Ό κ±΄λ„ˆλœλ‹ˆλ‹€.
2020

21-
### Compiler Errors vs Runtime Issues {/*compiler-errors-vs-runtime-issues*/}
21+
### 컴파일러 였λ₯˜ vs λŸ°νƒ€μž„ 문제 {/*compiler-errors-vs-runtime-issues*/}
2222

23-
**Compiler errors** occur at build time and prevent your code from compiling. These are rare because the compiler is designed to skip problematic code rather than fail.
23+
**컴파일러 였λ₯˜**λŠ” λΉŒλ“œ μ‹œμ μ— λ°œμƒν•˜λ©° μ½”λ“œκ°€ μ»΄νŒŒμΌλ˜μ§€ μ•Šκ²Œ ν•©λ‹ˆλ‹€. μ»΄νŒŒμΌλŸ¬λŠ” λ¬Έμ œκ°€ μžˆλŠ” μ½”λ“œλ₯Ό μ‹€νŒ¨μ‹œν‚€κΈ°λ³΄λ‹€ κ±΄λ„ˆλ›°λ„λ‘ μ„€κ³„λ˜μ–΄ 있기 λ•Œλ¬Έμ— μ΄λŸ¬ν•œ 였λ₯˜λŠ” λ“œλ­…λ‹ˆλ‹€.
2424

25-
**Runtime issues** occur when compiled code behaves differently than expected. Most of the time, if you encounter an issue with React Compiler, it's a runtime issue. This typically happens when your code violates the Rules of React in subtle ways that the compiler couldn't detect, and the compiler mistakenly compiled a component it should have skipped.
25+
**λŸ°νƒ€μž„ 문제**λŠ” 컴파일된 μ½”λ“œκ°€ μ˜ˆμƒκ³Ό λ‹€λ₯΄κ²Œ λ™μž‘ν•  λ•Œ λ°œμƒν•©λ‹ˆλ‹€. React 컴파일러 κ΄€λ ¨ λ¬Έμ œκ°€ λ°œμƒν•˜λ©΄ λŒ€λΆ€λΆ„ λŸ°νƒ€μž„ λ¬Έμ œμž…λ‹ˆλ‹€. μ΄λŠ” 일반적으둜 μ»΄νŒŒμΌλŸ¬κ°€ 감지할 수 μ—†λŠ” λ―Έλ¬˜ν•œ λ°©μ‹μœΌλ‘œ μ½”λ“œκ°€ React의 κ·œμΉ™μ„ μœ„λ°˜ν•˜κ³ , μ»΄νŒŒμΌλŸ¬κ°€ κ±΄λ„ˆλ›°μ–΄μ•Ό ν–ˆλ˜ μ»΄ν¬λ„ŒνŠΈλ₯Ό μ‹€μˆ˜λ‘œ μ»΄νŒŒμΌν–ˆμ„ λ•Œ λ°œμƒν•©λ‹ˆλ‹€.
2626

27-
When debugging runtime issues, focus your efforts on finding Rules of React violations in the affected components that were not detected by the ESLint rule. The compiler relies on your code following these rules, and when they're broken in ways it can't detect, that's when runtime problems occur.
27+
λŸ°νƒ€μž„ 문제λ₯Ό 디버깅할 λ•ŒλŠ” ESLint κ·œμΉ™μ΄ κ°μ§€ν•˜μ§€ λͺ»ν•œ 영ν–₯λ°›λŠ” μ»΄ν¬λ„ŒνŠΈμ˜ React κ·œμΉ™ μœ„λ°˜μ„ μ°ΎλŠ” 데 μ§‘μ€‘ν•˜μ„Έμš”. μ»΄νŒŒμΌλŸ¬λŠ” μ½”λ“œκ°€ μ΄λŸ¬ν•œ κ·œμΉ™μ„ λ”°λ₯Έλ‹€κ³  κ°€μ •ν•˜λ©°, 감지할 수 μ—†λŠ” λ°©μ‹μœΌλ‘œ κ·œμΉ™μ΄ μœ„λ°˜λ˜λ©΄ λŸ°νƒ€μž„ λ¬Έμ œκ°€ λ°œμƒν•©λ‹ˆλ‹€.
2828

2929

30-
## Common Breaking Patterns {/*common-breaking-patterns*/}
30+
## μ»΄νŒŒμΌμ„ λ°©ν•΄ν•˜λŠ” 일반적인 νŒ¨ν„΄ {/*common-breaking-patterns*/}
3131

32-
One of the main ways React Compiler can break your app is if your code was written to rely on memoization for correctness. This means your app depends on specific values being memoized to work properly. Since the compiler may memoize differently than your manual approach, this can lead to unexpected behavior like effects over-firing, infinite loops, or missing updates.
32+
React μ»΄νŒŒμΌλŸ¬κ°€ 앱을 λ§κ°€λœ¨λ¦΄ 수 μžˆλŠ” μ£Όμš” 원인 쀑 ν•˜λ‚˜λŠ” μ½”λ“œκ°€ 정확성을 μœ„ν•΄ λ©”λͺ¨μ΄μ œμ΄μ…˜μ— μ˜μ‘΄ν•˜λ„λ‘ μž‘μ„±λœ κ²½μš°μž…λ‹ˆλ‹€. μ΄λŠ” 앱이 μ œλŒ€λ‘œ μž‘λ™ν•˜κΈ° μœ„ν•΄ νŠΉμ • 값이 λ©”λͺ¨μ΄μ œμ΄μ…˜λ˜λŠ” 것에 μ˜μ‘΄ν•œλ‹€λŠ” μ˜λ―Έμž…λ‹ˆλ‹€. μ»΄νŒŒμΌλŸ¬κ°€ μˆ˜λ™ 방식과 λ‹€λ₯΄κ²Œ λ©”λͺ¨μ΄μ œμ΄μ…˜ν•  수 μžˆμœΌλ―€λ‘œ, Effectκ°€ κ³Όλ„ν•˜κ²Œ μ‹€ν–‰λ˜κ±°λ‚˜ λ¬΄ν•œ 루프가 λ°œμƒν•˜κ±°λ‚˜ μ—…λ°μ΄νŠΈκ°€ λˆ„λ½λ˜λŠ” λ“±μ˜ μ˜ˆμƒμΉ˜ λͺ»ν•œ λ™μž‘μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.
3333

34-
Common scenarios where this occurs:
34+
이런 상황이 λ°œμƒν•˜λŠ” 일반적인 μ‹œλ‚˜λ¦¬μ˜€λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.
3535

36-
- **Effects that rely on referential equality** - When effects depend on objects or arrays maintaining the same reference across renders
37-
- **Dependency arrays that need stable references** - When unstable dependencies cause effects to fire too often or create infinite loops
38-
- **Conditional logic based on reference checks** - When code uses referential equality checks for caching or optimization
36+
- **μ°Έμ‘° 동등성에 μ˜μ‘΄ν•˜λŠ” Effect** - Effectκ°€ λ Œλ”λ§ 간에 λ™μΌν•œ μ°Έμ‘°λ₯Ό μœ μ§€ν•˜λŠ” κ°μ²΄λ‚˜ 배열에 μ˜μ‘΄ν•˜λŠ” 경우
37+
- **μ•ˆμ •μ μΈ μ°Έμ‘°κ°€ ν•„μš”ν•œ μ˜μ‘΄μ„± λ°°μ—΄** - λΆˆμ•ˆμ •ν•œ μ˜μ‘΄μ„±μ΄ Effectλ₯Ό λ„ˆλ¬΄ 자주 μ‹€ν–‰ν•˜κ±°λ‚˜ λ¬΄ν•œ 루프λ₯Ό μƒμ„±ν•˜λŠ” 경우
38+
- **μ°Έμ‘° 검사 기반 쑰건뢀 둜직** - μ½”λ“œκ°€ μΊμ‹±μ΄λ‚˜ μ΅œμ ν™”λ₯Ό μœ„ν•΄ μ°Έμ‘° 동등성 검사λ₯Ό μ‚¬μš©ν•˜λŠ” 경우
3939

40-
## Debugging Workflow {/*debugging-workflow*/}
40+
## 디버깅 μ›Œν¬ν”Œλ‘œμš° {/*debugging-workflow*/}
4141

42-
Follow these steps when you encounter issues:
42+
λ¬Έμ œκ°€ λ°œμƒν•˜λ©΄ λ‹€μŒ 단계λ₯Ό λ”°λ₯΄μ„Έμš”.
4343

44-
### Compiler Build Errors {/*compiler-build-errors*/}
44+
### 컴파일러 λΉŒλ“œ 였λ₯˜ {/*compiler-build-errors*/}
4545

46-
If you encounter a compiler error that unexpectedly breaks your build, this is likely a bug in the compiler. Report it to the [facebook/react](https://github.com/facebook/react/issues) repository with:
47-
- The error message
48-
- The code that caused the error
49-
- Your React and compiler versions
46+
λΉŒλ“œλ₯Ό μ˜ˆμƒμΉ˜ μ•Šκ²Œ μ€‘λ‹¨μ‹œν‚€λŠ” 컴파일러 였λ₯˜κ°€ λ°œμƒν•˜λ©΄ 컴파일러의 버그일 κ°€λŠ₯성이 λ†’μŠ΅λ‹ˆλ‹€. λ‹€μŒ 정보와 ν•¨κ»˜ [facebook/react](https://github.com/facebook/react/issues) μ €μž₯μ†Œμ— 보고해 μ£Όμ„Έμš”.
47+
- 였λ₯˜ λ©”μ‹œμ§€
48+
- 였λ₯˜λ₯Ό λ°œμƒμ‹œν‚¨ μ½”λ“œ
49+
- React 및 컴파일러 버전
5050

51-
### Runtime Issues {/*runtime-issues*/}
51+
### λŸ°νƒ€μž„ 문제 {/*runtime-issues*/}
5252

53-
For runtime behavior issues:
53+
λŸ°νƒ€μž„ λ™μž‘ 문제의 경우 λ‹€μŒμ„ ν™•μΈν•˜μ„Έμš”.
5454

55-
### 1. Temporarily Disable Compilation {/*temporarily-disable-compilation*/}
55+
### 1. μΌμ‹œμ μœΌλ‘œ 컴파일 λΉ„ν™œμ„±ν™” {/*temporarily-disable-compilation*/}
5656

57-
Use `"use no memo"` to isolate whether an issue is compiler-related:
57+
`"use no memo"`λ₯Ό μ‚¬μš©ν•˜μ—¬ λ¬Έμ œκ°€ μ»΄νŒŒμΌλŸ¬μ™€ 관련이 μžˆλŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.
5858

5959
```js
6060
function ProblematicComponent() {
61-
"use no memo"; // Skip compilation for this component
62-
// ... rest of component
61+
"use no memo"; // 이 μ»΄ν¬λ„ŒνŠΈμ˜ 컴파일 κ±΄λ„ˆλ›°κΈ°
62+
// ... λ‚˜λ¨Έμ§€ μ»΄ν¬λ„ŒνŠΈ
6363
}
6464
```
6565

66-
If the issue disappears, it's likely related to a Rules of React violation.
66+
λ¬Έμ œκ°€ 사라지면 React κ·œμΉ™ μœ„λ°˜κ³Ό 관련이 μžˆμ„ κ°€λŠ₯성이 λ†’μŠ΅λ‹ˆλ‹€.
6767

68-
You can also try removing manual memoization (useMemo, useCallback, memo) from the problematic component to verify that your app works correctly without any memoization. If the bug still occurs when all memoization is removed, you have a Rules of React violation that needs to be fixed.
68+
λ¬Έμ œκ°€ μžˆλŠ” μ»΄ν¬λ„ŒνŠΈμ—μ„œ μˆ˜λ™ λ©”λͺ¨μ΄μ œμ΄μ…˜(`useMemo`, `useCallback`, `memo`)을 μ œκ±°ν•˜μ—¬ λ©”λͺ¨μ΄μ œμ΄μ…˜ 없이도 앱이 μ˜¬λ°”λ₯΄κ²Œ μž‘λ™ν•˜λŠ”μ§€ 확인해 λ³Ό μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. λͺ¨λ“  λ©”λͺ¨μ΄μ œμ΄μ…˜μ„ μ œκ±°ν•΄λ„ 버그가 계속 λ°œμƒν•˜λ©΄ μˆ˜μ •ν•΄μ•Ό ν•  React κ·œμΉ™ μœ„λ°˜μ΄ μžˆλŠ” κ²ƒμž…λ‹ˆλ‹€.
6969

70-
### 2. Fix Issues Step by Step {/*fix-issues-step-by-step*/}
70+
### 2. λ‹¨κ³„λ³„λ‘œ 문제 ν•΄κ²° {/*fix-issues-step-by-step*/}
7171

72-
1. Identify the root cause (often memoization-for-correctness)
73-
2. Test after each fix
74-
3. Remove `"use no memo"` once fixed
75-
4. Verify the component shows the ✨ badge in React DevTools
72+
1. κ·Όλ³Έ 원인 식별 (주둜 정확성을 μœ„ν•œ λ©”λͺ¨μ΄μ œμ΄μ…˜)
73+
2. 각 μˆ˜μ • ν›„ ν…ŒμŠ€νŠΈ
74+
3. μˆ˜μ • μ™„λ£Œ ν›„ `"use no memo"` 제거
75+
4. React DevToolsμ—μ„œ μ»΄ν¬λ„ŒνŠΈμ— ✨ λ°°μ§€κ°€ ν‘œμ‹œλ˜λŠ”μ§€ 확인
7676

77-
## Reporting Compiler Bugs {/*reporting-compiler-bugs*/}
77+
## 컴파일러 버그 보고 {/*reporting-compiler-bugs*/}
7878

79-
If you believe you've found a compiler bug:
79+
컴파일러 버그λ₯Ό λ°œκ²¬ν–ˆλ‹€κ³  μƒκ°λ˜λ©΄ λ‹€μŒμ„ ν™•μΈν•˜μ„Έμš”.
8080

81-
1. **Verify it's not a Rules of React violation** - Check with ESLint
82-
2. **Create a minimal reproduction** - Isolate the issue in a small example
83-
3. **Test without the compiler** - Confirm the issue only occurs with compilation
84-
4. **File an [issue](https://github.com/facebook/react/issues/new?template=compiler_bug_report.yml)**:
85-
- React and compiler versions
86-
- Minimal reproduction code
87-
- Expected vs actual behavior
88-
- Any error messages
81+
1. **React κ·œμΉ™ μœ„λ°˜μ΄ μ•„λ‹Œμ§€ 확인** - ESLint둜 검사
82+
2. **μ΅œμ†Œ μž¬ν˜„ 사둀 생성** - μž‘μ€ μ˜ˆμ‹œλ‘œ 문제 격리
83+
3. **컴파일러 없이 ν…ŒμŠ€νŠΈ** - 컴파일 μ‹œμ—λ§Œ λ¬Έμ œκ°€ λ°œμƒν•˜λŠ”μ§€ 확인
84+
4. **[이슈](https://github.com/facebook/react/issues/new?template=compiler_bug_report.yml) 등둝**:
85+
- React 및 컴파일러 버전
86+
- μ΅œμ†Œ μž¬ν˜„ μ½”λ“œ
87+
- μ˜ˆμƒ λ™μž‘ vs μ‹€μ œ λ™μž‘
88+
- 였λ₯˜ λ©”μ‹œμ§€
8989

90-
## Next Steps {/*next-steps*/}
90+
## λ‹€μŒ 단계 {/*next-steps*/}
9191

92-
- Review the [Rules of React](/reference/rules) to prevent issues
93-
- Check the [incremental adoption guide](/learn/react-compiler/incremental-adoption) for gradual rollout strategies
92+
- 문제 μ˜ˆλ°©μ„ μœ„ν•΄ [React의 κ·œμΉ™](/reference/rules) κ²€ν† 
93+
- 점진적 배포 μ „λž΅μ„ μœ„ν•œ [점진적 λ„μž… κ°€μ΄λ“œ](/learn/react-compiler/incremental-adoption) 확인

0 commit comments

Comments
Β (0)