Skip to content

Conversation

@chelproc
Copy link
Contributor

No description provided.

@chelproc chelproc marked this pull request as draft October 19, 2025 05:48
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 19, 2025

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1998787
Status: ✅  Deploy successful!
Preview URL: https://83228af3.utcode-learn.pages.dev
Branch Preview URL: https://rewrite-typescript.utcode-learn.pages.dev

View logs

@chelproc chelproc marked this pull request as ready for review October 25, 2025 12:12
| 引数の型 | `T``U` の部分型 | `(x: U) => R``(x: T) => R` の部分型 |
| 戻り値の型 | `T``U` の部分型 | `() => T``() => U` の部分型 |

戻り値の型については自然に理解できますが、引数の数や引数の型については直感に反するかもしれません。このような関係になっているのは、関数が受け取る引数が少なかったり、より一般的な型であったりする場合、その関数はより多くの状況で安全に使用できるためです。
Copy link
Contributor

@Yokomi422 Yokomi422 Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

型の互換性は難しいですね. 共変と反変を理解していないからか. https://www.typescriptlang.org/docs/handbook/type-compatibility.html


**問題1**: `string & number`型は何型と等しいでしょうか。

**問題2**: 次のように定義される型`T`に対して使用可能なプロパティは何でしょうか。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用可能の意味がはっきりしていない気がしました。

  1. 型絞り込み(type narrowing)なしで直接アクセス可能という意味なのか
  2. 何らかの方法で使用可能という意味なのか
    type narrowingがないときになどあった方が明確かと思いました。

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

難易度の高い内容も増えているので、DocusaurusのAdmonitionsなどの機能を使って、もう少し初めて学習する際の難易度を下げられるといいかなと思います。特に集合の考え方に日頃から慣れ親しんでいないとかなり認知負荷が高い箇所が多いように思います。

return item.price * quantity;
}

const book = new Book("TypeScript 入門", 2500, "山田 太郎");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般的には、和文文字と欧文文字間には半角スペースを入れないことの方が多いように思います。
cf. https://ndlsearch.ndl.go.jp/books/R100000002-I032089505 https://ndlsearch.ndl.go.jp/search?cs=bib&keyword=TypeScript+%E5%85%A5%E9%96%80

@chvmvd chvmvd requested a review from Copilot October 31, 2025 14:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restructures and expands the TypeScript documentation, converting it from an exercise-based format to a more comprehensive tutorial with embedded practice problems. The changes improve pedagogical flow by integrating examples and exercises directly into each section.

  • Reorganizes content structure by promoting subsections to main sections and integrating exercises inline
  • Adds new practice problems with detailed answers throughout the document
  • Expands explanations on type relationships, subtyping, and generics with concrete examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chvmvd
Copy link
Contributor

chvmvd commented Nov 3, 2025

難易度の高い内容も増えているので、DocusaurusのAdmonitionsなどの機能を使って、もう少し初めて学習する際の難易度を下げられるといいかなと思います。特に集合の考え方に日頃から慣れ親しんでいないとかなり認知負荷が高い箇所が多いように思います。

補足ですが、特にクラスや関数型の部分型の関係などについては、内容がかなり高度なので削除を検討しても良いように思います。

こういった言語機能は他の多くのプログラミング言語でも用意されており、[ジェネリクス](https://www.typescriptlang.org/docs/handbook/2/generics.html)と呼ばれます。

`type`宣言でも型パラメータを利用できます。
`type`やクラスでも型パラメータを利用できます。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type=>type宣言?

`type`宣言を用いると、データ型に対して別名を付けられます。

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一箇所のみ少しだけ気になるところはありますが、他は全く問題ないと思います!
TypeScriptの節がかなり読みやすくなったと思います。ありがとうございます。

こういった言語機能は他の多くのプログラミング言語でも用意されており、[ジェネリクス](https://www.typescriptlang.org/docs/handbook/2/generics.html)と呼ばれます。

`type`宣言でも型パラメータを利用できます。
`type`やクラスでも型パラメータを利用できます。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もうコメントできることなさそうです👌

@chvmvd chvmvd merged commit 047c412 into main Dec 6, 2025
3 checks passed
@chvmvd chvmvd deleted the rewrite-typescript branch December 6, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants