Tags:
- π₯ [Breaking Change]
- π [Spec Compliance]
- π [New Feature]
- π [Bug Fix]
- π [Documentation]
- π [Internal]
- π [Polish]
- Fix exponential notation syntax. rescript-lang#7174
- Introduce "Unified operators" for arithmetic operators (
+
,-
,*
,/
,mod
). rescript-lang#7057 - Add remainder (
%
, aka modulus) operator. rescript-lang#7152
- Fix and clean up boolean and/or optimizations. rescript-lang#7134 rescript-lang#7151
- Fix identifiers with name
arguments
andeval
to be mangled. rescript-lang#7163
- Improve code generation for pattern matching of untagged variants. rescript-lang#7128
- Improve negation handling in combination with and/or to simplify generated code (especially coming out of pattern matching). rescript-lang#7138
- Optimize JavaScript code generation by using
x == null
checks and improving type-based optimizations for string/number literals. rescript-lang#7141 - Improve pattern matching on optional fields. rescript-lang#7143 rescript-lang#7144
- Optimize compilation of switch statements for untagged variants when there are no literal cases. rescript-lang#7135
- Further improve boolean optimizations. rescript-lang#7149
- Simplify code generated for conditionals. rescript-lang#7151
- Move rescript-editor-analysis and rescript-tools into compiler repo. rescript-lang#7000
- OCaml compatibility in the stdlib and primitives are dropped/deprecated. rescript-lang#6984
- Remove JSX v3. rescript-lang#7072
- Remove js_cast.res. rescript-lang#7075
- Use FORCE_COLOR environmental variable to force colorized output. rescript-lang#7033
- Allow spreads of variants in patterns (
| ...someVariant as v =>
) when the variant spread is a subtype of the variant matched on. rescript-lang#6721 - Fix the issue where dynamic imports are not working for function-defined externals. rescript-lang#7060
- Allow pattern matching on dicts.
switch someDict { | dict{"one": 1} => Js.log("one is one") }
. rescript-lang#7059 - "ReScript Core" standard library is now included in the
rescript
npm package. rescript-lang#7108 rescript-lang#7116 - Handle absolute filepaths in gentype. rescript-lang#7104
- Fix tuple coercion. rescript-lang#7024
- Fix attribute printing. rescript-lang#7025
- Fix "rescript format" with many files. rescript-lang#7081
- Fix bigint max, min. rescript-lang#7088
- Fix parsing issue with nested variant pattern type spreads. rescript-lang#7080
- Fix JSX settings inheritance: only 'version' propagates to dependencies, preserving their 'mode' and 'module'. rescript-lang#7094
- Fix variant cast to int. rescript-lang#7058
- Fix comments formatted away in function without arguments. rescript-lang#7095
- Fix genType JSX component compilation. rescript-lang#7107
- Add some context to error message for unused variables. rescript-lang#7050
- Improve error message when passing
children
prop to a component that doesn't accept it. rescript-lang#7044 - Improve error messages for pattern matching on option vs non-option, and vice versa. rescript-lang#7035
- Improve bigint literal comparison. rescript-lang#7029
- Improve output of
@variadic
bindings. rescript-lang#7030 - Improve error messages around JSX components. rescript-lang#7038
- Improve output of record copying. rescript-lang#7043
- Provide additional context in error message when
unit
is expected. rescript-lang#7045 - Improve error message when passing an object where a record is expected. rescript-lang#7101
- Remove uncurried flag from bsb. rescript-lang#7049
- Build runtime/stdlib files with rescript/bsb instead of ninja.js. rescript-lang#7063
- Build tests with bsb and move them out of jscomp. rescript-lang#7068
- Run
build_tests
on Windows. rescript-lang#7065 - Rename folder "jscomp" to "compiler". rescript-lang#7086
- Disable -bs-cross-module-opt for tests. rescript-lang#7071
- Move
ounit_tests
into thetests
folder. rescript-lang#7096 - Move
syntax_tests
into thetests
folder. rescript-lang#7090 rescript-lang#7097 - Capitalize runtime filenames. rescript-lang#7110
- Build mocha tests as esmodule / .mjs. rescript-lang#7115
- Use dict instead of Dict.t everywhere. rescript-lang#7136
- Revert "Throws an instance of JavaScript's
new Error()
and adds the extension payload forcause
option" (rescript-lang#6611). rescript-lang#7016 - Fix dict literals error. rescript-lang#7019
- Allow coercing polyvariants to variants when we can guarantee that the runtime representation matches. rescript-lang#6981
- Add new dict literal syntax (
dict{"foo": "bar"}
). rescript-lang#6774 - Optimize usage of the new dict literal syntax to emit an actual JS object literal. rescript-lang#6538
- Fix issue where long layout break added a trailing comma in partial application
...
. rescript-lang#6949 - Fix incorrect format of function under unary operator. rescript-lang#6953
- Fix incorrect printing of module binding with signature. rescript-lang#6963
- Fix incorrect printing of external with
@as
attribute and_
placholder (fixed argument). rescript-lang#6970 - Disallow spreading anything but regular variants inside of other variants. rescript-lang#6980
- Fix comment removed when function signature has
type
keyword. rescript-lang#6997 - Fix parse error on doc comment before "and" in type def. rescript-lang#7001
- Add dev container. rescript-lang#6962
- Convert more tests to the node test runner. rescript-lang#6956
- Remove attribute "internal.arity". rescript-lang#7004
- Remove dead modules. rescript-lang#7008
- Improve formatting in the generated js code. rescript-lang#6932
}\ncatch{
->} catch {
for(let i = 0 ,i_finish = r.length; i < i_finish; ++i){
->for (let i = 0, i_finish = r.length; i < i_finish; ++i) {
while(true) {
->while (true) {
- Fixed tabulation for
switch case
bodies - Fixed tabulation for
throw new Error
bodies - Removed empty line at the end of
switch
statement - Removed empty
default
case fromswitch
statement in the generated code
- Optimised the Type Extension runtime code and removed trailing
/1
fromRE_EXN_ID
. rescript-lang#6958 - Compact output for anonymous functions. rescript-lang#6945 rescript-lang#7013
- Rewatch 1.0.9. rescript-lang#7010
- Allow
@directive
on functions for emitting function level directive code (let serverAction = @directive("'use server'") (~name) => {...}
). rescript-lang#6756 - Add
rewatch
to the npm package as an alternative build tool. rescript-lang#6762 - Throws an instance of JavaScript's
new Error()
and adds the extension payload forcause
option. rescript-lang#6611 - Allow free vars in types for type coercion
e :> t
. rescript-lang#6828 - Allow
private
in with constraints. rescript-lang#6843 - Add regex literals as syntax sugar for
@bs.re
. rescript-lang#6776 - Improved mechanism to determine arity of externals, which is consistent however the type is written. rescript-lang#6874 rescript-lang#6881 rescript-lang#6883
- Add
Js.globalThis
object binding. rescript-lang#6909
- Make
j
andjs
allowed names for tag functions. rescript-lang#6817 lazy
syntax is no longer supported. If you're using it, useLazy
module orReact.lazy_
instead. rescript-lang#6342- Remove handling of attributes with
bs.
prefix (@bs.as
->@as
etc.). rescript-lang#6643 - Remove obsolete
@bs.open
feature. rescript-lang#6629 - Drop Node.js version <18 support, due to it reaching End-of-Life. rescript-lang#6429
- Remove deprecated -bs-super-errors option. rescript-lang#6814
- Some global names and old keywords are no longer prefixed. rescript-lang#6831
- Remove ml parsing tests and conversion from
.ml
to.res
via format. rescript-lang#6848 - Remove support for compiling
.ml
files, and general cleanup. rescript-lang#6852 - Remove
rescript convert
subcommand. rescript-lang#6860 - Remove support for
@bs.send.pipe
. This also removes all functions inJs_typed_array
that rely on@bs.send.pipe
. rescript-lang#6858 rescript-lang#6891 - Remove deprecated
Js.Vector
andJs.List
. rescript-lang#6900 - Remove support for
%time
extension. rescript-lang#6924 - Remove
caml_external_polyfill
module and the related behavior. rescript-lang#6925
- Fix unhandled cases for exotic idents (allow to use exotic PascalCased identifiers for types). rescript-lang#6777 rescript-lang#6779 rescript-lang#6897
- Fix unused attribute check for
@as
. rescript-lang#6795 - Reactivate unused attribute check for
@int
. rescript-lang#6802 - Fix issue where using partial application
...
can generate code that usesCurry
at runtime. rescript-lang#6872 - Avoid generation of
Curry
with reverse application|>
. rescript-lang#6876 - Fix issue where the internal ppx for pipe
->
would not use uncurried application in uncurried mode. rescript-lang#6878
- Build with OCaml 5.2.0. rescript-lang#6797
- Convert OCaml codebase to snake case style. rescript-lang#6702
- Fix
-nostdlib
internal compiler option. rescript-lang#6824 - Remove a number of ast nodes never populated by the .res parser, and resulting dead code. rescript-lang#6830
- Remove coercion with 2 types from internal representation. Coercion
e : t1 :> t2
was only supported in.ml
syntax and never by the.res
parser. rescript-lang#6829 - Convert
caml_format
andjs_math
to.res
. rescript-lang#6834 - Convert
js.ml
files to.res
. rescript-lang#6835 - Remove old
.ml
tests. rescript-lang#6847 - Make compiler libs ready for uncurried mode. rescript-lang#6861
- Make tests ready for uncurried mode. rescript-lang#6862
- Make gentype tests uncurried. rescript-lang#6866
- Remove
@@uncurried.swap
, which was used for internal tests. rescript-lang#6875 - Build the compiler libraries/tests in uncurried mode. rescript-lang#6864
- Ignore
-uncurried
command-line flag. rescript-lang#6885 - Cleanup: remove tracking of uncurried state in parser/printer. rescript-lang#6888
- Remove
%opaque
primitive. rescript-lang#6892 - Reunify JsxC/JsxU -> Jsx etc. rescript-lang#6895
- Remove the transformation of
foo(1,2)
intoJs.Internal.opaqueFullApply(Internal.opaque(f), 1, 2)
, and change the back-end to treat all applications as uncurried. rescript-lang#6893 - Remove
@uncurry
from ReScript sources (others, tests). rescript-lang#6938 - Remove leftover uncurried handling. rescript-lang#6939 rescript-lang#6940
- Start converting tests from mocha to the node test runner. rescript-lang#6956
- Make the
--help
arg be prioritized in the CLI, so correctly prints help message and skip other commands. rescript-lang#6667 - Remove redundant space for empty return in generated js code. rescript-lang#6745
- Remove redundant space for export in generated js code. rescript-lang#6560
- Remove redundant space after continue in generated js code. rescript-lang#6743
- Remove empty export blocks in generated js code. rescript-lang#6744
- Fix indent for returned/thrown/wrapped in parentheses objects in generated js code. rescript-lang#6746
- Fix indent in generated js code. rescript-lang#6747
- In generated code, use
let
instead ofvar
. rescript-lang#6102 - Turn off transformation for closures inside loops when capturing loop variables, now that
let
is emitted instead ofvar
. rescript-lang#6480 - Improve unused attribute warning message. rescript-lang#6787
- Remove internal option
use-stdlib
from build schema. rescript-lang#6778 - Fix
Js.Types.JSBigInt
payload to use nativebigint
type. rescript-lang#6911 - Deprecate
%external
extension, which has never been officially introduced. rescript-lang#6906 - Deprecate
xxxU
functions in Belt. rescript-lang#6941 - Improve error messages for function arity errors. rescript-lang#6990
- Add missing HTML attribute capture to JsxDOM.res. rescript-lang#7006
- Fix tag function location on compiler error. rescript-lang#6816
- Fix Deno compatibility issues on Windows. rescript-lang#6850
- Fix issue with infinite loops with type errors on recursive types. rescript-lang#6867
- Ignore
@uncurry
attribute in uncurried mode, to avoid generating calls toCurry
at runtime. rescript-lang#6869 - Avoid generating calls to Curry when adjusting arity of uncurried functions. rescript-lang#6870
- Fix build after calling without
-warn-error
, see rescript-lang#6868 for more details. rescript-lang#6877 - Fix issue with uninitialized
_param
in recursive functions with unit argument. rescript-lang#6907
- Omit standard library dir from load path if -nostdlib is set. rescript-lang#6833
- Fix issue where capitalised type variables were only allowed in certain positions. rescript-lang#6820
- Support Windows 11 ARM (using the x64 binaries in emulation). rescript-lang#6813
- Fix location of let bindings with attributes. rescript-lang#6791
- PPX v4: mark props type in externals as
@live
to avoid dead code warnings for prop fields in the editor tooling. rescript-lang#6796 - Fix issue where optional labels were not taken into account when disambiguating record value construction. rescript-lang#6798
- Fix issue in gentype when type
Jsx.element
surfaces to the user. rescript-lang#6808 - Fix inclusion check (impl vs interface) for untagged variants, and fix the outcome printer to show tags. rescript-lang#6669
- Fix encoding inside tagged template literals. rescript-lang#6810
- Fix issue of incorrect switch cases with identical bodies when mixing object and array. rescript-lang#6792
- Fix formatter eats comments on the first argument of a uncurried function. rescript-lang#6763
- Fix formatter removes parens in pipe operator with anonymous uncurried function. rescript-lang#6766
- Revert escape JSX prop names with hyphens (#6705). rescript-lang#6731
- Add
%todo
extension for leaving implementation for later. rescript-lang#6713 - Add
-warn-error
argument for generating errors in CI. Useful for%todo
extension. rescript-lang#6717
- Improve error when using
@deriving(accessors)
on a variant with record arguments. rescript-lang#6712 - Stop escaping JSX prop names with hyphens. rescript-lang#6705
- Fix trailing undefined for optional parameters not omitted with
@send
and@new
. rescript-lang#6716 - Fix JSX4 adding the incorrect type annotation for the prop
ref
inReact.forwardRef
component. rescript-lang#6718 - Fix description for warning number 110. rescript-lang#6725
- Module spec
es6
andes6-global
is deprecated in favor ofesmodule
. rescript-lang#6709
- Fix variance setting for builtin
dict
type. Fixes issues around inference. rescript-lang#6707
- Add experimental BigInt support. rescript-lang#6670, rescript-lang#6696
- Fix mishandling of uncurried functions in super errors. rescript-lang#6694
- Fix misparsing in/after JSX. rescript-lang#6686
- Fix
@deriving(accessors)
outputting curried functions in uncurried mode. rescript-lang#6687
- Fix emitting static import instead of dynamic import. rescript-lang#6664
- Fix local type variables breaking react components. rescript-lang#6665
- Fix remove redundant branches in generated switch body. rescript-lang#6672
- Fix issue in partial application when the last named arg is provided. rescript-lang#6681
- Omit
undefined
in external function calls for trailing optional arguments when not supplied. rescript-lang#6653 - Make pattern match suggestions to be easier to copy-paste. rescript-lang#6656
- No parens around tagged template literals. rescript-lang#6639
- Allow identifier with modules in tagged template literals (e.g. Pg.sql
select * from ${table} where id = ${id}
). rescript-lang#6645
- Fix compiler crash when reexporting tagged template literal externals. rescript-lang#6645
- Add support for array spread. rescript-lang#6608
- Support import attributes (https://github.com/tc39/proposal-import-attributes) in
@module()
. rescript-lang#6599 - allow hyphens in jsx tag names (e.g.
<mj-column>
). rescript-lang#6609
- Fix issue with async and newtype in uncurried mode. rescript-lang#6601
- Generic JSX transform: Rename expected module name for lowercase JSX to
Elements
fromDOM
. rescript-lang#6606 - Generic JSX transform: Set default config params for
jsxConfig
. rescript-lang#6606 - Generic JSX transform: Handle namespaced names. rescript-lang#6606
- Fix issue with doc comment in recursive module. rescript-lang#6613
- Fix issue with Exceptions and Extensible types runtime generation. rescript-lang#6570
- Fix inline comment before spread syntax in record. rescript-lang#6615
- Use OCaml 4.14.1 (+ Alpine 3.19 container) for CI build. rescript-lang#6600
- Experimental support of tagged template literals, e.g.
sql`select * from ${table}
. rescript-lang#6250 - Experimental support for generic/custom JSX transforms. rescript-lang#6565
dict
is now a builtin type. rescript-lang#6590
- GenType: distinguish inline records from unary variant cases of object type. rescript-lang#6586
- Renamed inline record fields: fix renamed field access in inline records. rescript-lang#6551
- Fixed issue with coercions sometimes raising a
Not_found
instead of giving a proper error message. rescript-lang#6574 - Fix issue with recursive modules and uncurried. rescript-lang#6575
- Improve error message for missing label(s) in function application. rescript-lang#6576
No changes compared to rc.9.
- GenType: support
@deriving(accessors)
outputs. rescript-lang#6537 - Allow coercing ints and floats to unboxed variants that have a catch-all unboxed int or float case. rescript-lang#6540
- Allow tuples in untagged variants. rescript-lang#6550
- GenType: now emits full suffix on JS import path to be compatible with
.res.js
. rescript-lang#6541
- Format docstrings. rescript-lang#6417
- JSX v4: make automatic mode the default. rescript-lang#6552
- Add support for type coercion for invariant type arguments such as array payloads. rescript-lang#6518
- Start treating
rescript
command the same as therescript build
command, so now you can dorescript -w
. rescript-lang#6524
- Fix accidental removal of
Belt.Result.Ok
andBelt.Result.Error
constructors in rc.5. rescript-lang#6514 - Add missing check that the runtime representation of variants matches implementation and interface. https://github.com/rescript-lang/rescript-compiler/pull/6513/files
- GenType: only export types (not values) from module types. rescript-lang#6516
- Fix compiler crash with unboxed variant definition with only 1 constructor. rescript-lang#6523
- GenType: support mutual recursive types inside modules. rescript-lang#6528
- Workaround for
@as
in labels in uncurried externals, which was broken. rescript-lang#6527
- GenType: make outputs DCE-friendly. rescript-lang#6508
- Allow empty inline records in variants. rescript-lang#6494
- Allow empty record patterns in pattern matching. rescript-lang#6494
- Fix issue where an inline record with attributes did not parse. rescript-lang#6499
- Fix issue with uncurried function with 1 arg being a variable where an undefined variable could be emitted. rescript-lang#6507
- Fix runtime errors on
@genType.as("alias")
output. rescript-lang#6509
- Freely configurable suffix for generated .js files. rescript-lang#6472
- Fix issue with GenType and
result
introduced in rc.5. rescript-lang#6464 - Fix compiler crash when inlining complex constants in pattern matching. rescript-lang#6471
- Fix issue with generating async functions inside loops. rescript-lang#6479
- Fix issue with Gentype and string annotations with numbers such as
@as("0")
. rescript-lang#6487 - Fix error message on curried/uncurried signature mismatch. rescript-lang#6414
- Improve some error messages in rescript.conf parsing. rescript-lang#6469
- Allow coercing unboxed variants with only strings (now including with a single payload of string) to the primitive string. rescript-lang#6441
- Allow coercing strings to unboxed variants that have a catch-all unboxed string case. rescript-lang#6443
- Allow coercing
int
tofloat
. rescript-lang#6448
- Fix issue with dynamic import of module in nested expressions. rescript-lang#6431
- Fix issue where GenType was not supporting
@tag
on ordinary variants. rescript-lang#6437 - Fix using dynamic import of module in block instead of async function. rescript-lang#6434
- Fix issue with using dynamic import of module in uncurried mode. rescript-lang#6434
- Fix build error with JSX v4 transformation of React.forwardRef in uncurried mode. rescript-lang#6447
- Fix printing of exotic JSX names. rescript-lang#6451
- Fix locations when code with
await
fails to compile (all locations would point to the internal functionunsafe_await
). rescript-lang#6452 - Fix renaming fields (with @as) in inline records doesn't work when destructuring. rescript-lang#6456
- Fix
rc.4
regressions:- Don't show compilation time when calling
rescript build -help
command. rescript-lang#6439 - Running
rescript build -w
with a compilation error doesn't exit with an error code and continues waiting for changes. rescript-lang#6460
- Don't show compilation time when calling
- Remove dependency stdlib-406 -> belt. rescript-lang#6453
- Playground: Add support for implicitly opened modules. rescript-lang#6446
- Add
Deno
to reserved names, so that modules namedDeno
don't clash with the globally exposedDeno
object. rescript-lang#6428 - Disable ESLint/TSLint on gentype outputs properly. rescript-lang#6442
- Improve
rescript
CLI to usestdout
/stderr
appropriately for help command's message. rescript-lang#6439 - Generate
f()
instead off(undefined)
forf()
. rescript-lang#6459
- Support renaming fields in inline records with
@as
attribute. #6391 - Support renaming object fields of
@obj
external ppx with@as
attribute. #6391 - Add builtin abstract types for File and Blob APIs. rescript-lang#6383
- Untagged variants: Support
promise
, RegExes, Dates, File and Blob. rescript-lang#6383 - Untagged variants: Support
bool
. rescript-lang#6368 - Support aliased types as payloads to untagged variants. rescript-lang#6394
- Support the async component for React Server Component in JSX V4. rescript-lang#6399
- Support
rescript.json
configuration file and deprecatebsconfig.json
. rescript-lang#6382
- Update watcher rules to recompile only on config and
*.res
/*.resi
/*.ml
/.mli
file changes. Solves the issue of unnecessary recompiles on.css
,.ts
, and other unrelated file changes. rescript-lang#6420 - Add smart printer for pipe chains. rescript-lang#6411 (the formatter will reformat existing code in certain cases)
Js.Json.t
now usesBoolean(bool)
instead of explicit@as(true) True | @as(false) False
. rescript-lang#6421
- Fix issue with GenType and labelled arguments. rescript-lang#6406
- Fix dependencies reinitialization on every change in watch mode. Leads to faster rebuilds and cleaner terminal. rescript-lang#6404
- A little performance improvement for JSX V4 runtime helper by removing one object allocation for components with key prop. rescript-lang#6376
- The error message for "toplevel expressions should evaluate to unit" has been revamped and improved. rescript-lang#6407
- Improve "Somewhere wanted" error messages by changing wording and adding more context + suggested solutions to the error messages where appropriate. rescript-lang#6410
- Display the compile time for
rescript build
command. rescript-lang#6404 - Improve help message for
build
andclean
commands. rescript-lang#6404 - Pass through the
-verbose
flag to builds in watch mode. rescript-lang#6404 - Improve error message when defining duplicate labels in a record. rescript-lang#6415
- Improve error message when trying to concatenate strings using the wrong operator. rescript-lang#6416
- Fix issue with JSX V4 when component props have the default value with same name. rescript-lang#6377
- Fixed code formatter with
"uncurried": false
in bsconfig. rescript-lang#6378
- Add
Bun
to reserved names, so that modules namedBun
don't clash with the globally exposedBun
object. rescript-lang#6381
rescript build
will always build its dependency by default. The argument-with-deps
is not needed anymore. rescript-lang#6350
- Stop mangling object field names. If you had objects with field names containing "__" or leading "_", they won't be mangled in the compiled JavaScript and represented as it is without changes. rescript-lang#6354
- Fixed outcome printer resolution of uncurried config. rescript-lang#6353
- GenType: Propagate comments from record fields to emitted TypeScript types. rescript-lang#6333
$$default
is no longer exported from the generated JavaScript when using default exports. rescript-lang#6328
- Conditionally print error message about record with missing label potentially being a component. rescript-lang#6337
- Put definition in the bottom and the actual error at the top when reporting errors for supplying fields etc with the wrong name. rescript-lang#6336
- Fix left over places where polyvariant tag names were printed in OCaml syntax instead of ReScript. rescript-lang#6348
- Variants: Allow coercing from variant to variant where applicable. rescript-lang#6314
- Variants: Experimental support for spreading variant type definitions to copy constructors from one variant to another. rescript-lang#6316
- Fixed name collision between the newly defined Js.Json.t and the variant constructor in the existing Js.Json.kind type. To address this, the usage of the existing Js.Json.kind type can be updated to Js.Json.Kind.t. rescript-lang#6317
- Fixed outcome printing of uncurried higher order function types. rescript-lang#6323
- Fixed printing of type constraints in template literal substitutions. rescript-lang#6324
- Untagged variants: consider regexp as an object type. rescript-lang#6296
- Semantic-based optimization of code generated for untagged variants. rescript-lang#6108
- Record type spreads: Allow using type variables in type spreads. Both uninstantiated and instantiated ones. rescript-lang#6309
- Variants: Allow coercing variants to string/int/float when applicable. rescript-lang#6311
- Fix issue with dynamic import of modules in expressions. rescript-lang#6310
- Introduced a new
%ffi
extension (experimental - not for production use!) that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. rescript-lang#6251 - Extended untagged variants with function types. rescript-lang#6279
- Remove rudimentary node bindings and undocumented
%node
extension. rescript-lang#6285
- Fix issue where uncurried type internals leak in type error. rescript-lang#6264
- Improve error messages for untagged variant definition. rescript-lang#6290
- Fix type checking performance issue for large records. rescript-lang#6289
- Make uncurried mode opt-out: by default, every project is now in uncurried mode, unless
"uncurried": false
is specified in the project config. rescript-lang#6249
- Removed duplicate Super_error implementation in syntax. rescript-lang#6246
- Fix issue with inlining records in the presence of record coercion. rescript-lang#6256
-bs-super-errors
flag has been deprecated along with Super_errors. rescript-lang#6243@rescript/react
>= 0.12.0-alpha.2 is now required because of the React.fragment's children type fix. rescript-lang#6238
- Remove unnecessary require and import statements when using dynamic imports. rescript-lang#6232
- Fix option unboxing logic in the presence of untagged variants. rescript-lang#6233
- Fix printing of local module with type. rescript-lang#6212
- Adapting JSX4 to React.fragment's children type change (
'children
->React.element
) rescript-lang#6238
- In uncurried mode, outcome printer swaps curried and uncurries function printing compared to legacy.
- Add location information to duplicate type definition error messages. rescript-lang#6199
- Replace normal module errors with Super_error module, and clean up Super_error. rescript-lang#6199
Js.Json.t
,Js.null
andJs.nullable
are now untagged variants representing their runtime values, instead of abstract types. rescript-lang#6218
- Add support for Dynamic import. rescript-lang#5703
- GenType: Add
moduleResolution
option to customize extensions on emitted import statements. This helps to adjust output compatibility with TypeScript projects using ESM. rescript-lang#6182node
(default): Drop extensions.node16
: Use TS output's extensions. Make it ESM-compatible.bundler
: Use TS input's extensions. Make it ESM-compatible.
- Make untagged variants understand payloads defined as records. rescript-lang#6208
- Parse
assert
as a regular function.assert
is no longer a unary expression. Example: beforeassert 1 == 2
is parsed as(assert 1) == 2
, now it is parsed asassert(1 == 2)
. rescript-lang#6180
- Make "rescript format" work with node 10 again and set minimum required node version to 10 in package.json. rescript-lang#6186
- Fix partial application for uncurried functions with labeled args rescript-lang#6198
- Add error messages for dangling doc comments/attributes and mutable in record type definition. rescript-lang#6206
- Fix issue with overlapping array and object in untagged variants rescript-lang#6219
- Add surface syntax for partial application of uncurried functions:
foo(1, ...)
. This corresponds to curried application in the old mode. rescript-lang#6166
- Fix broken formatting in uncurried mode for functions with _ placeholder args. rescript-lang#6148
- Fix issue where spreading record types with optional labels would not have their labels preserved as optional. rescript-lang#6154
- Fix error location to be the type with the spreads when spreading record types with duplicate labels. rescript-lang#6157
- Disable warning on
@inline
attibute on uncurried functions. rescript-lang#6152 - Support doc comments on arguments of function types. rescript-lang#6161
- Fix issue with record type coercion and unboxed. rescript-lang#6158
- Fixed subtype checking for record types with "@as" attributes: The subtype relationship now takes into account the compatibility of "@as" attributes between corresponding fields, ensuring correctness in runtime representation. rescript-lang#6158
- Emit directive above header comment. rescript-lang#6172
- Add error message to private extension. rescript-lang#6175
- Update list of reserved JS keywords. rescript-lang#6167
- Add error message to
@@directive
. rescript-lang#6174
- Add support for extensible records (e.g.
type t = {...t1, x:int, ...t2}
) rescript-lang#5715
- Fix formatting and parentheses placement in uncurried functions with constraints. rescript-lang#6143
- Add support for type coercion
:>
for records. rescript-lang#5721
- Special case generation of uncurried functions with 1 argument of unit type so they don't take a parameter. rescript-lang#6131
- Introduce experimental uncurried mode. For experimentation only. PR #5796
- Customization of runtime representation of variants and introduction of untagged variants PR #6095, PR #6103
- Add support for uncurried mode: a mode where everything is considered uncurried, whether with or without the
.
. This can be turned on with@@uncurried
locally in a file. For project-level configuration inbsconfig.json
, there's a boolean config"uncurried"
, which propagates to dependencies, to turn on uncurried mode. Since there's no syntax for partial application in this new mode, introduce@res.partial foo(x)
to express partial application. This is temporary and will later have some surface syntax. Make uncurried functions a subtype of curried functions, and allow application for uncurried functions. Themake
function of components is generated as an uncurried function. Use best effort to determine the config when formatting a file. rescript-lang#5968 rescript-lang#6080 rescript-lang#6086 rescript-lang#6087 - Customization of runtime representation of variants. This is work in progress. E.g. some restrictions on the input. See comments of the form "TODO: put restriction on the variant definitions allowed, to make sure this never happens". rescript-lang#6095
- Introduce untagged variants rescript-lang#6103
- Add support for unary uncurried pipe in uncurried mode rescript-lang#5804
- Add support for partial application of uncurried functions: with uncurried application one can provide a subset of the arguments, and return a curried type with the remaining ones rescript-lang#5805
- Add support for uncurried externals rescript-lang#5815 rescript-lang#5819 rescript-lang#5830 rescript-lang#5894
- Parser/Printer: unify uncurried functions of arity 0, and of arity 1 taking unit. There's now only arity 1 in the source language. rescript-lang#5825
- Add support for default arguments in uncurried functions rescript-lang#5835
- Inline uncurried application when it is safe rescript-lang#5847
- Support optional named arguments without a final unit in uncurried functions rescript-lang#5907
- GenType: add the option to use the
@genType
annotation at the module level, meaning that all the items in the module should be exported. rescript-lang#6113 - GenType: add support for
@genType
annotations on module definitions. rescript-lang#6113 - Prebuilt binaries are now provided for all major platforms:
- macOS x64
- macOS ARM
- Linux x64 (statically linked)
- Linux ARM (statically linked)
- Windows x64
- Remove support for the legacy Reason syntax. Existing Reason code can be converted to ReScript syntax using ReScript 9 as follows:
npm i -g rescript@9
rescript convert <reason files>
- Remove obsolete built-in project templates and the "rescript init" functionality. This is replaced by create-rescript-app which is maintained separately.
- Do not attempt to build ReScript from source on npm postinstall for platforms without prebuilt binaries anymore.
- Made pinned dependencies transitive: if a is a pinned dependency of b and b is a pinned dependency of c, then a is implicitly a pinned dependency of c. This change is only breaking if your build process assumes non-transitivity.
- Curried after uncurried is not fused anymore:
(. x) => y => 3
is not equivalent to(. x, y) => 3
anymore. It's instead equivalent to(. x) => { y => 3 }
. Also,(. int) => string => bool
is not equivalen to(. int, string) => bool
anymore. These are only breaking changes for unformatted code. - Exponentiation operator
**
is now right-associative.2. ** 3. ** 2.
now compile toMath.pow(2, Math.pow(3, 2))
and not anymoreMath.pow(Math.pow(2, 3), 2)
. Parentheses can be used to change precedence. - Remove unsafe
j`$(a)$(b)`
interpolation deprecated in compiler version 10 rescript-lang#6068 - Remove deprecated module
Printexc
@deriving(jsConverter)
not supported anymore for variant types rescript-lang#6088- New representation for variants, where the tag is a string instead of a number. rescript-lang#6088
- GenType: removed support for
@genType.as
for records and variants which has become unnecessary. Use the language's@as
instead to channge the runtime representation without requiring any runtime conversion during FFI. rescript-lang#6099 rescript-lang#6101
- Fix issue where uncurried was not supported with pipe rescript-lang#5803
- Fix printing of nested types in uncurried mode rescript-lang#5826
- Fix issue in printing uncurried callbacks rescript-lang#5828
- Fix formatting uncurried functions with attributes rescript-lang#5829
- Fix parsing/printing uncurried functions with type parameters rescript-lang#5849
- Fix compiler ppx issue when combining
async
and uncurried application rescript-lang#5856 - Fix issue where the internal representation of uncurried types would leak when a non-function is applied in a curried way rescript-lang#5892
- Fix some comments disappearing in array access expressions rescript-lang#5947
- Parser: fix location of variable when function definition
{v => ...}
is enclosed in braces rescript-lang#5949 - Fix issue with error messages for uncurried functions where expected and given type were swapped rescript-lang#5973
- Fix issue with integer overflow check rescript-lang#6028
- Make internal encoding of locations aware of unicode rescript-lang#6073
- Fix issue where
foo(x,_)
in uncurried mode would generate a curried function rescript-lang#6082 - Fix printing of uncurried application when the lhs is a function definition rescript-lang#6084
- Fix parsing uncurried type starting with path rescript-lang#6089
- Fix bigInt comparison rescript-lang#6097
- Fixed a bug where the async attribute was not preserved when using the
@this
decorator in ReScript functions. This fix allows proper handling of async functions with the@this
decorator. Issue: rescript-lang#6100 - Fix issue with GenType and module aliases rescript-lang#6112
- Syntax: process uncurried types explicitly in the parser/printer rescript-lang#5784 rescript-lang#5822
- Syntax: process uncurried function declarations explicitly in the parser/printer rescript-lang#5794
- PPX V4: allow uncurried
make
function and treat it like a curried one #5802 #5808 #5812 - Remove processing of objects expressions, which don't exist in
.res
syntax (Pexp_object
) rescript-lang#5841 - Remove class type processing from compiler ppx rescript-lang#5842
- Remove method application via operator
##
, which does not exist in.res
syntax rescript-lang#5844 - Treat
@meth
annotation as making the type uncurried for backwards compatibitly with some examples rescript-lang#5845 - Process
@set
annotation for field update as generating an uncurried function rescript-lang#5846 - Treat uncurried application of primitives like curried application, which produces better output rescript-lang#5851
- New internal representation for uncurried functions using built-in type
function$<fun_type, arity>
this avoids having to declare all the possible arities ahead of time rescript-lang#5870 - PPX V3: allow uncurried
make
function and treat it like a curried one rescript-lang#6081 - Add support for
|>
in uncurried mode by desugaring it rescript-lang#6083 - Change the compilation of pattern matching for variants so it does not depends on variats being integers rescript-lang#6085
- Improve code generated for string templates rescript-lang#6090
- Move Jsx and JsxDOM and JsxEvent and JsxPPXReactSupport inside Pervasives and build them separately for curried and uncurried mode rescript-lang#6091
- Gentype: allow recursive data types rescript-association/genType#585
- Fix implementation of directives rescript-lang#6052
- Fix issue if the
lib
dir is included in the sources of bsconfig.json rescript-lang#6055 - Fix issue with string escape in pattern match rescript-lang#6062
- Fix issue with literal comparison of string constants rescript-lang#6065
- Add support for toplevel
await
rescript-lang#6054
- Better error message for extension point rescript-lang#6057
- Improve format check help rescript-lang#6056
- Deprecate unsafe
j`$(a)$(b)`
interpolation: use string templates`${a}${b}`
instead rescript-lang#6067
- Add experimental suppport for directives. An annotation such as
@@directive("use client;")
emitsuse client;
verbatim before imports rescript-lang#5999 genType
: addCore
standard library support for the following builtin types:Null.t
,Nullable.t
,Undefined.t
,Dict.t<_>
,Promise.t<_>
,Date.t
,BigInt.t
,RegExp.t
,Map.t<_, _>
,WeakMap.t<_, _>
,Set<_>
,WeakSet<_>
rescript-lang#6024
genType
: streamline the treatment of optionals as undefined rescript-lang#6024- Represent
option<t>
asundefined | t
instead ofnull | undefined | t
. This is more permissive when importing functions taking optional values (allows to use option types), but stricter when e.g. exporting ReScript functions taking arguments of option type. Fallback: useJs.undefined<_>
instead. - Represent
{x:option<string>}
as{x:(undefined | string)}
instead of{x?: string}
. This is more in line with TS's behaviour. Fallback: use{x?:string}
.
- Represent
- Add the gap property to jsxDOMStyle rescript-lang#5956
- Fix issue where error messages related to non-existent props were displayed without location information rescript-lang/syntax#730
- Fix issue where uncurried functions were incorrectly converting the type of a prop given as a default value to curried rescript-lang/syntax#731
- Fix issue with nested async functions, where the inner function would be emitted without
async
rescript-lang#5984 - Fix issue with printing async functions with locally abstract types rescript-lang/syntax#732
- Fix issue with async context and locally abstract types rescript-lang#5985
- Fix support for recursive components in JSX V4 rescript-lang/syntax#733
- GenType: fix issue with V3 compatibility mode (see rescript-lang#5990) rescript-lang#5992
- Fix issue with overlapping labelled argument with default value rescript-lang/syntax#734
- Fix issue with using alias and default value together rescript-lang/syntax#734
- Fix issue in
Js.Promise2
wherethen
andcatch
were returningundefined
rescript-lang#5996 - Fix issue in the compiler back-end where async functions passed to an
@uncurry
external would be inlined and transformed in a way that loses async rescript-lang#6011 - Fix location issue for the treatment of
async
functions where hovering on the body with a type error would show'a => promise<'a>
everywhere rescript-lang#6014 - Fix formatting of
switch
expressions that contain bracedcases
inside rescript-lang/syntax#735 - Fix formatting of props spread for multiline JSX expression rescript-lang/syntax#736
- Support
@gentype.import
as an alias to@genType.import
in the compiler rescript-lang#6021 - In GenType, check annotations also in module types to decide whether to produce the
.gen.tsx
file rescript-lang#5903 - Fix issue with JSX V4 and newtype rescript-lang/syntax#737
- Fix issue with JSX V4 when components are nested rescript-lang/syntax#738
- Fix issue where generic compare on
float
values would be different from the compare for typefloat
rescript-lang#6043 - Improve code generated for default arguments in JSX V4 rescript-lang/syntax#739
- Fix issue with JSX V4 props of the form
~p as module(...)
rescript-lang/syntax#739
- Fix an issue where error messages related to duplicate props were displayed without a loc and were unclear rescript-lang/syntax#728
- Parse the attributes of labelled argument to the pattern attributes of argument instead of function. rescript-lang/syntax#722
- The prop names duplicated to keyword are not mangled automatically in JSX v4.
- Use
@as
instead
- Use
- Add support for empty inlined record literal
{}
for inlined records where all fields are optional rescript-lang#5900
- Prevent inlining of async functions in additional cases rescript-lang#5860
- Fix build error where aliasing arguments to
_
in the make function with JSX V4. rescript-lang#5881 - Fix parsing of spread props as an expression in JSX V4 rescript-lang#5885
- Fix dropping attributes from props in make function in JSX V4 rescript-lang#5905
- Fix issue where no error was reported when ? was used for non-optional fields. rescript-lang#5853
- Fix issue where optional fields in inline records were not supported and would cause type errors rescript-lang#5827
- Prevent inlining of async functions in last stage of the compiler when the functions are not exported (not in interface file or shadowed) rescript-lang#5790
- Support format check with
rescript format -check
. rescript-lang#5760
- Fix issue where the last line of
rescript format --help
usage was being swallowed rescript-lang#5760 - Specialize the printing of the rhs of a record field assignment for optional values
{x: ? e}
rescript-lang/syntax#714
- Support the use of spread anywhere in list creation (e.g.
list{...x, 1, ...y, ...z}
). rescript-lang/syntax#692 - Add support for the argument of
@react.component
to set a props type from the outside. rescript-lang/syntax#699
- Fix issue where the JSX key type is not an optional string rescript-lang/syntax#693
- Prevent inlining of async functions rescript-lang#5754
- Fix build error for JSX fragment without children rescript-lang/syntax#704
- Fix issue where async as an id cannot be used with application and labelled arguments rescript-lang/syntax#707
- Fix 5557: the exhaustive checking for char is incorrect during the unicode migration rescript-lang#5749
- Fix 5753: the comment for unicode char is inaccurate rescript-lang/syntax#709
- Treat await as almost-unary operator weaker than pipe so
await foo->bar
meansawait (foo->bar)
rescript-lang/syntax#711
- Change payload of
Pconst_char
fromchar
toint
rescript-lang/syntax#709
- Fix issue with changes not being applied with React Native's Metro bundler for files with warnings rescript-lang#5738
- Fix emitting unary minus for floats in case of negative constants rescript-lang#5737
- Fix issue where a spread
...x
in non-last position would not be reported as syntax error rescript-lang/syntax#673 - Fix issue where the formatter would delete
async
in a function with labelled arguments. - Fix several printing issues with
async
including an infinite loop rescript-lang/syntax#680 - Fix issue where certain JSX expressions would be formatted differenctly in compiler 10.1.0-rc.1 rescript-lang/syntax#675
- Fix issue where printing nested pipe discards await rescript-lang/syntax#687
- Deprecate DOM element attributes in
JsxDOM.domProps
:begin_
,end_
,to_
- Use
begin
,end
,to
instead.
- Use
- Emit an error when a
@string
or@int
attribute is used in a V4 component rescript-lang#5724
- Add extra variants for output filename suffixes in
bsconfig.json
:.bs.mjs
and.bs.cjs
are allowed rescript-lang#5631 - Safe promises: t-first Js.Promise2 bindings, and remove warning for nested promises rescript-lang#5709
- Fix issue where uncurried async functions were emitted without
async
rescript-lang#5718 - Fix location issue in error messages with JSX V4 where the multiple props types are defined rescript-lang/syntax#655
- Fix location issue in make function in JSX V4 that breaks dead code elimination rescript-lang/syntax#660
- Fix parsing (hence pretty printing) of expressions with underscore
_
and comments. - Fix printing of comments inside JSX tag rescript-lang/syntax#664
- Fix issue where formatter erases tail comments inside JSX tag rescript-lang/syntax#663
- Fix issue where the JSX prop has type annotation of the first class module rescript-lang/syntax#666
- Fix issue where an empty record literal {} expected to have a non-record type would type check rescript-lang#5729
- Functions with consecutive dots now print as multiple arrow functions like in JavaScript.
- Add
loading
,aria-*
DOM element attributes inJsxDOM.domProps
:ariaCurrent
,ariaInvalid
,ariaAutocomplete
, etc. - Change the internal representation of props for the lowercase components to record. rescript-lang/syntax#665
- Add
JsxPPXReactSupport
module to relocate the helper functions for JSX v4 fromrescript-react
- Fix pretty printer where it would print doc comments on the same line as other attributes rescript-lang/syntax#642
- Propagte
"jsx"
configuration to dependencies rescript-lang#5661 - Add support for empty record literal
{}
for records where all fields are optional rescript-lang#5658 - Add support for empty record type (e.g.
type empty = {}
) rescript-lang#5658
- Fix issue in formatting JSX spread props rescript-lang/syntax#644
- Fix location issue in error messages with JSX V4 where the body of the component is an application rescript-lang/syntax#633
- Fix printing of type declarations in error message where they would be considered recursive by default
- Fix issue where the printer would omit attributes for
->
and|>
rescript-lang/syntax#629 - Fix printing of optional fields in records rescript-lang#5654
- Fix printing of comments inside empty blocks rescript-lang/syntax#647
- Improvements and fixes for JSX V4. See guide https://github.com/rescript-lang/syntax/blob/master/cli/JSXV4.md
- Mention all missing fields in error message for records, not just one rescript-lang#5657
- Pipe
->
does not support a code block on the right-hand side e.g.x->{ open A; get("test") }
- Experimental support for for
async
/await
rescript-lang#5537 - Make
promise
a built-in type rescript-lang#5650 - Initial support for JSX V4 including genType, still work in progress.
- π₯ when V4 is activated, at most one component is allowed for each module.
- Add placeholder types for ES6 collections:
Set
,Map
,WeakSet
, andWeakMap
rescript-lang#5630
- Fix issue with arrays and creation of recursive values rescript-lang#5640
- Fix issue where characters such as newlines would be escaped in a template string expression rescript-lang#5638
- Fix issue where pipe
->
processing eats up attributes rescript-lang#5581 - Fix issue where cancelling
rescript build
would leave the.bsb.lock
file behind and block future builds
- Print patterns in warnings using rescript printer rescript-lang#5492
- Fix issue where watch mode would give an error on Windows rescript-lang#5621
Compiler
bsconfig.json
does not support// line
comments anymore.- Example:
"suffix": ".bs.js" // determine the suffix
- Fix: remove the comment and use standard json.
- Example:
- Changed return type of
Js.String.match_
as it was wrong. #5070- Example: any use of
Js.String.match_
andJs.String2.match_
- Fix: follow the type errors
- Example: any use of
- GenType is now vendored in the compiler and drops support for the Flow and untyped back-ends to focus on providing a better experience for TypeScript.
- Fix: keep on using the older version of the compiler and the separate genType package if Flow support is required. Migrate to TS if one wants to upgrade the compiler version.
- New records with optional fields e.g.
type opt = {x: int, y?: string}
were added as an experimental feature #5423 #5452 New Syntax - Add support for
@new @variadic
(see rescript-lang#5364)
- Classify bigint correctly #5351
- Fixed crash in
rescript build
on Windows #5516 - Fixed
rescript init
command not working #5526 - Fix issue with compiler log not terminated that causes problems with editor extension not clearing issues when fixed #5545
-
Changed Linux build to depend on GLIBC 2.28 again for compatibility with Debian 10.
-
Proper M1 support (CI now supports M1 native builds)
Syntax
@bs.send.pipe
is now removed. Earlier it was deprecated.- Missing labels in function application is now an error (https://forum.rescript-lang.org/t/ann-more-strict-checks-in-missed-labels/2117).
- Example:
let f = (x, ~z) => x + z; f(1, 2)
- Fix: do
let f = (x, ~z) => x + z; f(1, ~z=2)
instead
- Example:
- Externals without
@val
annotations do not work anymore, and externals with= ""
give an error.- Example:
external setTimeout: (unit => unit, int) => float = "setTimeout"
is not supported anymore. - Fix: use
@val external setTimeout: (unit => unit, int) => float = "setTimeout"
instead. - Example2:
@val external setTimeout: (unit => unit, int) => float = ""
is not supported anymore. - Fix2: use
@val external setTimeout: (unit => unit, int) => float = "setTimeout"
instead.
- Example:
- Strings processed at compile-time don't need escaping anymore.
- Example:
let blockCommentsRe = %re("/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+\\//g")
. - Fix: use
let blockCommentsRe = %re("/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g")
instead.
- Example:
- Remove parsing of "import" and "export" which was never officially supported rescript-lang/syntax#597 rescript-lang/syntax#599
- Example:
export type t = int
- Fix:
@genType type t = int
- Example2:
import realValue: complexNumber => float from "./MyMath"
- Fix2:
@genType.import("./MyMath") external realValue: complexNumber => float = "realValue"
- Example:
- Unicode is now supported in regular strings and chars (when the symbol fits). This is now going to work:
let str = "Ξ£"
. And, you'll be able to pattern match on unicode chars:switch c { | 'Ξ£' => "what a fine unicode char" | _ => "unicode is fun" }
- Doc comments
/** ... */
are now supported. Inernally, they are attributes, so are only valid at positions where@foo
is allowed, or a syntax error is given. Similarly for module-level/*** comments */
that can go where@@attributes
go.
- Fix printing for inline nullary functor types #477
- Fix stripping of quotes for empty poly variants #474
- Implement syntax for arity zero vs arity one in uncurried application in #139
- Fix parsing of first class module exprs as part of binary/ternary expr in #256
- Fix formatter hanging on deeply nested function calls #261
Libraries
- "Attributes not allowed here". If you see this error chances are you're using a ppx that needs updating to a new version.
See an exampe of how to update a ppx
- Example: for
rescript-relay
0.23.0 is not supported. - Fix: use
rescript-relay@beta
or the new version when released.
- Example: for
- Removed printing modules (Printf, Format etc) and related functions. Details of files added/removed: https://github.com/rescript-lang/rescript-compiler/commit/0fd8bb0e77c4b0e96a9647ac8af614305057003f.
- Fix library issue with missing
bytes_to_string
rescript-lang#5573 rescript-lang#5589
- Several Belt / Js libraries are now converted to ReScript syntax, with corresponding comments in Markdown format suitable for hovering. See #5361.
Playground
- Added
jsoo_playground_main.ml
as the rescript-lang.org playground bundle entrypoint
- Removed Reason syntax support for the playground experience. See rescript-lang#5375
You can find more old changelog from docs/changelog