rescript-lang / rescript-lang/rescript
Proposal to rename Null->Nullable, Nullable->Nullish
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.
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.
- In next v12 minor we deprecate
Nullablemodule in favor of the newNullishmodule - In v13 we we remove
Nullablein favor ofNullish - In v14 we deprecate
Nullmodule in favor ofNullable- I think there should be a whole major version withoutNullablemodule 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- 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