Tags:
- 💥 [Breaking Change]
- 👓 [Spec Compliance]
- 🚀 [New Feature]
- 🐛 [Bug Fix]
- 📝 [Documentation]
- 🏠 [Internal]
- 💅 [Polish]
- Rename
JsErrortoJsExnand error modules cleanup. #7408 - Make
BigInt.fromFloatreturn an option rather than throwing an error in case it's passed a value with a decimal value. #7419
- Add shift (
<<,>>,>>>) operators forintandbigint. #7183 - Add bitwise AND (
&) operator forintandbigint. #7415 - Add bitwise NOT (
~) operator forintandbigint. #7418 - Significantly reduced the download size by splitting binaries into optional platform-specific dependencies (e.g,
@rescript/linux-x64). #7395 - JSX: do not error on ref as prop anymore (which is allowed in React 19). #7420
- Fix broken
bstracingCLI location. #7398 - Fix field flattening optimization to avoid creating unnecessary copies of allocating constants. #7421
- Fix leading comments removed when braces inside JSX contains
letassignment. #7424 - Fix JSON escaping in code editor analysis: JSON was not always escaped properly, which prevented code actions from being available in certain situations #7435
- Fix regression in pattern matching for optional fields containing variants. #7440
- Fix missing checks for duplicate literals in variants with payloads. #7441
- Fix printer removing private for empty record. #7448
- AST: Add bar location to
case. #7407
- Make
Jsx.elementa private empty record to avoid unnecessaryPrimitive_option.some. #7450
- Fix node.js
ExperimentalWarning. #7379 - Fix issue with gentype and stdlib json. #7378
- Fix type of
RegExp.Result.matches. #7393 - Add optional
flagsargument toRegExp.fromStringand deprecateRegExp.fromStringWithFlags. #7393
- Improve error message for missing value when the identifier is also the name of a module in scope. #7384
- Upgrade Flow parser to 0.267.0. #7390
- Move
Lazymodule to Stdlib. #7399
- Fix
Error.fromException. #7364 - Fix signature of
throw. #7365 - Fix formatter adds superfluous parens in pipe chain. #7370
- Remove
Stdlib_Charmodule for now. #7367 - Convert internal JavaScript codebase into ESM, ReScript package itself is now ESM (
"type": "module"). #6899 - Add built-in support for the JavaScript
inoperator. #7342 - AST cleanup: add
Pexp_awaitast node instead ofres.awaitattribute. (The attribute is still used for await on modules currently). #7368
- More deprecations in
Pervasives; addStdlib.PairandStdlib.Int.Ref. #7371
- Add
Dict.hasand doubleDict.forEachWithKey/Dict.mapValuesperformance. #7316 - Add popover attributes to
JsxDOM.domProps. #7317 - Add
Array.removeInPlacehelper based onsplice. #7321 - Add
inertattribute toJsxDOM.domProps. #7326 - Make reanalyze exception tracking work with the new stdlib. #7328
- Fix
Pervasive.maxusing boolean comparison for floats. #7333 - Experimental: Support nested/inline record types - records defined inside of other records, without needing explicit separate type definitions. #7241
- Add unified exponentiation (
**) operator for numeric types using ES7**. #7153 - Rename
raisetothrowto align with JavaScript vocabulary.raisehas been deprecated. #7346 - Add unified bitwise (
^) operator. #7216 - Stdlib: rename binary operations to match JavaScript terms. #7353
- Replace
~datewith~dayinDate.make. #7324 - Remove
-bs-jsx-mode. #7327 - Drop Node.js version <20 support, as it is reaching End-of-Life. #7354
- Treat
intmultiplication as a normal int32 operation instead of usingMath.imul. #7358
- Deprecate
JSON.Classify.classify. #7315 - Hide stdlib modules in output. #7305
- Deprecate unsafe host-specific bindings from stdlib. #7334
- Make unsafe function names consistent in
Stdlib.String. #7337 rescriptpackage does not triggerpostinstallscript anymore. #7350- Add Stdlib
BoolandCharmodules and improve Pervasives deprecation messages. #7361
- Fix recursive untagged variant type checking by delaying well-formedness checks until environment construction completes. #7320
- Fix incorrect expansion of polymorphic return types in uncurried function applications. #7338
- Clean list API. #7290
- Allow single newline in JSX. #7269
- Editor: Always complete from Core first. Use actual native regex syntax in code snippets for regexps. #7295
- Add
type tto Stdlib modules. #7302 - Gentype: handle null/nullable/undefined from Stdlib. #7132
- Fix async context checking for module await. #7271
- Fix
%externalextension. #7272 - Fix issue with type environment for unified ops. #7277
- Fix completion for application with tagged template. #7278
- Fix error message for arity in the presence of optional arguments. #7284
- Fix issue in functors with more than one argument (which are curried): emit nested function always. #7273
- Fix dot completion issue with React primitives. #7292
- Stdlib namespace for Core modules (fixes name clashes with user modules). #7285
- Fix runtime type check for Object in untagged variants when one variant case is
null. #7303 - Fix files that were being truncated when sent to the CDN over FTP. #7306
- Fix better editor completion for applications. #7291
- Fix
@react.componentWithPropsno longer works with@directive("'use memo'"). #7300
- Remove
ignoreinres_scanner.ml. #7280 - Use the new stdlib modules in the analysis tests. #7295
- Build with OCaml 5.3.0. #7294
- Simplify
JSON.Decodeimplementation. #7304
- Editor: Fix issue where pipe completions would not trigger with generic type arguments. #7231
- Fix leftover
assert falsein code fornull != undefined. #7232 - Editor: Fix issue where completions would not show up inside of object bodies. #7230
- Fix issue with pattern matching empty list which interferes with boolean optimisations. #7237
- Fix Cannot combine
@react.componentand@directive. #7260 - Fix issue where attributes on an application were not preserved by the AST conversion for ppx. #7262
- AST cleanup: Prepare for ast async cleanup: Refactor code for
@res.asyncpayload handling and clean up handling of type and term parameters, so that now each=>in a function definition corresponds to a function. #7223 - AST: always put type parameters first in function definitions. #7233
- AST cleanup: Remove
@res.asyncattribute from the internal representation, and add a flag to untyped and typed ASTs instead. #7234 - AST cleanup: Remove unused
expression_desc.Pexp_new,expression_desc.Pexp_setinstvar,expression_desc.Pexp_override,expression_desc.Pexp_poly,exp_extra.Texp_poly,expression_desc.Texp_new,expression_desc.Texp_setinstvar,expression_desc.Texp_override&expression_desc.Texp_instvarfrom AST. #7239 - AST cleanup: Remove
@res.partialattribute from the internal representation, and add a flag to untyped and typed ASTs instead. #7238 #7240 - AST cleanup: Remove unused
structure_item_desc.Pstr_class,signature_item_desc.Psig_class,structure_item_desc.Pstr_class_type,signature_item_desc.Psig_class_type,structure_item_desc.Tstr_class,structure_item_desc.Tstr_class_type,signature_item_desc.Tsig_class,signature_item_desc.Tsig_class_typefrom AST. #7242 - AST cleanup: remove
|.and rename|.to->in the internal representation for the pipe operator. #7244 - AST cleanup: represent concatenation (
++) and (dis)equality operators (==,===,!=,!==) just like in the syntax. #7248 - AST cleanup: use inline record for
Ptyp_arrow. #7250 - Playground: Bundle stdlib runtime so that the playground can execute functions from Core/Belt/Js. #7255
- AST cleanup: Remove
res.namedArgLocattribute and store the location information directly into the label. #7247
- Rewatch 1.0.10. #7259
- Editor: Fix issue where completions would stop working in some scenarios with inline records. #7227
- Add all standard CSS properties to
JsxDOMStyle. #7205
- AST cleanup: use inline record for Pexp_fun. #7213
- Add support for "dot completion everywhere" (ported from rescript-lang/rescript-vscode#1054). #7226
- Add assertions to stdlib docstring examples. Extract examples into Mocha tests, compile and run the tests in CI. #7219
- Add
Option.all&Result.allhelpers. #7181 - Add
@react.componentWithPropsfor React component functions taking a props record instead of labeled arguments. #7203
- Fix exponential notation syntax. #7174
- Fix bug where a ref assignment is moved ouside a conditional. #7176
- Fix nullable to opt conversion. #7193
- Raise error when defining external React components with
@react.componentWithProps. #7217 - Fix formatter handling of wildcard in pattern matching records with no fields specified. #7224
- Use latest compiler for tests. #7186
- Added infra to modernise AST: theres' Parsetree, Parsetree0 (legacy), and conversion functions to keep compatibility with PPX. #7185
- AST cleanup: remove exp object and exp unreachable. #7189
- AST cleanup: explicit representation for optional record fields in types. #7190 #7191
- AST cleanup: first-class expression and patterns for records with optional fields. #7192
- AST cleanup: Represent the arity of uncurried function definitions directly in the AST. #7197
- AST cleanup: Remove Pexp_function from the AST. #7198
- Remove unused code from Location and Rescript_cpp modules. #7150
- Build with OCaml 5.2.1. #7201
- AST cleanup: Remove
Function$entirely for function definitions. #7200 - AST cleanup: store arity in function type. #7195
- AST cleanup: remove explicit uses of
function$in preparation for removing the type entirely. #7206 - AST cleanup: remove
function$entirely. #7208
- Introduce "Unified operators" for arithmetic operators (
+,-,*,/,mod). #7057 - Add remainder (
%, aka modulus) operator. #7152
- Fix and clean up boolean and/or optimizations. #7134 #7151
- Fix identifiers with name
argumentsandevalto be mangled. #7163
- Improve code generation for pattern matching of untagged variants. #7128
- Improve negation handling in combination with and/or to simplify generated code (especially coming out of pattern matching). #7138
- Optimize JavaScript code generation by using
x == nullchecks and improving type-based optimizations for string/number literals. #7141 - Improve pattern matching on optional fields. #7143 #7144
- Optimize compilation of switch statements for untagged variants when there are no literal cases. #7135
- Further improve boolean optimizations. #7149
- Simplify code generated for conditionals. #7151
- Move rescript-editor-analysis and rescript-tools into compiler repo. #7000
- OCaml compatibility in the stdlib and primitives are dropped/deprecated. #6984
- Remove JSX v3. #7072
- Remove js_cast.res. #7075
- Use FORCE_COLOR environmental variable to force colorized output. #7033
- Allow spreads of variants in patterns (
| ...someVariant as v =>) when the variant spread is a subtype of the variant matched on. #6721 - Fix the issue where dynamic imports are not working for function-defined externals. #7060
- Allow pattern matching on dicts.
switch someDict { | dict{"one": 1} => Js.log("one is one") }. #7059 - "ReScript Core" standard library is now included in the
rescriptnpm package. #7108 #7116 - Handle absolute filepaths in gentype. #7104
- Fix tuple coercion. #7024
- Fix attribute printing. #7025
- Fix "rescript format" with many files. #7081
- Fix bigint max, min. #7088
- Fix parsing issue with nested variant pattern type spreads. #7080
- Fix JSX settings inheritance: only 'version' propagates to dependencies, preserving their 'mode' and 'module'. #7094
- Fix variant cast to int. #7058
- Fix comments formatted away in function without arguments. #7095
- Fix genType JSX component compilation. #7107
- Add some context to error message for unused variables. #7050
- Improve error message when passing
childrenprop to a component that doesn't accept it. #7044 - Improve error messages for pattern matching on option vs non-option, and vice versa. #7035
- Improve bigint literal comparison. #7029
- Improve output of
@variadicbindings. #7030 - Improve error messages around JSX components. #7038
- Improve output of record copying. #7043
- Provide additional context in error message when
unitis expected. #7045 - Improve error message when passing an object where a record is expected. #7101
- Remove uncurried flag from bsb. #7049
- Build runtime/stdlib files with rescript/bsb instead of ninja.js. #7063
- Build tests with bsb and move them out of jscomp. #7068
- Run
build_testson Windows. #7065 - Rename folder "jscomp" to "compiler". #7086
- Disable -bs-cross-module-opt for tests. #7071
- Move
ounit_testsinto thetestsfolder. #7096 - Move
syntax_testsinto thetestsfolder. #7090 #7097 - Capitalize runtime filenames. #7110
- Build mocha tests as esmodule / .mjs. #7115
- Use dict instead of Dict.t everywhere. #7136
- Revert "Throws an instance of JavaScript's
new Error()and adds the extension payload forcauseoption" (#6611). #7016 - Fix dict literals error. #7019
- Allow coercing polyvariants to variants when we can guarantee that the runtime representation matches. #6981
- Add new dict literal syntax (
dict{"foo": "bar"}). #6774 - Optimize usage of the new dict literal syntax to emit an actual JS object literal. #6538
- Fix issue where long layout break added a trailing comma in partial application
.... #6949 - Fix incorrect format of function under unary operator. #6953
- Fix incorrect printing of module binding with signature. #6963
- Fix incorrect printing of external with
@asattribute and_placholder (fixed argument). #6970 - Disallow spreading anything but regular variants inside of other variants. #6980
- Fix comment removed when function signature has
typekeyword. #6997 - Fix parse error on doc comment before "and" in type def. #7001
- Add dev container. #6962
- Convert more tests to the node test runner. #6956
- Remove attribute "internal.arity". #7004
- Remove dead modules. #7008
- Improve formatting in the generated js code. #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 casebodies - Fixed tabulation for
throw new Errorbodies - Removed empty line at the end of
switchstatement - Removed empty
defaultcase fromswitchstatement in the generated code
- Optimised the Type Extension runtime code and removed trailing
/1fromRE_EXN_ID. #6958 - Compact output for anonymous functions. #6945 #7013
- Rewatch 1.0.9. #7010
- Allow
@directiveon functions for emitting function level directive code (let serverAction = @directive("'use server'") (~name) => {...}). #6756 - Add
rewatchto the npm package as an alternative build tool. #6762 - Throws an instance of JavaScript's
new Error()and adds the extension payload forcauseoption. #6611 - Allow free vars in types for type coercion
e :> t. #6828 - Allow
privatein with constraints. #6843 - Add regex literals as syntax sugar for
@bs.re. #6776 - Improved mechanism to determine arity of externals, which is consistent however the type is written. #6874 #6881 #6883
- Add
Js.globalThisobject binding. #6909
- Make
jandjsallowed names for tag functions. #6817 lazysyntax is no longer supported. If you're using it, useLazymodule orReact.lazy_instead. #6342- Remove handling of attributes with
bs.prefix (@bs.as->@asetc.). #6643 - Remove obsolete
@bs.openfeature. #6629 - Drop Node.js version <18 support, due to it reaching End-of-Life. #6429
- Remove deprecated -bs-super-errors option. #6814
- Some global names and old keywords are no longer prefixed. #6831
- Remove ml parsing tests and conversion from
.mlto.resvia format. #6848 - Remove support for compiling
.mlfiles, and general cleanup. #6852 - Remove
rescript convertsubcommand. #6860 - Remove support for
@bs.send.pipe. This also removes all functions inJs_typed_arraythat rely on@bs.send.pipe. #6858 #6891 - Remove deprecated
Js.VectorandJs.List. #6900 - Remove support for
%timeextension. #6924 - Remove
caml_external_polyfillmodule and the related behavior. #6925
- Fix unhandled cases for exotic idents (allow to use exotic PascalCased identifiers for types). #6777 #6779 #6897
- Fix unused attribute check for
@as. #6795 - Reactivate unused attribute check for
@int. #6802 - Fix issue where using partial application
...can generate code that usesCurryat runtime. #6872 - Avoid generation of
Currywith reverse application|>. #6876 - Fix issue where the internal ppx for pipe
->would not use uncurried application in uncurried mode. #6878
- Build with OCaml 5.2.0. #6797
- Convert OCaml codebase to snake case style. #6702
- Fix
-nostdlibinternal compiler option. #6824 - Remove a number of ast nodes never populated by the .res parser, and resulting dead code. #6830
- Remove coercion with 2 types from internal representation. Coercion
e : t1 :> t2was only supported in.mlsyntax and never by the.resparser. #6829 - Convert
caml_formatandjs_mathto.res. #6834 - Convert
js.mlfiles to.res. #6835 - Remove old
.mltests. #6847 - Make compiler libs ready for uncurried mode. #6861
- Make tests ready for uncurried mode. #6862
- Make gentype tests uncurried. #6866
- Remove
@@uncurried.swap, which was used for internal tests. #6875 - Build the compiler libraries/tests in uncurried mode. #6864
- Ignore
-uncurriedcommand-line flag. #6885 - Cleanup: remove tracking of uncurried state in parser/printer. #6888
- Remove
%opaqueprimitive. #6892 - Reunify JsxC/JsxU -> Jsx etc. #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. #6893 - Remove
@uncurryfrom ReScript sources (others, tests). #6938 - Remove leftover uncurried handling. #6939 #6940
- Start converting tests from mocha to the node test runner. #6956
- Make the
--helparg be prioritized in the CLI, so correctly prints help message and skip other commands. #6667 - Remove redundant space for empty return in generated js code. #6745
- Remove redundant space for export in generated js code. #6560
- Remove redundant space after continue in generated js code. #6743
- Remove empty export blocks in generated js code. #6744
- Fix indent for returned/thrown/wrapped in parentheses objects in generated js code. #6746
- Fix indent in generated js code. #6747
- In generated code, use
letinstead ofvar. #6102 - Turn off transformation for closures inside loops when capturing loop variables, now that
letis emitted instead ofvar. #6480 - Improve unused attribute warning message. #6787
- Remove internal option
use-stdlibfrom build schema. #6778 - Fix
Js.Types.JSBigIntpayload to use nativebiginttype. #6911 - Deprecate
%externalextension, which has never been officially introduced. #6906 - Deprecate
xxxUfunctions in Belt. #6941 - Improve error messages for function arity errors. #6990
- Add missing HTML attribute capture to JsxDOM.res. #7006
- Fix tag function location on compiler error. #6816
- Fix Deno compatibility issues on Windows. #6850
- Fix issue with infinite loops with type errors on recursive types. #6867
- Ignore
@uncurryattribute in uncurried mode, to avoid generating calls toCurryat runtime. #6869 - Avoid generating calls to Curry when adjusting arity of uncurried functions. #6870
- Fix build after calling without
-warn-error, see #6868 for more details. #6877 - Fix issue with uninitialized
_paramin recursive functions with unit argument. #6907
- Omit standard library dir from load path if -nostdlib is set. #6833
- Fix issue where capitalised type variables were only allowed in certain positions. #6820
- Support Windows 11 ARM (using the x64 binaries in emulation). #6813
- Fix location of let bindings with attributes. #6791
- PPX v4: mark props type in externals as
@liveto avoid dead code warnings for prop fields in the editor tooling. #6796 - Fix issue where optional labels were not taken into account when disambiguating record value construction. #6798
- Fix issue in gentype when type
Jsx.elementsurfaces to the user. #6808 - Fix inclusion check (impl vs interface) for untagged variants, and fix the outcome printer to show tags. #6669
- Fix encoding inside tagged template literals. #6810
- Fix issue of incorrect switch cases with identical bodies when mixing object and array. #6792
- Fix formatter eats comments on the first argument of a uncurried function. #6763
- Fix formatter removes parens in pipe operator with anonymous uncurried function. #6766
- Revert escape JSX prop names with hyphens (#6705). #6731
- Add
%todoextension for leaving implementation for later. #6713 - Add
-warn-errorargument for generating errors in CI. Useful for%todoextension. #6717
- Improve error when using
@deriving(accessors)on a variant with record arguments. #6712 - Stop escaping JSX prop names with hyphens. #6705
- Fix trailing undefined for optional parameters not omitted with
@sendand@new. #6716 - Fix JSX4 adding the incorrect type annotation for the prop
refinReact.forwardRefcomponent. #6718 - Fix description for warning number 110. #6725
- Module spec
es6andes6-globalis deprecated in favor ofesmodule. #6709
- Fix variance setting for builtin
dicttype. Fixes issues around inference. #6707
- Fix mishandling of uncurried functions in super errors. #6694
- Fix misparsing in/after JSX. #6686
- Fix
@deriving(accessors)outputting curried functions in uncurried mode. #6687
- Fix emitting static import instead of dynamic import. #6664
- Fix local type variables breaking react components. #6665
- Fix remove redundant branches in generated switch body. #6672
- Fix issue in partial application when the last named arg is provided. #6681
- Omit
undefinedin external function calls for trailing optional arguments when not supplied. #6653 - Make pattern match suggestions to be easier to copy-paste. #6656
- No parens around tagged template literals. #6639
- Allow identifier with modules in tagged template literals (e.g. Pg.sql
select * from ${table} where id = ${id}). #6645
- Fix compiler crash when reexporting tagged template literal externals. #6645
- Add support for array spread. #6608
- Support import attributes (https://github.com/tc39/proposal-import-attributes) in
@module(). #6599 - allow hyphens in jsx tag names (e.g.
<mj-column>). #6609
- Fix issue with async and newtype in uncurried mode. #6601
- Generic JSX transform: Rename expected module name for lowercase JSX to
ElementsfromDOM. #6606 - Generic JSX transform: Set default config params for
jsxConfig. #6606 - Generic JSX transform: Handle namespaced names. #6606
- Fix issue with doc comment in recursive module. #6613
- Fix issue with Exceptions and Extensible types runtime generation. #6570
- Fix inline comment before spread syntax in record. #6615
- Use OCaml 4.14.1 (+ Alpine 3.19 container) for CI build. #6600
- Experimental support of tagged template literals, e.g.
sql`select * from ${table}`. #6250 - Experimental support for generic/custom JSX transforms. #6565
dictis now a builtin type. #6590
- GenType: distinguish inline records from unary variant cases of object type. #6586
- Renamed inline record fields: fix renamed field access in inline records. #6551
- Fixed issue with coercions sometimes raising a
Not_foundinstead of giving a proper error message. #6574 - Fix issue with recursive modules and uncurried. #6575
- Improve error message for missing label(s) in function application. #6576
No changes compared to rc.9.
- GenType: support
@deriving(accessors)outputs. #6537 - Allow coercing ints and floats to unboxed variants that have a catch-all unboxed int or float case. #6540
- Allow tuples in untagged variants. #6550
- GenType: now emits full suffix on JS import path to be compatible with
.res.js. #6541
- Add support for type coercion for invariant type arguments such as array payloads. #6518
- Start treating
rescriptcommand the same as therescript buildcommand, so now you can dorescript -w. #6524
- Fix accidental removal of
Belt.Result.OkandBelt.Result.Errorconstructors in rc.5. #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. #6516
- Fix compiler crash with unboxed variant definition with only 1 constructor. #6523
- GenType: support mutual recursive types inside modules. #6528
- Workaround for
@asin labels in uncurried externals, which was broken. #6527
- GenType: make outputs DCE-friendly. #6508
- Allow empty inline records in variants. #6494
- Allow empty record patterns in pattern matching. #6494
- Fix issue where an inline record with attributes did not parse. #6499
- Fix issue with uncurried function with 1 arg being a variable where an undefined variable could be emitted. #6507
- Fix runtime errors on
@genType.as("alias")output. #6509
- Freely configurable suffix for generated .js files. #6472
- Fix issue with GenType and
resultintroduced in rc.5. #6464 - Fix compiler crash when inlining complex constants in pattern matching. #6471
- Fix issue with generating async functions inside loops. #6479
- Fix issue with Gentype and string annotations with numbers such as
@as("0"). #6487 - Fix error message on curried/uncurried signature mismatch. #6414
- Improve some error messages in rescript.conf parsing. #6469
- Allow coercing unboxed variants with only strings (now including with a single payload of string) to the primitive string. #6441
- Allow coercing strings to unboxed variants that have a catch-all unboxed string case. #6443
- Allow coercing
inttofloat. #6448
- Fix issue with dynamic import of module in nested expressions. #6431
- Fix issue where GenType was not supporting
@tagon ordinary variants. #6437 - Fix using dynamic import of module in block instead of async function. #6434
- Fix issue with using dynamic import of module in uncurried mode. #6434
- Fix build error with JSX v4 transformation of React.forwardRef in uncurried mode. #6447
- Fix printing of exotic JSX names. #6451
- Fix locations when code with
awaitfails to compile (all locations would point to the internal functionunsafe_await). #6452 - Fix renaming fields (with @as) in inline records doesn't work when destructuring. #6456
- Fix
rc.4regressions:
- Remove dependency stdlib-406 -> belt. #6453
- Playground: Add support for implicitly opened modules. #6446
- Add
Denoto reserved names, so that modules namedDenodon't clash with the globally exposedDenoobject. #6428 - Disable ESLint/TSLint on gentype outputs properly. #6442
- Improve
rescriptCLI to usestdout/stderrappropriately for help command's message. #6439 - Generate
f()instead off(undefined)forf(). #6459
- Support renaming fields in inline records with
@asattribute. #6391 - Support renaming object fields of
@objexternal ppx with@asattribute. #6391 - Add builtin abstract types for File and Blob APIs. #6383
- Untagged variants: Support
promise, RegExes, Dates, File and Blob. #6383 - Untagged variants: Support
bool. #6368 - Support aliased types as payloads to untagged variants. #6394
- Support the async component for React Server Component in JSX V4. #6399
- Support
rescript.jsonconfiguration file and deprecatebsconfig.json. #6382
- Update watcher rules to recompile only on config and
*.res/*.resi/*.ml/.mlifile changes. Solves the issue of unnecessary recompiles on.css,.ts, and other unrelated file changes. #6420 - Add smart printer for pipe chains. #6411 (the formatter will reformat existing code in certain cases)
Js.Json.tnow usesBoolean(bool)instead of explicit@as(true) True | @as(false) False. #6421
- Fix issue with GenType and labelled arguments. #6406
- Fix dependencies reinitialization on every change in watch mode. Leads to faster rebuilds and cleaner terminal. #6404
- A little performance improvement for JSX V4 runtime helper by removing one object allocation for components with key prop. #6376
- The error message for "toplevel expressions should evaluate to unit" has been revamped and improved. #6407
- Improve "Somewhere wanted" error messages by changing wording and adding more context + suggested solutions to the error messages where appropriate. #6410
- Display the compile time for
rescript buildcommand. #6404 - Improve help message for
buildandcleancommands. #6404 - Pass through the
-verboseflag to builds in watch mode. #6404 - Improve error message when defining duplicate labels in a record. #6415
- Improve error message when trying to concatenate strings using the wrong operator. #6416
- Fix issue with JSX V4 when component props have the default value with same name. #6377
- Fixed code formatter with
"uncurried": falsein bsconfig. #6378
- Add
Bunto reserved names, so that modules namedBundon't clash with the globally exposedBunobject. #6381
rescript buildwill always build its dependency by default. The argument-with-depsis not needed anymore. #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. #6354
- Fixed outcome printer resolution of uncurried config. #6353
- GenType: Propagate comments from record fields to emitted TypeScript types. #6333
$$defaultis no longer exported from the generated JavaScript when using default exports. #6328
- Conditionally print error message about record with missing label potentially being a component. #6337
- Put definition in the bottom and the actual error at the top when reporting errors for supplying fields etc with the wrong name. #6336
- Fix left over places where polyvariant tag names were printed in OCaml syntax instead of ReScript. #6348
- Variants: Allow coercing from variant to variant where applicable. #6314
- Variants: Experimental support for spreading variant type definitions to copy constructors from one variant to another. #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. #6317
- Fixed outcome printing of uncurried higher order function types. #6323
- Fixed printing of type constraints in template literal substitutions. #6324
- Untagged variants: consider regexp as an object type. #6296
- Semantic-based optimization of code generated for untagged variants. #6108
- Record type spreads: Allow using type variables in type spreads. Both uninstantiated and instantiated ones. #6309
- Variants: Allow coercing variants to string/int/float when applicable. #6311
- Fix issue with dynamic import of modules in expressions. #6310
- Introduced a new
%ffiextension (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. #6251 - Extended untagged variants with function types. #6279
- Remove rudimentary node bindings and undocumented
%nodeextension. #6285
- Fix issue where uncurried type internals leak in type error. #6264
- Improve error messages for untagged variant definition. #6290
- Fix type checking performance issue for large records. #6289
- Make uncurried mode opt-out: by default, every project is now in uncurried mode, unless
"uncurried": falseis specified in the project config. #6249
- Removed duplicate Super_error implementation in syntax. #6246
- Fix issue with inlining records in the presence of record coercion. #6256
-bs-super-errorsflag has been deprecated along with Super_errors. #6243@rescript/react>= 0.12.0-alpha.2 is now required because of the React.fragment's children type fix. #6238
- Remove unnecessary require and import statements when using dynamic imports. #6232
- Fix option unboxing logic in the presence of untagged variants. #6233
- Fix printing of local module with type. #6212
- Adapting JSX4 to React.fragment's children type change (
'children->React.element) #6238
- In uncurried mode, outcome printer swaps curried and uncurries function printing compared to legacy.
- Add location information to duplicate type definition error messages. #6199
- Replace normal module errors with Super_error module, and clean up Super_error. #6199
Js.Json.t,Js.nullandJs.nullableare now untagged variants representing their runtime values, instead of abstract types. #6218
- Add support for Dynamic import. #5703
- GenType: Add
moduleResolutionoption to customize extensions on emitted import statements. This helps to adjust output compatibility with TypeScript projects using ESM. #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. #6208
- Parse
assertas a regular function.assertis no longer a unary expression. Example: beforeassert 1 == 2is parsed as(assert 1) == 2, now it is parsed asassert(1 == 2). #6180
- Make "rescript format" work with node 10 again and set minimum required node version to 10 in package.json. #6186
- Fix partial application for uncurried functions with labeled args #6198
- Add error messages for dangling doc comments/attributes and mutable in record type definition. #6206
- Fix issue with overlapping array and object in untagged variants #6219
- Add surface syntax for partial application of uncurried functions:
foo(1, ...). This corresponds to curried application in the old mode. #6166
- Fix broken formatting in uncurried mode for functions with _ placeholder args. #6148
- Fix issue where spreading record types with optional labels would not have their labels preserved as optional. #6154
- Fix error location to be the type with the spreads when spreading record types with duplicate labels. #6157
- Disable warning on
@inlineattibute on uncurried functions. #6152 - Support doc comments on arguments of function types. #6161
- Fix issue with record type coercion and unboxed. #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. #6158
- Emit directive above header comment. #6172
- Add error message to private extension. #6175
- Add support for extensible records (e.g.
type t = {...t1, x:int, ...t2}) #5715
- Fix formatting and parentheses placement in uncurried functions with constraints. #6143
- Add support for type coercion
:>for records. #5721
- Special case generation of uncurried functions with 1 argument of unit type so they don't take a parameter. #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@@uncurriedlocally 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. Themakefunction of components is generated as an uncurried function. Use best effort to determine the config when formatting a file. #5968 #6080 #6086 #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". #6095
- Introduce untagged variants #6103
- Add support for unary uncurried pipe in uncurried mode #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 #5805
- Add support for uncurried externals #5815 #5819 #5830 #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. #5825
- Add support for default arguments in uncurried functions #5835
- Inline uncurried application when it is safe #5847
- Support optional named arguments without a final unit in uncurried functions #5907
- GenType: add the option to use the
@genTypeannotation at the module level, meaning that all the items in the module should be exported. #6113 - GenType: add support for
@genTypeannotations on module definitions. #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@9rescript 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 => 3is not equivalent to(. x, y) => 3anymore. It's instead equivalent to(. x) => { y => 3 }. Also,(. int) => string => boolis not equivalen to(. int, string) => boolanymore. 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 #6068 - Remove deprecated module
Printexc @deriving(jsConverter)not supported anymore for variant types #6088- New representation for variants, where the tag is a string instead of a number. #6088
- GenType: removed support for
@genType.asfor records and variants which has become unnecessary. Use the language's@asinstead to channge the runtime representation without requiring any runtime conversion during FFI. #6099 #6101
- Fix issue where uncurried was not supported with pipe #5803
- Fix printing of nested types in uncurried mode #5826
- Fix issue in printing uncurried callbacks #5828
- Fix formatting uncurried functions with attributes #5829
- Fix parsing/printing uncurried functions with type parameters #5849
- Fix compiler ppx issue when combining
asyncand uncurried application #5856 - Fix issue where the internal representation of uncurried types would leak when a non-function is applied in a curried way #5892
- Fix some comments disappearing in array access expressions #5947
- Parser: fix location of variable when function definition
{v => ...}is enclosed in braces #5949 - Fix issue with error messages for uncurried functions where expected and given type were swapped #5973
- Fix issue with integer overflow check https://github.com/rescript-lang/rescript-compiler/pull/6028
- Make internal encoding of locations aware of unicode https://github.com/rescript-lang/rescript-compiler/pull/6073
- Fix issue where
foo(x,_)in uncurried mode would generate a curried function https://github.com/rescript-lang/rescript-compiler/pull/6082 - Fix printing of uncurried application when the lhs is a function definition https://github.com/rescript-lang/rescript-compiler/pull/6084
- Fix parsing uncurried type starting with path https://github.com/rescript-lang/rescript-compiler/pull/6089
- Fix bigInt comparison https://github.com/rescript-lang/rescript-compiler/pull/6097
- Fixed a bug where the async attribute was not preserved when using the
@thisdecorator in ReScript functions. This fix allows proper handling of async functions with the@thisdecorator. Issue: https://github.com/rescript-lang/rescript-compiler/issues/6100 - Fix issue with GenType and module aliases https://github.com/rescript-lang/rescript-compiler/issues/6112
- Syntax: process uncurried types explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5784 https://github.com/rescript-lang/rescript-compiler/pull/5822
- Syntax: process uncurried function declarations explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5794
- PPX V4: allow uncurried
makefunction and treat it like a curried one #5802 #5808 #5812 - Remove processing of objects expressions, which don't exist in
.ressyntax (Pexp_object) https://github.com/rescript-lang/rescript-compiler/pull/5841 - Remove class type processing from compiler ppx https://github.com/rescript-lang/rescript-compiler/pull/5842
- Remove method application via operator
##, which does not exist in.ressyntax https://github.com/rescript-lang/rescript-compiler/pull/5844 - Treat
@methannotation as making the type uncurried for backwards compatibitly with some examples https://github.com/rescript-lang/rescript-compiler/pull/5845 - Process
@setannotation for field update as generating an uncurried function https://github.com/rescript-lang/rescript-compiler/pull/5846 - Treat uncurried application of primitives like curried application, which produces better output https://github.com/rescript-lang/rescript-compiler/pull/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 https://github.com/rescript-lang/rescript-compiler/pull/5870 - PPX V3: allow uncurried
makefunction and treat it like a curried one https://github.com/rescript-lang/rescript-compiler/pull/6081 - Add support for
|>in uncurried mode by desugaring it https://github.com/rescript-lang/rescript-compiler/pull/6083 - Change the compilation of pattern matching for variants so it does not depends on variats being integers https://github.com/rescript-lang/rescript-compiler/pull/6085
- Improve code generated for string templates https://github.com/rescript-lang/rescript-compiler/pull/6090
- Move Jsx and JsxDOM and JsxEvent and JsxPPXReactSupport inside Pervasives and build them separately for curried and uncurried mode https://github.com/rescript-lang/rescript-compiler/pull/6091
- Gentype: allow recursive data types https://github.com/rescript-association/genType/issues/585
- Fix implementation of directives https://github.com/rescript-lang/rescript-compiler/pull/6052
- Fix issue if the
libdir is included in the sources of bsconfig.json https://github.com/rescript-lang/rescript-compiler/pull/6055 - Fix issue with string escape in pattern match https://github.com/rescript-lang/rescript-compiler/pull/6062
- Fix issue with literal comparison of string constants https://github.com/rescript-lang/rescript-compiler/pull/6065
- Add support for toplevel
awaithttps://github.com/rescript-lang/rescript-compiler/pull/6054
- Better error message for extension point https://github.com/rescript-lang/rescript-compiler/pull/6057
- Improve format check help https://github.com/rescript-lang/rescript-compiler/pull/6056
- Deprecate unsafe
j`$(a)$(b)`interpolation: use string templates`${a}${b}`instead https://github.com/rescript-lang/rescript-compiler/pull/6067
- Add experimental suppport for directives. An annotation such as
@@directive("use client;")emitsuse client;verbatim before imports https://github.com/rescript-lang/rescript-compiler/pull/5999 genType: addCorestandard 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<_>https://github.com/rescript-lang/rescript-compiler/pull/6024
genType: streamline the treatment of optionals as undefined https://github.com/rescript-lang/rescript-compiler/pull/6024- Represent
option<t>asundefined | tinstead 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 https://github.com/rescript-lang/rescript-compiler/pull/5956
- Fix issue where error messages related to non-existent props were displayed without location information https://github.com/rescript-lang/syntax/pull/730
- Fix issue where uncurried functions were incorrectly converting the type of a prop given as a default value to curried https://github.com/rescript-lang/syntax/pull/731
- Fix issue with nested async functions, where the inner function would be emitted without
asynchttps://github.com/rescript-lang/rescript-compiler/pull/5984 - Fix issue with printing async functions with locally abstract types https://github.com/rescript-lang/syntax/pull/732
- Fix issue with async context and locally abstract types https://github.com/rescript-lang/rescript-compiler/pull/5985
- Fix support for recursive components in JSX V4 https://github.com/rescript-lang/syntax/pull/733
- GenType: fix issue with V3 compatibility mode (see https://github.com/rescript-lang/rescript-compiler/issues/5990) https://github.com/rescript-lang/rescript-compiler/pull/5992
- Fix issue with overlapping labelled argument with default value https://github.com/rescript-lang/syntax/pull/734
- Fix issue with using alias and default value together https://github.com/rescript-lang/syntax/pull/734
- Fix issue in
Js.Promise2wherethenandcatchwere returningundefinedhttps://github.com/rescript-lang/rescript-compiler/pull/5996 - Fix issue in the compiler back-end where async functions passed to an
@uncurryexternal would be inlined and transformed in a way that loses async https://github.com/rescript-lang/rescript-compiler/pull/6011 - Fix location issue for the treatment of
asyncfunctions where hovering on the body with a type error would show'a => promise<'a>everywhere https://github.com/rescript-lang/rescript-compiler/pull/6014 - Fix formatting of
switchexpressions that contain bracedcasesinside https://github.com/rescript-lang/syntax/pull/735 - Fix formatting of props spread for multiline JSX expression https://github.com/rescript-lang/syntax/pull/736
- Support
@gentype.importas an alias to@genType.importin the compiler https://github.com/rescript-lang/rescript-compiler/pull/6021 - In GenType, check annotations also in module types to decide whether to produce the
.gen.tsxfile https://github.com/rescript-lang/rescript-compiler/pull/5903 - Fix issue with JSX V4 and newtype https://github.com/rescript-lang/syntax/pull/737
- Fix issue with JSX V4 when components are nested https://github.com/rescript-lang/syntax/pull/738
- Fix issue where generic compare on
floatvalues would be different from the compare for typefloathttps://github.com/rescript-lang/rescript-compiler/pull/6043 - Improve code generated for default arguments in JSX V4 https://github.com/rescript-lang/syntax/pull/739
- Fix issue with JSX V4 props of the form
~p as module(...)https://github.com/rescript-lang/syntax/pull/739
- Fix an issue where error messages related to duplicate props were displayed without a loc and were unclear https://github.com/rescript-lang/syntax/pull/728
- Parse the attributes of labelled argument to the pattern attributes of argument instead of function. https://github.com/rescript-lang/syntax/pull/722
- The prop names duplicated to keyword are not mangled automatically in JSX v4.
- Use
@asinstead
- Use
- Add support for empty inlined record literal
{}for inlined records where all fields are optional https://github.com/rescript-lang/rescript-compiler/pull/5900
- Prevent inlining of async functions in additional cases https://github.com/rescript-lang/rescript-compiler/issues/5860
- Fix build error where aliasing arguments to
_in the make function with JSX V4. https://github.com/rescript-lang/rescript-compiler/pull/5881 - Fix parsing of spread props as an expression in JSX V4 https://github.com/rescript-lang/rescript-compiler/pull/5885
- Fix dropping attributes from props in make function in JSX V4 https://github.com/rescript-lang/rescript-compiler/pull/5905
- Fix issue where no error was reported when ? was used for non-optional fields. https://github.com/rescript-lang/rescript-compiler/pull/5853
- Fix issue where optional fields in inline records were not supported and would cause type errors https://github.com/rescript-lang/rescript-compiler/pull/5827
- Prevent inlining of async functions in last stage of the compiler when the functions are not exported (not in interface file or shadowed) https://github.com/rescript-lang/rescript-compiler/pull/5790
- Support format check with
rescript format -check. https://github.com/rescript-lang/rescript-compiler/pull/5760
- Fix issue where the last line of
rescript format --helpusage was being swallowed https://github.com/rescript-lang/rescript-compiler/pull/5760 - Specialize the printing of the rhs of a record field assignment for optional values
{x: ? e}https://github.com/rescript-lang/syntax/issues/714
- Support the use of spread anywhere in list creation (e.g.
list{...x, 1, ...y, ...z}). https://github.com/rescript-lang/syntax/pull/692 - Add support for the argument of
@react.componentto set a props type from the outside. https://github.com/rescript-lang/syntax/pull/699
- Fix issue where the JSX key type is not an optional string https://github.com/rescript-lang/syntax/pull/693
- Prevent inlining of async functions https://github.com/rescript-lang/rescript-compiler/issues/5754
- Fix build error for JSX fragment without children https://github.com/rescript-lang/syntax/pull/704
- Fix issue where async as an id cannot be used with application and labelled arguments https://github.com/rescript-lang/syntax/issues/707
- Fix 5557: the exhaustive checking for char is incorrect during the unicode migration https://github.com/rescript-lang/rescript-compiler/pull/5749
- Fix 5753: the comment for unicode char is inaccurate https://github.com/rescript-lang/syntax/pull/709
- Treat await as almost-unary operator weaker than pipe so
await foo->barmeansawait (foo->bar)https://github.com/rescript-lang/syntax/pull/711
- Change payload of
Pconst_charfromchartointhttps://github.com/rescript-lang/syntax/pull/709
- Fix issue with changes not being applied with React Native's Metro bundler for files with warnings https://github.com/rescript-lang/rescript-compiler/pull/5738
- Fix emitting unary minus for floats in case of negative constants https://github.com/rescript-lang/rescript-compiler/pull/5737
- Fix issue where a spread
...xin non-last position would not be reported as syntax error https://github.com/rescript-lang/syntax/pull/673/ - Fix issue where the formatter would delete
asyncin a function with labelled arguments. - Fix several printing issues with
asyncincluding an infinite loop https://github.com/rescript-lang/syntax/pull/680 - Fix issue where certain JSX expressions would be formatted differenctly in compiler 10.1.0-rc.1 https://github.com/rescript-lang/syntax/issues/675
- Fix issue where printing nested pipe discards await https://github.com/rescript-lang/syntax/issues/687
- Deprecate DOM element attributes in
JsxDOM.domProps:begin_,end_,to_- Use
begin,end,toinstead.
- Use
- Emit an error when a
@stringor@intattribute is used in a V4 component https://github.com/rescript-lang/rescript-compiler/issues/5724
- Add extra variants for output filename suffixes in
bsconfig.json:.bs.mjsand.bs.cjsare allowed https://github.com/rescript-lang/rescript-compiler/pull/5631 - Safe promises: t-first Js.Promise2 bindings, and remove warning for nested promises https://github.com/rescript-lang/rescript-compiler/pull/5709
- Fix issue where uncurried async functions were emitted without
asynchttps://github.com/rescript-lang/rescript-compiler/pull/5718 - Fix location issue in error messages with JSX V4 where the multiple props types are defined https://github.com/rescript-lang/syntax/pull/655
- Fix location issue in make function in JSX V4 that breaks dead code elimination https://github.com/rescript-lang/syntax/pull/660
- Fix parsing (hence pretty printing) of expressions with underscore
_and comments. - Fix printing of comments inside JSX tag https://github.com/rescript-lang/syntax/pull/664
- Fix issue where formatter erases tail comments inside JSX tag https://github.com/rescript-lang/syntax/issues/663
- Fix issue where the JSX prop has type annotation of the first class module https://github.com/rescript-lang/syntax/pull/666
- Fix issue where an empty record literal {} expected to have a non-record type would type check https://github.com/rescript-lang/rescript-compiler/pull/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. https://github.com/rescript-lang/syntax/pull/665
- Add
JsxPPXReactSupportmodule 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 https://github.com/rescript-lang/syntax/pull/642
- Propagte
"jsx"configuration to dependencies https://github.com/rescript-lang/rescript-compiler/pull/5661 - Add support for empty record literal
{}for records where all fields are optional https://github.com/rescript-lang/rescript-compiler/pull/5658 - Add support for empty record type (e.g.
type empty = {}) https://github.com/rescript-lang/rescript-compiler/pull/5658
- Fix issue in formatting JSX spread props https://github.com/rescript-lang/syntax/pull/644
- Fix location issue in error messages with JSX V4 where the body of the component is an application https://github.com/rescript-lang/syntax/pull/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|>https://github.com/rescript-lang/syntax/pull/629 - Fix printing of optional fields in records https://github.com/rescript-lang/rescript-compiler/issues/5654
- Fix printing of comments inside empty blocks https://github.com/rescript-lang/syntax/pull/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 https://github.com/rescript-lang/rescript-compiler/pull/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/awaithttps://github.com/rescript-lang/rescript-compiler/pull/5537 - Make
promisea built-in type https://github.com/rescript-lang/rescript-compiler/pull/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, andWeakMaphttps://github.com/rescript-lang/rescript-compiler/pull/5630
- Fix issue with arrays and creation of recursive values https://github.com/rescript-lang/rescript-compiler/pull/5640
- Fix issue where characters such as newlines would be escaped in a template string expression https://github.com/rescript-lang/rescript-compiler/issues/5638
- Fix issue where pipe
->processing eats up attributes https://github.com/rescript-lang/rescript-compiler/pull/5581 - Fix issue where cancelling
rescript buildwould leave the.bsb.lockfile behind and block future builds
- Print patterns in warnings using rescript printer https://github.com/rescript-lang/rescript-compiler/pull/5492
- Fix issue where watch mode would give an error on Windows https://github.com/rescript-lang/rescript-compiler/pull/5621
Compiler
bsconfig.jsondoes not support// linecomments 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 https://github.com/rescript-lang/rescript-compiler/pull/5364)
- Classify bigint correctly #5351
- Fixed crash in
rescript buildon Windows #5516 - Fixed
rescript initcommand 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.pipeis 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
@valannotations 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 https://github.com/rescript-lang/syntax/pull/597 https://github.com/rescript-lang/syntax/pull/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@foois allowed, or a syntax error is given. Similarly for module-level/*** comments */that can go where@@attributesgo.
- 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-relay0.23.0 is not supported. - Fix: use
rescript-relay@betaor 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_stringhttps://github.com/rescript-lang/rescript-compiler/issues/5573 https://github.com/rescript-lang/rescript-compiler/pull/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.mlas the rescript-lang.org playground bundle entrypoint
- Removed Reason syntax support for the playground experience. See https://github.com/rescript-lang/rescript-compiler/pull/5375
You can find more old changelog from docs/changelog