Proposal to rename Null->Nullable, Nullable->Nullish

オープン
#8,378 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
javascript, ocaml
領域
compilers

調査の方向性

この提案は、Null モジュールと Nullable モジュール、それらが生成する JavaScript の挙動、および ReScript の設定用の機能フラグの可能性に関するものです。ファイル、テスト、エントリポイントが指定されていないため、まずこれらのモジュールを見つけ、提案されている v12–v14 への移行計画を確認してください。実装前に命名と移行の戦略について合意できれば完了です。

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

説明

I'm perfectly fine with naming we had all this time, but in a new era AI writes most of the code, and I think having a naming parity with JavaScript is more important. For example, this proposal was inspired by the Claude Code session where it was doing bindings for napi-rs and it used Nullable.t type thinking that its value is null, like in TS. I had to correct it myself, saying that it should use a more correct Null.t type.

Image

Additionally, Null.t by itself is already confusing, making me subconsciously think that it's just a null value type.

Proposed migration plan

Since this is a very big breaking change and updating both modules at the same time will be an issue because it might silently change generated JavaScript code, I think we must approach it in multiple major releases. And because of this, start earlier. Here is the proposed plan.

  1. In next v12 minor we deprecate Nullable module in favor of the new Nullish module
  2. In v13 we we remove Nullable in favor of Nullish
  3. In v14 we deprecate Null module in favor of Nullable - I think there should be a whole major version without Nullable module to prevent issues during migration

To accelerate the change, we can add a feature flag in ReScript config which would allow us to explicitly force the migration: Null->Nullable, Nullable->Nullish

Let me know what you think.

主要言語
OCaml
スター
7.5k
フォーク
485
平均マージ
1日 2時間
マージ済み PR(30日)
55

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

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

はじめの一歩

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

rescript-lang/rescript のほかの issue

rescript-lang/rescript の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

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

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