rescript-lang / rescript-lang/rescript

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

Aperta
#8,378 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
OCaml
Stelle
7.5k
Fork
485
Merge medio
1g 2h
PR unite (30g)
55

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

La proposta riguarda i moduli Null e Nullable, il loro comportamento JavaScript generato e un possibile feature flag di configurazione di ReScript. Poiché non vengono indicati file, test o punti di ingresso, inizia individuando questi moduli e rivedendo il piano di migrazione proposto per v12–v14. Il lavoro sarà considerato completato quando sarà stata concordata una strategia di denominazione e migrazione prima dell’implementazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, ocaml
Ambito
compilers
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.