rescript-lang / rescript-lang/rescript
Proposal to rename Null->Nullable, Nullable->Nullish
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 7.5k
- Forks
- 485
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 55
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The proposal concerns the Null and Nullable modules, their generated JavaScript behavior, and a possible ReScript configuration feature flag. No files, tests, or entry points are named, so start by locating those modules and reviewing the proposed v12–v14 migration plan. Done would require an agreed naming and migration strategy before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, ocaml
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100