Skip to content

Remove deprecated Js modules - #8531

Open
cknitt wants to merge 8 commits into
masterfrom
remove-js
Open

Remove deprecated Js modules#8531
cknitt wants to merge 8 commits into
masterfrom
remove-js

Conversation

@cknitt

@cknitt cknitt commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

Remove the deprecated Js namespace and its associated runtime modules in preparation for ReScript 13.

  • Remove deprecated modules such as Js.Array2, Js.String2, Js.Dict, and Js.Promise
  • Migrate compiler, runtime, tests, and examples to current standard-library APIs
  • Move internal method-callback definitions from Js_OO to Primitive_js_extern
  • Rename the existing opaque Js.Blob and Js.File stubs to Blob and File as temporary compatibility types
  • Remove tests for the now-obsolete Js-to-stdlib migration rules
  • Update runtime artifacts and rewatch test dependencies

Breaking change

Code using the deprecated Js namespace must migrate to the corresponding standard-library APIs, for example:

  • Js.Array2Array
  • Js.String2String
  • Js.DictDict
  • Js.Promise / Js.Promise2Promise
  • Js.JsonJSON
  • Js.NullableNullable
  • Js.FileFile
  • Js.BlobBlob

The Js.undefined<'a> type can be replaced with undefined<'a>. The Js.Undefined module has no direct replacement. Depending on the operation and intended semantics, code may need to use Nullable, option, or its own JavaScript interop binding.

The File and Blob types remain opaque compatibility stubs. They do not introduce new Web API bindings and are expected to move out of the standard library in favor of the separate WebAPI package.

Syntax tests and benchmarks

We also replaced Js.* references in the syntax-test and benchmark fixtures. This was not required for the tests and benchmarks to work because these fixtures test parsing and formatting, not type-checking.

We updated them so that:

  • Test and benchmark examples use the current standard-library APIs
  • Expected test output does not contain removed APIs
  • Searching the repository for remaining Js.* references gives meaningful results
  • Deprecated examples do not remain in the codebase indefinitely

The changes preserve the syntax each fixture is intended to exercise. The corresponding expected output was updated where necessary.

The syntax-test script now checks that Js.* references are not reintroduced into syntax-test or benchmark fixtures.

CI note

The Sury PPX fixture is temporarily disabled on Intel macOS because the current sury-ppx package only ships an ARM64 macOS binary. The fixture remains enabled on other supported platforms and can be re-enabled on Intel macOS once Sury restores an x64 binary.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.59%. Comparing base (ddf77e3) to head (ceb1b1d).

Files with missing lines Patch % Lines
compiler/ml/ast_untagged_variants.ml 66.66% 1 Missing ⚠️
compiler/syntax/src/jsx_v4.ml 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8531      +/-   ##
==========================================
- Coverage   74.70%   74.59%   -0.11%     
==========================================
  Files         458      458              
  Lines       62366    62302      -64     
==========================================
- Hits        46593    46477     -116     
- Misses      15773    15825      +52     
Files with missing lines Coverage Δ
analysis/reanalyze/src/exn_lib.ml 100.00% <ø> (ø)
analysis/src/completion_front_end.ml 81.54% <ø> (ø)
compiler/core/lam_convert.ml 80.28% <ø> (ø)
compiler/core/outcome_printer_ns.ml 0.00% <ø> (ø)
compiler/frontend/ast_exp_handle_external.ml 76.74% <ø> (+18.84%) ⬆️
compiler/frontend/ast_literal.ml 63.15% <ø> (ø)
compiler/frontend/ast_typ_uncurry.ml 100.00% <100.00%> (ø)
compiler/frontend/ast_uncurry_gen.ml 88.46% <ø> (ø)
compiler/gentype/gentype_common.ml 86.36% <100.00%> (ø)
compiler/gentype/translate_structure.ml 70.46% <ø> (+1.23%) ⬆️
... and 9 more

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8531

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8531

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8531

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8531

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8531

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8531

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8531

commit: ceb1b1d

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

@cknitt
cknitt marked this pull request as ready for review August 8, 2026 06:30
@cknitt

cknitt commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b86c7c52fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/tests/src/ticker.res Outdated
@cknitt

cknitt commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5dbf08614

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread compiler/syntax/src/jsx_v4.ml
@cknitt

cknitt commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: ceb1b1d0d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread compiler/core/design.md
@@ -1 +1 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird document. Is this even still relevant?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not, but I'd do a separate cleanup for that.

/*** The ReScript standard library.

Belt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.
Belt mostly covers collection types. Use the top-level `String` and `Date` modules for string and date functions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should also be mentioned that Belt functions needs some more runtime space, but are often faster?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but also not really in the scope of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants