Skip to content

Migrate to ReScript 12; compatibility with ReScript 13 alpha#36

Open
cknitt wants to merge 3 commits into
TheSpyder:mainfrom
cknitt:rescript-12
Open

Migrate to ReScript 12; compatibility with ReScript 13 alpha#36
cknitt wants to merge 3 commits into
TheSpyder:mainfrom
cknitt:rescript-12

Conversation

@cknitt
Copy link
Copy Markdown

@cknitt cknitt commented Apr 20, 2026

Summary

Migrate rescript-nodejs to ReScript 12 and make the codebase compatible with the ReScript 13 alpha.

This updates the project to ReScript 12 package conventions, moves compiled JS output in-source, and rewrites affected bindings/tests to match the newer standard library and syntax changes.

What Changed

  • upgrade the project compiler dependency from ReScript 11 to ReScript 12
  • switch the package config to ReScript 12 conventions in rescript.json
  • emit .res.js files in-source instead of generating .bs.js files under lib/js
  • update tests and examples to use the new compiled output paths
  • simplify bindings to current stdlib types and helpers such as nullable, Null, dict, promise, Symbol, JSON, and typeof

Breaking Changes

  • functions with optional parameters no longer require a trailing () call
  • the npm package now only ships the binding sources under src/ plus package metadata; generated .res.js, tests, examples, and docs are no longer published

Notes

  • the committed generated JS now lives next to the corresponding .res sources in src/, test/, and examples/, replacing the old lib/js output layout
  • README.md installation instructions now reference rescript.json and dependencies

@TheSpyder
Copy link
Copy Markdown
Owner

Thank you! I am often unsure how many people still use my libraries and whether they need migrating.

I'll look at this soon.

Comment thread rescript.json
{
"module": "commonjs",
"in-source": false
"in-source": true
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Since the JS files aren't distributed on NPM anymore, which to be honest I should've changed years ago, what's the harm in leaving this as false? It would make the JS diffs in this PR easier to review (assuming git is smart enough to treat them as renamed at that point).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I would consider in-source best practice in general, and it allows us to just add the whole lib dir to .gitignore.

The file extension also changed from .bs.js to .res.js. So there is a move in any case.
But GitHub also shows changes in the moved files, except in some cases where there were too many.

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