Skip to content

Conversation

@fhammerschmidt
Copy link
Member

No description provided.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 12, 2025

Deploying rescript-lang-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: 96f546f
Status: ✅  Deploy successful!
Preview URL: https://7a8e2b18.rescript-lang.pages.dev
Branch Preview URL: https://v12-migration-guide.rescript-lang.pages.dev

View logs

@fhammerschmidt
Copy link
Member Author

fhammerschmidt commented Jul 14, 2025

rescript build -w is deprecated
We need to mention it's now rescript watch

@nojaf
Copy link
Member

nojaf commented Sep 6, 2025

Somewhere in this guide, we should mention that people need to bump to latest @rescript/react as it still uses old pipe (|>) syntax.

@fhammerschmidt
Copy link
Member Author

Concerning pipe-last:
V11 formats it away, but only in uncurried mode. Which is another prerequisite for v12 anyways.

@nojaf
Copy link
Member

nojaf commented Nov 11, 2025

@fhammerschmidt sorry for pushing to this branch, I hope I didn't mess anything local up on your end.
I've added some stuff I think we need to include.
No strong opinion on the exact format, adding the info was my main goal.

@fhammerschmidt
Copy link
Member Author

It's fine. In fact we could and should crowdsource more articles.

@fhammerschmidt fhammerschmidt changed the title WIP: V12 migration guide V12 migration guide Nov 13, 2025
@rescript-lang rescript-lang deleted a comment from vercel bot Nov 18, 2025
- ReScript V11 project.
- Uncurried mode must be enabled (i.e. you have not opted-out from it)
- Your project must not contain any OCaml source code anymore, as support for `.ml` files is removed in this version. However there are ways to convert OCaml syntax with an older ReScript compiler version ([see below](#converting-generated-ml-files)).
- The old configuration filename that was deprecated in v11, `bsconfig.json`, is removed. Rename it to `rescript.json`.
Copy link
Member

Choose a reason for hiding this comment

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

Actually support bsconfig.json is not removed yet in v12.

- Uncurried mode must be enabled (i.e. you have not opted-out from it)
- Your project must not contain any OCaml source code anymore, as support for `.ml` files is removed in this version. However there are ways to convert OCaml syntax with an older ReScript compiler version ([see below](#converting-generated-ml-files)).
- The old configuration filename that was deprecated in v11, `bsconfig.json`, is removed. Rename it to `rescript.json`.
- Minimum supported Node.js version is 20.0.0
Copy link
Member

Choose a reason for hiding this comment

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

Actually 20.11.0


Some typical name changes include:

`Error.t` -> `JsError.t`
Copy link
Member

Choose a reason for hiding this comment

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

The following is rather unreadable on the website, best make it a list.


### Bitwise operations

v11:
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the following is true. AFAIK we did not have such operators in v11 at all.

npm run convert-ml
```

This setup is an escape hatch. It keeps legacy generators like `atdgen` working but it also forces you to maintain two compiler versions. Whenever possible migrate such things to modern ReScript tooling such as [Sury](https://github.com/DZakh/sury/).
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to say that this is an escape hatch at the beginning of this section already.


### Build system & CLI

- The new Rust-based `rewatch` build system now powers the `rescript` command. The old Ninja builder moved behind `rescript legacy`, the standalone `rewatch` command was removed, and `--compiler-args` became the `compiler-args` subcommand. https://github.com/rescript-lang/rescript/pull/7551 https://github.com/rescript-lang/rescript/pull/7593
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- The new Rust-based `rewatch` build system now powers the `rescript` command. The old Ninja builder moved behind `rescript legacy`, the standalone `rewatch` command was removed, and `--compiler-args` became the `compiler-args` subcommand. https://github.com/rescript-lang/rescript/pull/7551 https://github.com/rescript-lang/rescript/pull/7593
- The new Rust-based `rewatch` build system now powers the `rescript` command. The old Ninja-based builder system moved behind `rescript legacy`, and `--compiler-args` became the `compiler-args` subcommand. https://github.com/rescript-lang/rescript/pull/7551 https://github.com/rescript-lang/rescript/pull/7593

### Build system & CLI

- The new Rust-based `rewatch` build system now powers the `rescript` command. The old Ninja builder moved behind `rescript legacy`, the standalone `rewatch` command was removed, and `--compiler-args` became the `compiler-args` subcommand. https://github.com/rescript-lang/rescript/pull/7551 https://github.com/rescript-lang/rescript/pull/7593
- The `rescript legacy` subcommand was removed in favor of a stand-alone `rescript-legacy` binary. https://github.com/rescript-lang/rescript/pull/7928
Copy link
Member

Choose a reason for hiding this comment

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

Merge with the above.

- The `rescript legacy` subcommand was removed in favor of a stand-alone `rescript-legacy` binary. https://github.com/rescript-lang/rescript/pull/7928
- `rescript format` was reimplemented in Rust, its options now use the `--check` / `--stdin` long-form spelling, and the `--all` flag was removed because every tracked file (non-dev by default) is formatted automatically. https://github.com/rescript-lang/rescript/pull/7603 https://github.com/rescript-lang/rescript/pull/7752
- The `rescript dump` command was removed; call `bsc` directly if you need to inspect `.cmi` files. https://github.com/rescript-lang/rescript/pull/7710
- `rewatch` now builds packages marked with `"type": "dev"` (and their `dev-dependencies`) by default, and the CLI `--dev` flag no longer has any effect. https://github.com/rescript-lang/rescript/pull/7934
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed (not a change compared to v11).


### Configuration & platform

- The minimum supported Node.js version is now 20. https://github.com/rescript-lang/rescript/pull/7354
Copy link
Member

Choose a reason for hiding this comment

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

Actually 20.11.0


- The minimum supported Node.js version is now 20. https://github.com/rescript-lang/rescript/pull/7354
- The `experimental-features` key in `rescript.json` now uses kebab-case to match the other config fields. https://github.com/rescript-lang/rescript/pull/7891
- The legacy `-bs-super-errors` flag was removed along with Super_errors. https://github.com/rescript-lang/rescript-compiler/pull/6814
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- The legacy `-bs-super-errors` flag was removed along with Super_errors. https://github.com/rescript-lang/rescript-compiler/pull/6814
- The legacy `-bs-super-errors` flag was removed. https://github.com/rescript-lang/rescript-compiler/pull/6814

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.

7 participants