Skip to content

Commit 277e822

Browse files
guyeolbumkeyydvlprsh
authored
ts 3.9 breaking changes ๋ฒˆ์—ญ (resolve #72) (#76)
* ts 3.9 breaking changes ๋ฒˆ์—ญ * resolve conflict * Update pages/release notes/TypeScript 3.9.md Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com> * Update pages/release notes/TypeScript 3.9.md Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com> * Update pages/release notes/TypeScript 3.9.md Co-authored-by: seoheePark <dvlprsh103@gmail.com> * Update pages/release notes/TypeScript 3.9.md Co-authored-by: seoheePark <dvlprsh103@gmail.com> * Update pages/release notes/TypeScript 3.9.md Co-authored-by: seoheePark <dvlprsh103@gmail.com> Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com> Co-authored-by: seoheePark <dvlprsh103@gmail.com>
1 parent 2456b25 commit 277e822

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

โ€Žpages/release notes/TypeScript 3.9.md

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* [์ฝ”๋“œ ์ž‘์—… ๊ฐœํ–‰ ์œ ์ง€](#code-actions-preserve-newlines)
88
* [๋ˆ„๋ฝ๋œ ๋ฐ˜ํ™˜๋ฌธ ๋น ๋ฅธ ์ˆ˜์ •](#quick-fixes-for-missing-return-expressions)
99
* [`tsconfig.json` ํŒŒ์ผ "์†”๋ฃจ์…˜ ์Šคํƒ€์ผ" ์ง€์›](#support-for-solution-style-tsconfigjson-files)
10-
* [Breaking Changes](#breaking-changes)
10+
* [์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ](#์ฃผ์š”-๋ณ€๊ฒฝ-์‚ฌํ•ญ-breaking-changes)
1111

1212
## <span id="improvements-in-inference-and-promiseall" /> ์ถ”๋ก ๊ณผ `Promise.all` ๊ฐœ์„  (Improvements in Inference and `Promise.all`)
1313

@@ -325,84 +325,84 @@ let f2 = () => { 42 }
325325
TypeScript 3.9 ๋Š” ์ด ์„ค์ •์— ๋Œ€ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค ์ˆ˜์ •์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
326326
๋” ์ž์„ธํ•œ ์‚ฌํ•ญ์€, [์ด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•œ pull request](https://github.com/microsoft/TypeScript/pull/37239)๋ฅผ ํ™•์ธํ•˜์„ธ์š”.
327327

328-
## Breaking Changes
328+
## ์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ (Breaking Changes)
329329

330-
### Parsing Differences in Optional Chaining and Non-Null Assertions
330+
### ์„ ํƒ์  ์ฒด์ด๋‹๊ณผ ๋„์ด ์•„๋‹Œ ๋‹จ์–ธ์—์„œ ํŒŒ์‹ฑ ์ฐจ์ด์  (Parsing Differences in Optional Chaining and Non-Null Assertions)
331331

332-
TypeScript recently implemented the optional chaining operator, but we've received user feedback that the behavior of optional chaining (`?.`) with the non-null assertion operator (`!`) is extremely counter-intuitive.
332+
์ตœ๊ทผ์— TypeScript๋Š” ์„ ํƒ์  ์ฒด์ด๋‹ ์—ฐ์‚ฐ์ž๋ฅผ ๋„์ž…ํ–ˆ์ง€๋งŒ, ๋„์ด ์•„๋‹Œ ๋‹จ์–ธ ์—ฐ์‚ฐ์ž (`!`)์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ์„ ํƒ์  ์ฒด์ด๋‹ (`?.`)์˜ ๋™์ž‘์ด ๋งค์šฐ ์ง๊ด€์ ์ด์ง€ ์•Š๋‹ค๋Š” ์‚ฌ์šฉ์ž ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ›์•˜์Šต๋‹ˆ๋‹ค.
333333

334-
Specifically, in previous versions, the code
334+
๊ตฌ์ฒด์ ์œผ๋กœ, ์ด์ „ ๋ฒ„์ „์—์„œ๋Š” ์ฝ”๋“œ๊ฐ€
335335

336336
```ts
337337
foo?.bar!.baz
338338
```
339339

340-
was interpreted to be equivalent to the following JavaScript.
340+
๋‹ค์Œ JavaScript์™€ ๋™์ผํ•˜๊ฒŒ ํ•ด์„๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
341341

342342
```js
343343
(foo?.bar).baz
344344
```
345345
346-
In the above code the parentheses stop the "short-circuiting" behavior of optional chaining, so if `foo` is `undefined`, accessing `baz` will cause a runtime error.
346+
์œ„์— ์ฝ”๋“œ์—์„œ ๊ด„ํ˜ธ๋Š” ์„ ํƒ์  ์ฒด์ด๋‹์˜ "๋‹จ๋ฝ" ๋™์ž‘์„ ์ค‘๋‹จํ•ฉ๋‹ˆ๋‹ค, ๊ทธ๋ž˜์„œ ๋งŒ์•ฝ `foo`๊ฐ€ `undefined`์ด๋ฉด, `baz`์— ์ ‘๊ทผํ•˜๋Š” ๊ฒƒ์€ ๋Ÿฐํƒ€์ž„ ์˜ค๋ฅ˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.
347347
348-
The Babel team who pointed this behavior out, and most users who provided feedback to us, believe that this behavior is wrong.
349-
We do too!
350-
The thing we heard the most was that the `!` operator should just "disappear" since the intent was to remove `null` and `undefined` from the type of `bar`.
348+
์ด ๋™์ž‘์„ ์ง€์ ํ•œ ๋ฐ”๋ฒจํŒ€๊ณผ ํ”ผ๋“œ๋ฐฑ์„ ์ค€ ๋Œ€๋ถ€๋ถ„์˜ ์‚ฌ์šฉ์ž๋“ค์€ ์ด ๋™์ž‘์ด ์ž˜๋ชป๋˜์—ˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
349+
์ €ํฌ๋„ ๊ทธ๋ ‡๊ฒŒ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค!
350+
`bar`์˜ ํƒ€์ž…์—์„œ `null`๊ณผ `undefined`๋ฅผ ์ œ๊ฑฐํ•˜๋Š” ๊ฒƒ์ด ์˜๋„์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ€์žฅ ๋งŽ์ด ๋“ค์€ ๋ง์€ `!` ์—ฐ์‚ฐ์ž๋Š” ๊ทธ๋ƒฅ "์‚ฌ๋ผ์ ธ์•ผ ํ•œ๋‹ค"์ž…๋‹ˆ๋‹ค.
351351
352-
In other words, most people felt that the original snippet should be interpreted as
352+
์ฆ‰, ๋Œ€๋ถ€๋ถ„์˜ ์‚ฌ๋žŒ๋“ค์€ ์›๋ณธ ๋ฌธ์žฅ์ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด
353353
354354
```js
355355
foo?.bar.baz
356356
```
357357
358-
which just evaluates to `undefined` when `foo` is `undefined`.
358+
`foo`๊ฐ€ `undefined`์ผ ๋•Œ, ๊ทธ๋ƒฅ `undefined`๋กœ ํ‰๊ฐ€ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ํ•ด์„๋˜์–ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค
359359
360-
This is a breaking change, but we believe most code was written with the new interpretation in mind.
361-
Users who want to revert to the old behavior can add explicit parentheses around the left side of the `!` operator.
360+
์ด๊ฒƒ์ด ์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด์ง€๋งŒ, ๋Œ€๋ถ€๋ถ„์˜ ์ฝ”๋“œ๊ฐ€ ์ƒˆ๋กœ์šด ํ•ด์„์„ ์—ผ๋‘์— ๋‘๊ณ  ์ž‘์„ฑ๋˜์—ˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
361+
์ด์ „ ๋™์ž‘์œผ๋กœ ๋˜๋Œ๋ฆฌ๊ณ  ์‹ถ์€ ์‚ฌ์šฉ์ž๋Š” `!` ์—ฐ์‚ฐ์ž ์™ผ์ชฝ์— ๋ช…์‹œ์ ์ธ ๊ด„ํ˜ธ๋ฅผ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
362362
363363
```ts
364364
(foo?.bar)!.baz
365365
```
366366
367-
### `}` and `>` are Now Invalid JSX Text Characters
367+
### `}` ์™€ `>` ๋Š” ์ด์ œ ์œ ํšจํ•˜์ง€ ์•Š์€ JSX ํ…์ŠคํŠธ ๋ฌธ์ž์ž…๋‹ˆ๋‹ค (`}` and `>` are Now Invalid JSX Text Characters)
368368
369-
The JSX Specification forbids the use of the `}` and `>` characters in text positions.
370-
TypeScript and Babel have both decided to enforce this rule to be more comformant.
371-
The new way to insert these characters is to use an HTML escape code (e.g. `<span> 2 &gt 1 </div>`) or insert an expression with a string literal (e.g. `<span> 2 {">"} 1 </div>`).
369+
JSX ๋ช…์„ธ์„œ์—๋Š” ํ…์ŠคํŠธ ์œ„์น˜์— `}`์™€ `>` ๋ฌธ์ž์˜ ์‚ฌ์šฉ์„ ๊ธˆ์ง€ํ•ฉ๋‹ˆ๋‹ค.
370+
TypeScript์™€ ๋ฐ”๋ฒจ์€ ์ด ๊ทœ์น™์„ ๋” ์ ํ•ฉํ•˜๊ฒŒ ์ ์šฉํ•˜๊ธฐ๋กœ ๊ฒฐ์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
371+
์ด ๋ฌธ์ž๋ฅผ ๋„ฃ๊ธฐ ์œ„ํ•œ ์ƒˆ๋กœ์šด ๋ฐฉ๋ฒ•์€ HTML ์ด์Šค์ผ€์ดํ”„ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ (์˜ˆ๋ฅผ ๋“ค์–ด, `<span> 2 &gt 1 </div>`) ๋ฌธ์ž์—ด ๋ฆฌํ„ฐ๋Ÿด๋กœ ํ‘œํ˜„์‹์„ ๋„ฃ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค (์˜ˆ๋ฅผ ๋“ค์–ด, `<span> 2 {">"} 1 </div`).
372372
373-
Luckily, thanks to the [pull request](https://github.com/microsoft/TypeScript/pull/36636) enforcing this from [Brad Zacher](https://github.com/bradzacher), you'll get an error message along the lines of
373+
๋‹คํ–‰ํžˆ, [Brad Zacher](https://github.com/bradzacher)์˜ [pull request](https://github.com/microsoft/TypeScript/pull/36636) ๋•๋ถ„์—, ๋‹ค์Œ ๋ฌธ์žฅ๊ณผ ํ•จ๊ป˜ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
374374
375375
```
376376
Unexpected token. Did you mean `{'>'}` or `&gt;`?
377377
Unexpected token. Did you mean `{'}'}` or `&rbrace;`?
378378
```
379379
380-
For example:
380+
์˜ˆ๋ฅผ ๋“ค์–ด:
381381
382382
```tsx
383383
let directions = <span>Navigate to: Menu Bar > Tools > Options</div>
384384
// ~ ~
385385
// Unexpected token. Did you mean `{'>'}` or `&gt;`?
386386
```
387387
388-
That error message came with a handy quick fix, and thanks to [Alexander Tarasyuk](https://github.com/a-tarasyuk), [you can apply these changes in bulk](https://github.com/microsoft/TypeScript/pull/37436) if you have a lot of errors.
388+
์ด ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋Š” ํŽธ๋ฆฌํ•˜๊ณ  ๋น ๋ฅธ ์ˆ˜์ •๊ณผ ํ•จ๊ป˜ ์ œ๊ณต๋˜๊ณ  [Alexander Tarasyuk](https://github.com/a-tarasyuk) ๋•๋ถ„์—, ๋งŽ์€ ์˜ค๋ฅ˜๊ฐ€ ์žˆ์œผ๋ฉด [์ด ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ผ๊ด„ ์ ์šฉ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค](https://github.com/microsoft/TypeScript/pull/37436).
389389
390-
### Stricter Checks on Intersections and Optional Properties
390+
### ๊ต์ง‘ํ•ฉ๊ณผ ์„ ํƒ์  ํ”„๋กœํผํ‹ฐ์— ๋Œ€ํ•œ ๋” ์—„๊ฒฉํ•ด์ง„ ๊ฒ€์‚ฌ (Stricter Checks on Intersections and Optional Properties)
391391
392-
Generally, an intersection type like `A & B` is assignable to `C` if either `A` or `B` is assignable to `C`; however, sometimes that has problems with optional properties.
393-
For example, take the following:
392+
์ผ๋ฐ˜์ ์œผ๋กœ, `A & B`์™€ ๊ฐ™์€ ๊ต์ฐจ ํƒ€์ž…์€ `A` ๋˜๋Š” `B`๊ฐ€ `C`์— ํ• ๋‹นํ•  ์ˆ˜ ์žˆ์œผ๋ฉด, `A & B`๋Š” `C`์— ํ• ๋‹นํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค; ํ•˜์ง€๋งŒ, ๊ฐ€๋” ์„ ํƒ์  ํ”„๋กœํผํ‹ฐ์—์„œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊น๋‹ˆ๋‹ค.
393+
์˜ˆ๋ฅผ ๋“ค์–ด, ๋‹ค์Œ์„ ๋ด…์‹œ๋‹ค:
394394
395395
```ts
396396
interface A {
397-
a: number; // notice this is 'number'
397+
a: number; // 'number' ์ธ ๊ฒƒ์— ์ฃผ๋ชฉ
398398
}
399399

400400
interface B {
401401
b: string;
402402
}
403403

404404
interface C {
405-
a?: boolean; // notice this is 'boolean'
405+
a?: boolean; // 'boolean' ์ธ๊ฒƒ์— ์ฃผ๋ชฉ
406406
b: string;
407407
}
408408

@@ -412,23 +412,23 @@ declare let y: C;
412412
y = x;
413413
```
414414
415-
In previous versions of TypeScript, this was allowed because while `A` was totally incompatible with `C`, `B` *was* compatible with `C`.
415+
์ด์ „ ๋ฒ„์ „์˜ TypeScript์—์„œ๋Š”, `A`๊ฐ€ `C`์™€ ์™„์ „ํžˆ ํ˜ธํ™˜๋˜์ง€ ์•Š์ง€๋งŒ, `B`๊ฐ€ `C`์™€ ํ˜ธํ™˜ *๋˜์—ˆ๊ธฐ* ๋•Œ๋ฌธ์— ํ—ˆ์šฉ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
416416
417-
In TypeScript 3.9, so long as every type in an intersection is a concrete object type, the type system will consider all of the properties at once.
418-
As a result, TypeScript will see that the `a` property of `A & B` is incompatible with that of `C`:
417+
TypeScript 3.9์—์„œ๋Š”, ๊ต์ง‘ํ•ฉ ์•ˆ์˜ ๋ชจ๋“  ํƒ€์ž…์ด ๊ตฌ์ œ์ ์ธ ๊ฐ์ฒด ํƒ€์ž…์ด๋ฉด, ํƒ€์ž… ์‹œ์Šคํ…œ์€ ๋ชจ๋“  ํ”„๋กœํผํ‹ฐ๋ฅผ ํ•œ ๋ฒˆ์— ๊ณ ๋ คํ•ฉ๋‹ˆ๋‹ค.
418+
๊ฒฐ๊ณผ์ ์œผ๋กœ, TypeScript๋Š” `A & B`์˜ `a` ํ”„๋กœํผํ‹ฐ๋Š” `C`์˜ `a` ํ”„๋กœํผํ‹ฐ์™€ ํ˜ธํ™˜๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ๋ด…๋‹ˆ๋‹ค:
419419
420420
```
421-
Type 'A & B' is not assignable to type 'C'.
422-
Types of property 'a' are incompatible.
423-
Type 'number' is not assignable to type 'boolean | undefined'.
421+
'A & B' ํƒ€์ž…์€ 'C' ํƒ€์ž…์— ํ• ๋‹นํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
422+
'a' ํ”„๋กœํผํ‹ฐ์˜ ํƒ€์ž…์€ ํ˜ธํ™˜๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
423+
'number' ํƒ€์ž…์€ 'boolean | undefined' ํƒ€์ž…์— ํ• ๋‹นํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
424424
```
425425
426-
For more information on this change, [see the corresponding pull request](https://github.com/microsoft/TypeScript/pull/37195).
426+
์ด ๋ณ€๊ฒฝ์‚ฌํ•ญ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์ •๋ณด๋Š”, [ํ•ด๋‹น pull request](https://github.com/microsoft/TypeScript/pull/37195)๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.
427427
428-
### Intersections Reduced By Discriminant Properties
428+
### ํŒ๋ณ„ ํ”„๋กœํผํ‹ฐ๋กœ ์ค„์–ด๋“  ๊ต์ง‘ํ•ฉ (Intersections Reduced By Discriminant Properties)
429429
430-
There are a few cases where you might end up with types that describe values that just don't exist.
431-
For example
430+
์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฐ’์„ ๊ธฐ์ˆ ํ•˜๋Š” ํƒ€์ž…์œผ๋กœ ๋๋‚  ์ˆ˜ ์žˆ๋Š” ๋ช‡ ๊ฐ€์ง€ ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
431+
์˜ˆ๋ฅผ ๋“ค์–ด
432432
433433
```ts
434434
declare function smushObjects<T, U>(x: T, y: U): T & U;
@@ -450,50 +450,50 @@ let z = smushObjects(x, y);
450450
console.log(z.kind);
451451
```
452452
453-
This code is slightly weird because there's really no way to create an intersection of a `Circle` and a `Square` - they have two incompatible `kind` fields.
454-
In previous versions of TypeScript, this code was allowed and the type of `kind` itself was `never` because `"circle" & "square"` described a set of values that could `never` exist.
453+
์ด ์ฝ”๋“œ๋Š” `Circle`๊ณผ `Square`์˜ ๊ต์ง‘ํ•ฉ์„ ์ƒ์„ฑํ•  ๋ฐฉ๋ฒ•์ด ์ „ํ˜€ ์—†๊ธฐ ๋•Œ๋ฌธ์— ์•ฝ๊ฐ„ ์ด์ƒํ•ฉ๋‹ˆ๋‹ค - ํ˜ธํ™˜๋˜์ง€ ์•Š๋Š” ๋‘ `kind` ํ•„๋“œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
454+
์ด์ „ ๋ฒ„์ „์˜ TypeScript์—์„œ๋Š”, ์ด ์ฝ”๋“œ๋Š” ํ—ˆ์šฉ๋˜์—ˆ๊ณ  `"circle" & "square"`๊ฐ€ `์ ˆ๋Œ€(never)` ์กด์žฌํ•  ์ˆ˜ ์—†๋Š” ๊ฐ’์˜ ์ง‘ํ•ฉ์„ ๊ธฐ์ˆ ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— `kind` ์ž์ฒด์˜ ํƒ€์ž…์€ `never`์˜€์Šต๋‹ˆ๋‹ค.
455455
456-
In TypeScript 3.9, the type system is more aggressive here - it notices that it's impossible to intersect `Circle` and `Square` because of their `kind` properties.
457-
So instead of collapsing the type of `z.kind` to `never`, it collapses the type of `z` itself (`Circle & Square`) to `never`.
458-
That means the above code now errors with:
456+
TypeScript 3.9์—์„œ๋Š”, ํƒ€์ž… ์‹œ์Šคํ…œ์ด ๋” ๊ณต๊ฒฉ์ ์ž…๋‹ˆ๋‹ค - `kind` ํ”„๋กœํผํ‹ฐ ๋•Œ๋ฌธ์— `Circle`๊ณผ `Square`๋ฅผ ๊ต์ฐจํ•˜๋Š” ๊ฒƒ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
457+
๊ทธ๋ž˜์„œ `z.kind`๋ฅผ `never`๋กœ ์ถ•์†Œํ•˜๋Š” ๋Œ€์‹ , `z` ์ž์ฒด(`Circle & Square`) ํƒ€์ž…์„ `never`๋กœ ์ถ•์†Œํ•ฉ๋‹ˆ๋‹ค.
458+
์ฆ‰ ์œ„์˜ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๋ฅผ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค:
459459
460460
```
461-
Property 'kind' does not exist on type 'never'.
461+
'kind' ํ”„๋กœํผํ‹ฐ๋Š” 'never' ํƒ€์ž…์— ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
462462
```
463463
464-
Most of the breaks we observed seem to correspond with slightly incorrect type declarations.
465-
For more details, [see the original pull request](https://github.com/microsoft/TypeScript/pull/36696).
464+
๊ด€์ฐฐํ•œ ๋Œ€๋ถ€๋ถ„์˜ ์˜ค๋ฅ˜๋Š” ์ž˜๋ชป๋œ ํƒ€์ž… ์„ ์–ธ๊ณผ ์ผ์น˜ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.
465+
์ž์„ธํ•œ ๋‚ด์šฉ์€ [์›๋ฌธ pull request](https://github.com/microsoft/TypeScript/pull/36696)๋ฅผ ๋ณด์„ธ์š”.
466466
467-
### Getters/Setters are No Longer Enumerable
467+
### Getters/Setters๋Š” ๋” ์ด์ƒ ์—ด๊ฑฐํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค (Getters/Setters are No Longer Enumerable)
468468
469-
In older versions of TypeScript, `get` and `set` accessors in classes were emitted in a way that made them enumerable; however, this wasn't compliant with the ECMAScript specification which states that they must be non-enumerable.
470-
As a result, TypeScript code that targeted ES5 and ES2015 could differ in behavior.
469+
์ด์ „ ๋ฒ„์ „์˜ TypeScript์—์„œ, ํด๋ž˜์Šค์˜ `get`๊ณผ `set` ์ ‘๊ทผ์ž๋Š” ์—ด๊ฑฐ ๊ฐ€๋Šฅํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ๋ฐฉ์ถœ๋˜์—ˆ์Šต๋‹ˆ๋‹ค; ํ•˜์ง€๋งŒ, `get`๊ณผ `set`์€ ์—ด๊ฑฐํ•  ์ˆ˜ ์—†๋‹ค๋Š” ECMAScript ์‚ฌ์–‘์„ ๋”ฐ๋ฅด์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
470+
๊ฒฐ๊ณผ์ ์œผ๋กœ, ES5์™€ ES2015๋ฅผ ํƒ€๊ฒŸํŒ… ํ•˜๋Š” TypeScript ์ฝ”๋“œ๋Š” ๋™์ž‘์ด ๋‹ค๋ฅผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
471471
472-
Thanks to [a pull request](https://github.com/microsoft/TypeScript/pull/32264) from GitHub user [pathurs](https://github.com/pathurs), TypeScript 3.9 now conforms more closely with ECMAScript in this regard.
472+
๊นƒํ—ˆ๋ธŒ ์‚ฌ์šฉ์ž [pathurs](https://github.com/pathurs)์˜ [pull request](https://github.com/microsoft/TypeScript/pull/32264) ๋•๋ถ„์—, TypeScript 3.9๋Š” ์ด์™€ ๊ด€๋ จํ•˜์—ฌ ECMAScript์™€ ๋” ๋ฐ€์ ‘ํ•˜๊ฒŒ ํ˜ธํ™˜๋ฉ๋‹ˆ๋‹ค.
473473
474-
### Type Parameters That Extend `any` No Longer Act as `any`
474+
### `any`๋กœ ํ™•์žฅ๋œ ํƒ€์ž… ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” ๋” ์ด์ƒ `any` ์ฒ˜๋Ÿผ ํ–‰๋™ํ•˜์ง€ ์•Š์Œ (Type Parameters That Extend `any` No Longer Act as `any`)
475475
476-
In previous versions of TypeScript, a type parameter constrained to `any` could be treated as `any`.
476+
์ด์ „ ๋ฒ„์ „์˜ TypeScript์—์„œ `any`๋กœ ์ œํ•œ๋œ ํƒ€์ž… ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” `any`๋กœ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
477477
478478
```ts
479479
function foo<T extends any>(arg: T) {
480-
arg.spfjgerijghoied; // no error!
480+
arg.spfjgerijghoied; // ์˜ค๋ฅ˜๊ฐ€ ์•„๋‹˜!
481481
}
482482
```
483483
484-
This was an oversight, so TypeScript 3.9 takes a more conservative approach and issues an error on these questionable operations.
484+
์ด๋Š” ์‹ค์ˆ˜์˜€์Šต๋‹ˆ๋‹ค, ๊ทธ๋ž˜์„œ TypeScript 3.9์—์„œ๋Š” ๋” ๋ณด์ˆ˜์ ์ธ ์ ‘๊ทผ์„ ์ทจํ•˜๊ณ  ์ด๋Ÿฐ ์˜์‹ฌ์Šค๋Ÿฌ์šด ์ž‘์—…์— ๋Œ€ํ•ด ์˜ค๋ฅ˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.
485485
486486
```ts
487487
function foo<T extends any>(arg: T) {
488488
arg.spfjgerijghoied;
489489
// ~~~~~~~~~~~~~~~
490-
// Property 'spfjgerijghoied' does not exist on type 'T'.
490+
// 'spfjgerijghoied' ํ”„๋กœํผํ‹ฐ๋Š” 'T' ํƒ€์ž…์— ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
491491
}
492492
```
493493
494-
### `export *` is Always Retained
494+
### `export *`์€ ํ•ญ์ƒ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค (`export *` is Always Retained)
495495
496-
In previous TypeScript versions, declarations like `export * from "foo"` would be dropped in our JavaScript output if `foo` didn't export any values.
497-
This sort of emit is problematic because it's type-directed and can't be emulated by Babel.
498-
TypeScript 3.9 will always emit these `export *` declarations.
499-
In practice, we don't expect this to break much existing code.
496+
์ด์ „ TypeScript ๋ฒ„์ „์—์„œ `export * from "foo"` ๊ฐ™์€ ์„ ์–ธ์€ `foo`๊ฐ€ ์–ด๋– ํ•œ ๊ฐ’๋„ export ํ•˜์ง€ ์•Š์œผ๋ฉด JavaScript ์ถœ๋ ฅ์—์„œ ์ œ์™ธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
497+
์ด๋Ÿฐ ๋‚ด๋ณด๋‚ด๊ธฐ๋Š” ํƒ€์ž…-์ง€ํ–ฅ์ ์ด๊ณ  ๋ฐ”๋ฒจ์—์„œ ์—๋ฎฌ๋ ˆ์ดํŠธ ๋  ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— ๋ฌธ์ œ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.
498+
TypeScrip 3.9๋Š” ์ด๋Ÿฐ `export *` ์„ ์–ธ์„ ํ•ญ์ƒ ๋‚ด๋ณด๋ƒ…๋‹ˆ๋‹ค.
499+
์‹ค์ œ๋กœ ์ด ๋ณ€ํ™”๊ฐ€ ๊ธฐ์กด ์ฝ”๋“œ๋ฅผ ๊นจ๋œจ๋ฆด ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

0 commit comments

Comments
ย (0)