Skip to content

Releases: rescript-lang/rescript

11.0.0-beta.1

22 May 15:32
Compare
Choose a tag to compare
11.0.0-beta.1 Pre-release
Pre-release

🚀 Main New Feature

  • Make uncurried mode opt-out: by default, every project is now in uncurried mode, unless "uncurried": false is specified in the project config. #6249

💅 Polish

  • Removed duplicate Super_error implementation in syntax. #6246

🐛 Bug Fix

  • Fix issue with inlining records in the presence of record coercion. #6256

11.0.0-alpha.6

05 May 15:07
384a592
Compare
Choose a tag to compare
11.0.0-alpha.6 Pre-release
Pre-release

💥 Breaking Change

  • -bs-super-errors flag 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

🐛 Bug Fix

  • 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

💅 Polish

  • 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.null and Js.nullable are now untagged variants representing their runtime values, instead of abstract types. #6218

11.0.0-alpha.5

27 Apr 18:35
f2d5c80
Compare
Choose a tag to compare
11.0.0-alpha.5 Pre-release
Pre-release

🚀 Main New Feature

  • Add support for Dynamic import. #5703
  • GenType: Add moduleResolution option to customize extensions on emitted import statements. This helps to adjust output compatibility with TypeScript projects using ESM. #6182
    • node (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

💥 Breaking Change

  • Parse assert as a regular function. assert is no longer a unary expression. Example: before assert 1 == 2 is parsed as (assert 1) == 2, now it is parsed as assert(1 == 2). #6180

🐛 Bug Fix

  • 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

11.0.0-alpha.4

19 Apr 15:01
7cd303e
Compare
Choose a tag to compare
11.0.0-alpha.4 Pre-release
Pre-release

🚀 Main New Feature

  • Add surface syntax for partial application of uncurried functions: foo(1, ...). This corresponds to curried application in the old mode. #6166

🐛 Bug Fix

  • 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 @inline attibute 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

💅 Polish

  • Update list of reserved JS keywords. #6167
  • Add error message to @@directive. #6174

11.0.0-alpha.3

14 Apr 07:12
a6090a5
Compare
Choose a tag to compare
11.0.0-alpha.3 Pre-release
Pre-release

🚀 Main New Feature

  • Add support for extensible records (e.g. type t = {...t1, x:int, ...t2}) #5715

🐛 Bug Fix

  • Fix formatting and parentheses placement in uncurried functions with constraints. #6143

11.0.0-alpha.2

12 Apr 12:47
c521f17
Compare
Choose a tag to compare
11.0.0-alpha.2 Pre-release
Pre-release

🐛 Bug Fix

  • Special case generation of uncurried functions with 1 argument of unit type so they don't take a parameter. #6131

🚀 Main New Features

  • Add support for type coercion :> for records. #5721

11.0.0-alpha.1

11 Apr 11:28
f2f435e
Compare
Choose a tag to compare
11.0.0-alpha.1 Pre-release
Pre-release

🚀 Main New Features

  • Introduce experimental uncurried mode. For experimentation only. PR #5796
  • Customization of runtime representation of variants and introduction of untagged variants PR #6095, PR #6103

🚀 New Feature

  • 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 in bsconfig.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.
    The make function 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 @genType annotation at the module level, meaning that all the items in the module should be exported. #6113
  • GenType: add support for @genType annotations 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

💥 Breaking Change

  • 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 to Math.pow(2, Math.pow(3, 2)) and not anymore Math.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.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. #6099 #6101

🐛 Bug Fix

  • 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 async and 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 #6028
  • Make internal encoding of locations aware of unicode #6073
  • Fix issue where foo(x,_) in uncurried mode would generate a curried function #6082
  • Fix printing of uncurried application when the lhs is a function definition #6084
  • Fix parsing uncurried type starting with path #6089
  • Fix bigInt comparison #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: #6100
  • Fix issue with GenType and module aliases #6112

💅 Polish

  • Syntax: process uncurried types explicitly in the parser/printer #5784 #5822
  • Syntax: process uncurried function declarations explicitly in the parser/printer #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) #5841
  • Remove class type processing from compiler ppx #5842
  • Remove method application via operator ##, which does not exist in .res syntax #5844
  • Treat @meth annotation as making the type uncurried for backwards compatibitly with some examples #5845
  • Process @set annotation for field update as generating an uncurried function #5846
  • Treat uncurried application of primitives like curried application, which produces better output #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 #5870
  • PPX V3: allow uncurried make function and treat it like a curried one https://github.co...
Read more

10.1.4

28 Mar 09:22
Compare
Choose a tag to compare

🐛 Bug Fix

  • Fix implementation of directives #6052
  • Fix issue if the lib dir is included in the sources of bsconfig.json #6055
  • Fix issue with string escape in pattern match #6062
  • Fix issue with literal comparison of string constants #6065

🚀 New Feature

  • Add support for toplevel await #6054

💅 Polish

  • Better error message for extension point #6057
  • Improve format check help #6056
  • Deprecate unsafe j`$(a)$(b)` interpolation: use string templates `${a}${b}` instead #6067

10.1.3

07 Mar 07:23
Compare
Choose a tag to compare

🚀 New Feature

  • Add experimental suppport for directives. An annotation such as @@directive("use client;") emits use client; verbatim before imports #5999
  • genType: add Core 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<_> #6024

💥 Breaking Change

  • genType: streamline the treatment of optionals as undefined #6024
    • Represent option<t> as undefined | t instead of null | 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: use Js.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}.

💅 Polish

  • Add the gap property to jsxDOMStyle #5956

🐛 Bug Fix

  • 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 #5984
  • Fix issue with printing async functions with locally abstract types rescript-lang/syntax#732
  • Fix issue with async context and locally abstract types #5985
  • Fix support for recursive components in JSX V4 rescript-lang/syntax#733
  • GenType: fix issue with V3 compatibility mode (see #5990) #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 where then and catch were returning undefined #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 #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 #6014
  • Fix formatting of switch expressions that contain braced cases 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 #6021
  • In GenType, check annotations also in module types to decide whether to produce the .gen.tsx file #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 type float #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

10.1.2

29 Jan 20:25
13b9572
Compare
Choose a tag to compare

🐛 Bug Fix

  • Fix an issue where error messages related to duplicate props were displayed without a loc and were unclear rescript-lang/syntax#728