rescript-lang / rescript-lang/rescript

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

Open
#8,378 2 comments 0 reactions 0 assignees View on GitHub

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.

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.