microsoft / microsoft/TypeScript

Bloomberg feedback for 5.8

オープン
#61,226 コメント 1 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Discussion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

Acknowledgement
  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment

We evaluated the 5.8 beta and RC releases and 5.8 seems to be a low impact release for us.

We are excited to adopt the new flag --erasableSyntaxOnly for the improved Editor experience for features we already avoid. A significant number of our projects already comply with the corresponding rules due to custom error checks that will happily become redundant. We remain interested in gaining the ability to use first-class enums that comply with the TS=JS+types model. For example via the erasable as enum syntax proposal.

# Change Affects Release notes Packages affected
1 Computed properties with a non literal type now appear in declarations Declaration Emit Yes >1%
2 Better type checking of conditional expressions Type Checking No Yes ~1-2%
Computed properties with a non literal type now appear in declarations

Some declaration files changed and now preserve computed properties where index signatures would previously be created. This is an expected change and part of ongoing Isolated Declarations work.

// index.ts
export let foo = "x"
export class Bar {
    [foo]: string
}

// index.d.ts
export declare let foo: string;
export declare class Bar {
    // in 5.8
    [foo]: string;
    // in 5.7
    [x: string]: string;
}
Better checking in conditional expressions

We observed roughly a dozen new compile errors relating to improved conditional return checking.

While not directly announced the change seems related to Checked Returns for Conditional and Indexed Access Types

In TypeScript 5.7 and before, if a branch of a conditional expression returned any we would not get an error if we returned the wrong type on the other branch. Now we do, at least if the expression is in the return of a function:

declare const data: number | string | undefined;
const  result = (): number =>
    typeof data === 'string'
        ? null as any
        : data; // Error now


const  result2: number =  
    typeof data === 'string'
        ? null as any
        : data; // Still not an error ? 😕

Link

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、リンク先の TypeScript Playground で条件式の例を 5.7.3 と 5.8 を使って再現し、その後、報告されている declaration emit の例をバージョン間で比較します。Issue には観測された動作が記録されていますが、ソースファイル、テスト、具体的に望まれる変更のいずれも示されていないため、完了にはどちらかの動作が誤っているかどうかについて maintainer の指針が必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。