Releases: rescript-lang/rescript
Releases · rescript-lang/rescript
Release list
13.0.0-alpha.5
💥 Breaking Change
- Make
Jsx.componentabstract. #8390 - Drop Node.js version 20.x support, as it is reaching EOL. #8401
- Remove the
@taggedTemplatedecorator in favor of the new first-classtaggedTemplate<'param, 'output>builtin type. Using the decorator, or backtick tagged-template syntax on a value that is not ataggedTemplate, is now a compile error pointing to the new binding form. #8461
🚀 New Feature
- Add a first-class
taggedTemplate<'param, 'output>builtin type and theTaggedTemplatestdlib module (TaggedTemplate.make). Tagged-template tags are now tracked through the type system, so they emit real JS tagged-template syntax across module boundaries, when passed as first-class values, and when constructed at runtime by a factory (e.g.postgres). #8461 - Make mutation of private record mutable fields a configurable warning instead of a hard error. #8366
- Add support for pattern matching/destructuring of record rest. #8317
🐛 Bug fix
- Fix directive
@warning("-102")not working. #8322 - Fix duplicated comments in
for..offormatter. #8395 - Fix issue where warning 56 would blow up with
dict{}patterns. #8403 - Rewatch build lock fixes. #8409 #8410 #8413 #8424
- Rewatch: treat transitive workspace dependencies as local packages in monorepo roots. #8411
- Rewatch: use a single timestamp per compile pass. #8428
- Fix rewatch warning replay after early compile errors. #8408
- Fix formatting of trailing comments before
=in let bindings. #8444 - Fix analysis namespace parsing after the Yojson migration. #8454
- Fix namespaced reference lookup in editor analysis. #8455
- Fix analysis segmentation fault for references after #7887. #8477
- Fix build crash when the compiler emits output that is not valid UTF-8, such as a truncated multibyte character in a code frame. #8482
- Fix unnecessary boxing of
Some(React.component). #8500 - Fix GenType React element output to support React 19 typedefs. #8501
💅 Polish
- Consolidate record mutation output into a single spread object literal. #8473
- Improve default argument type mismatch errors. #8389
- Resolve workspace dependencies in editor analysis. #8392
- Build system: Add OpenTelemetry tracing support for cli commands. #8370
- Use a single vendored @rescript/react package across the repo. #7525
- Improve deprecated attribute extraction and support record form. #8396
- Refactor analysis to decouple I/O from core logic. #8426
- Deprecate
Stdlib_ErrorandStdlib_Exnmodules in favor ofJsError/JsExn. #8404 - Remove vendored
Jsonlibrary and useyojsonandlsplibrary for analysis. #8436 - Improve clarity of various error and warning messages. #8460
🏠 Internal
- Remove
Primitive_option.toUndefined; usevalFromOptionfor optional ffi args. #8380 - Add a developer playground for testing the current compiler bundle locally and deploy the latest
masterbuild to GitHub Pages. #8435 - Expand
super_errorsfixture coverage for warnings and errors. #8429 - Run
super_errorsfixtures in parallel (~2.4× faster locally). #8430 - Expand
super_errorsfixture coverage for the remaining reachable single-file error variants. #8432 - Cache OPAM env, rewatch build, and instrumented dune state in the coverage workflow. #8434
- Add a multi-file fixture harness (
super_errors_multi) for cross-module errors and warnings. #8433 - Catalog every named compiler error variant in
tests/ERROR_VARIANTS.mdand add fixtures for the remaining reachable ones. #8446 - Remove dead and unreachable compiler error and warning variants; add fixtures for the ones found to be reachable. #8459
- Convert OCaml codebase to snake case format. #8456
- Analysis refactor: remove global state
Shared_types.state. #8465 - Refactor analysis CLI helpers to use source input. #8466
- Include syntax, gentype, analysis, tools, and reanalyze tests in coverage reports. #8467
- Remove the unreachable
Longident.Lapplyconstructor (OCaml's applicative-functor path syntaxF(X).t, which ReScript's grammar cannot produce). #8469 - Refactor analysis for server side use. #8478
- Remove unused files. #8481
- Remove the dead
Sig_class/Sig_class_typesignature variants (OCaml class items, which ReScript cannot produce). #8470
12.3.0
(No changes compared to 12.3.0-beta.1.)
🚀 New Feature
- Reanalyze: add glob pattern support for suppress/unsuppress configurations (e.g.,
"src/generated/**"). #8277 - Add optional
~localesand~optionsparameters toString.localeCompare. #8287
🐛 Bug fix
- Fix
nulland array values incorrectly matching theObjectbranch when pattern matching onJSON.t(or other untagged variants with anObjectcase) in statement position. #8279 - Fix rewatch panic when
package.jsonhas nonamefield. #8291 - Fix unpacking first-class module in default argument of react component. #8296
- Fix exception record field regression. #8319
- Rewatch: ignore stale lock for unrelated process name. #8316
- Fix partial application generalization for
.... #8343 - Preserve JSX prop locations across the AST0 translation layer, fixing
0:0editor diagnostics in PPX-related flows. #8350 - Allow builds while watchers are running. #8349
- Rewatch: preserve warnings after atomic-save full rebuilds. #8358
- Fix type lowering for
dict{}andasync, so you don't need to annotate one extra time when the type is known. #8359 - Fix issue where warning 56 would blow up with
dict{}patterns. #8403 - Rewatch build lock fixes. #8409 #8410 #8413 #8424
- Rewatch: treat transitive workspace dependencies as local packages in monorepo roots. #8411
💅 Polish
- Reanalyze server: redesign incremental fixpoint with delete-then-rederive strategy and predecessor tracking, improving speed on deletions. #8276
- Improve error message for dependency without
rescript.json. #8292 - Resolve workspace dependencies in editor analysis. #8392
- Improve deprecated attribute extraction and support record form. #8396
- Improve default argument type mismatch errors. #8389
12.3.0-beta.1
🚀 New Feature
- Reanalyze: add glob pattern support for suppress/unsuppress configurations (e.g.,
"src/generated/**"). #8277 - Add optional
~localesand~optionsparameters toString.localeCompare. #8287
🐛 Bug fix
- Fix
nulland array values incorrectly matching theObjectbranch when pattern matching onJSON.t(or other untagged variants with anObjectcase) in statement position. #8279 - Fix rewatch panic when
package.jsonhas nonamefield. #8291 - Fix unpacking first-class module in default argument of react component. #8296
- Fix exception record field regression. #8319
- Rewatch: ignore stale lock for unrelated process name. #8316
- Fix partial application generalization for
.... #8343 - Preserve JSX prop locations across the AST0 translation layer, fixing
0:0editor diagnostics in PPX-related flows. #8350 - Allow builds while watchers are running. #8349
- Rewatch: preserve warnings after atomic-save full rebuilds. #8358
- Fix type lowering for
dict{}andasync, so you don't need to annotate one extra time when the type is known. #8359 - Fix issue where warning 56 would blow up with
dict{}patterns. #8403 - Rewatch build lock fixes. #8409 #8410 #8413 #8424
- Rewatch: treat transitive workspace dependencies as local packages in monorepo roots. #8411
💅 Polish
- Reanalyze server: redesign incremental fixpoint with delete-then-rederive strategy and predecessor tracking, improving speed on deletions. #8276
- Improve error message for dependency without
rescript.json. #8292 - Resolve workspace dependencies in editor analysis. #8392
- Improve deprecated attribute extraction and support record form. #8396
- Improve default argument type mismatch errors. #8389
13.0.0-alpha.4
💥 Breaking Change
- Support for
breakandcontinuein loops.breakandcontinueare new keywords. #8348 - Fix iterator / iterable typedefs, add generator typedefs. #8355
- Remove deprecated
%externalextension. #8376 - Remove Belt API functions returning
undefined<'a>(e.g.,Belt.Array.getUndefined). Functions returningoption<'a>should be used instead (e.g.,Belt.Array.get). #8377
🚀 New Feature
- Implement
for...ofandfor await...ofloops. #7887 - Add support for dict spreads:
dict{...foo, "bar": 2, ...qux}. #8369 - Rewatch: add
--prodflag tobuild,watch, andcleanto skip dev-dependencies and dev sources ("type": "dev"), enabling builds in environments where dev packages aren't installed (e.g. afterpnpm install --prod). #8347 - Rewatch: feature-gated source directories. Tag a source entry with
"feature": "<name>"and select with--features a,b(or per-dep independencies/dev-dependencies) to include optional slices of a package's source tree at build time. Top-levelfeaturesmap supports transitive implications. #8379 - Rewatch: improve watch output and add
--clear-screenoption. #8373 - Add
Dict.assignMany,Dict.concat,Dict.concatMany,Dict.concatAll,Array.concatAllto the stdlib. #8364
🐛 Bug fix
- Fix partial application generalization for
.... #8343 - Rewatch: preserve warnings after atomic-save full rebuilds. #8358
- Preserve JSX prop locations across the AST0 translation layer, fixing
0:0editor diagnostics in PPX-related flows. #8350 - Fix type lowering for
dict{}andasync, so you don't need to annotate one extra time when the type is known. #8359 - Rewatch: don't suppress progress messages under
-v/-vv. #8371 - Rewatch: print 'Finished compilation' in watch plain output mode. #8372
💅 Polish
- Allow builds while watchers are running. #8349
- Rewatch: restore backward compatibility for
bsconfig.json. #8368 - Restore parsing of the legacy
(. ...)uncurried syntax for backwards compatibility with libraries still on older ReScript versions; emit a deprecation warning when it is used. Rewatch also surfaces this specific deprecation when it originates from an external dependency so users can report breakage upstream. #8383 - Rewatch: replace wave-based compile scheduler with a work-stealing DAG dispatcher ordered by critical-path priority, avoiding the per-wave stall on the slowest file. #8374
🏠 Internal
- Move
rescript.jsonreading out ofbscinto rewatch; remove the custom OCaml JSON parser. #8365
13.0.0-alpha.3
💥 Breaking Change
- Change
Intl.Collator.comparereturn type frominttoOrdering.t(float). #8289
🚀 New Feature
- Reanalyze: add glob pattern support for suppress/unsuppress configurations (e.g.,
"src/generated/**"). #8277 - Add optional
~localesand~optionsparameters toString.localeCompare. #8287 - Support inline records in external definitions. #8304
🐛 Bug fix
- Reanalyze server: invalidate cache and recompute results when config changes in
rescript.json. #8262 - Fix
nulland array values incorrectly matching theObjectbranch when pattern matching onJSON.t(or other untagged variants with anObjectcase) in statement position. #8279 - Fix rewatch panic when
package.jsonhas nonamefield. #8291 - Fix unpacking first-class module in default argument of React component. #8296
- Fix exception record field regression. #8319
- Rewatch: ignore stale lock for unrelated process name. #8316
- Fix handling of exotic identifiers for let bindings in GenType. #8315
💅 Polish
- Improve error message for dependency without
rescript.json. #8292
🏠 Internal
13.0.0-alpha.2
🐛 Bug fix
- Fix compiler crash (
Fatal error: Parmatch.all_record_args) when matching empty dict/record patterns. #8246 - Fix
nullfalling into the object branch instead of the wildcard when pattern matching on untagged variants with bothObjectandnullcases. #8253
💅 Polish
- Build system: Watch only source folders from build state instead of the entire project directory, and report missing configured source folders. #8219
🏠 Internal
- Speed up dev container test by installing OCaml in docker image instead of in
postCreate.sh. #8230
12.2.0
💥 New feature
- Stdlib: Added Array.zip, Array.unzip, Array.zipBy, and Array.partition. #8244
🐛 Bug fix
12.2.0-rc.1
💥 Breaking Change
js-post-buildnow passes the correct output file path based onin-sourceconfiguration: whenin-source: true, the path next to the source file is passed; whenin-source: false, the path in thelib/<module>/directory is passed. Additionally, stdout and stderr from the post-build command are now logged. #8190js-post-buildcommand now runs in the directory containing therescript.jsonwhere it is defined, instead of the unpredictable build invocation directory. This provides consistent behavior in monorepos. #8195
🚀 New Feature
- Reanalyze: add scoped
@@live/@@deadannotations for marking module/file sections as live or dead. #8197
🐛 Bug fix
- Reanalyze: fix reactive/server stale results when cross-file references change without changing dead declarations (non-transitive mode). #8173
- Reanalyze: link record/variant label liveness across type re-exports (
type y = x = {...}). #8217 - Add duplicate package detection to rewatch. #8180
- Rewatch: do not warn about "reanalyze" config field. #8181
- Fix error when importing CommonJS runtime modules with
require(). #8194 - Rewatch: fix warnings from non-recompiled modules being lost during incremental builds in watch mode. #8216
💅 Polish
- Formatter no longer writes files when contents are already correctly formatted. #8209
- Build system: Only log verbose "Generating AST for module" when actually parsing. #8210
- Build system: Watch only source folders from build state instead of the entire project directory, and report missing configured source folders. #8219
13.0.0-alpha.1
💥 Breaking Change
- Remove the legacy build system. Going forward, only the modern build system is supported, and the
rescript-legacycommand is not available anymore. #8186 #8212 - Remove support for
bsconfig.json. #8187 Int.fromStringandFloat.fromStringuse stricter number parsing and no longer use an explicit radix argument, but instead support parsing hexadecimal, binary and exponential notation. #8129- Remove the deprecated module system names
es6andes6-global(superseded byesmodule). #8205 - Default to module system
esmodule. #8213 - Remove
external-stdlibconfiguration option fromrescript.json. This option was rarely used and is no longer supported. #8175 - Remove the deprecated uncurried
(. args) => ...function syntax. #8211 js-post-buildnow passes the correct output file path based onin-sourceconfiguration: whenin-source: true, the path next to the source file is passed; whenin-source: false, the path in thelib/<module>/directory is passed. Additionally, stdout and stderr from the post-build command are now logged. #8190js-post-buildcommand now runs in the directory containing therescript.jsonwhere it is defined, instead of the unpredictable build invocation directory. This provides consistent behavior in monorepos. #8195- Remove support for deprecated
bs-dependencies,bs-dev-dependencies, andbsc-flagsconfiguration options. Usedependencies,dev-dependencies, andcompiler-flagsinstead. #8196 bsc: remove legacy-uncurriedflag. #8201- Remove deprecated cli flags
--dev,--create-sourcedirsandbuild -w. #8202 - Do not allow two different package specs with the same suffix to avoid conflicts. #8214
🚀 New Feature
- Reanalyze: add scoped
@@live/@@deadannotations for marking module/file sections as live or dead. #8197
🐛 Bug fix
- Reanalyze: fix reactive/server stale results when cross-file references change without changing dead declarations (non-transitive mode). #8173
- Reanalyze: link record/variant label liveness across type re-exports (
type y = x = {...}). #8217 - Add duplicate package detection to rewatch. #8180
- Rewatch: do not warn about "reanalyze" config field. #8181
- Fix error when importing CommonJS runtime modules with
require(). #8194 - Rewatch: fix warnings from non-recompiled modules being lost during incremental builds in watch mode. #8216
💅 Polish
12.1.0
🚀 New Feature
- Add support for
Set,Map,WeakSetandWeakMapto@unboxed. #8009 - Reanalyze: add reactive incremental analysis (
-reactive,-runs,-churn) and Mermaid pipeline dumping (-mermaid). #8092 - Reanalyze: add
reanalyze-server(long-lived server) with transparent delegation forrescript-tools reanalyze -json. #8127 - Add support of
js-post-buildin Rewatch. Note that${file}is now an absolute path. #8151
🐛 Bug fix
- Fix rewatch swallowing parse warnings (e.g., for
%todo). #8135 - Rewatch: log errors and warnings to
stderr. #8147 #8148 - Rewatch: warn about deprecated package specs
es6/es6-global. #8146 - Fix formatter removing doc comments for polymorphic variants. #8155