Skip to content

Latest commit

 

History

History
1362 lines (945 loc) · 93.8 KB

File metadata and controls

1362 lines (945 loc) · 93.8 KB

Changelog

Tags:

  • 💥 [Breaking Change]
  • 👓 [Spec Compliance]
  • 🚀 [New Feature]
  • 🐛 [Bug Fix]
  • 📝 [Documentation]
  • 🏠 [Internal]
  • 💅 [Polish]

12.0.0-alpha.13 (Unreleased)

💥 Breaking Change

  • Rename JsError to JsExn and error modules cleanup. #7408
  • Make BigInt.fromFloat return an option rather than throwing an error in case it's passed a value with a decimal value. #7419

🚀 New Feature

  • Add shift (<<, >>, >>>) operators for int and bigint. #7183
  • Add bitwise AND (&) operator for int and bigint. #7415
  • Add bitwise NOT (~) operator for int and bigint. #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

🐛 Bug fix

  • Fix broken bstracing CLI location. #7398
  • Fix field flattening optimization to avoid creating unnecessary copies of allocating constants. #7421
  • Fix leading comments removed when braces inside JSX contains let assignment. #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

🏠 Internal

  • AST: Add bar location to case. #7407

💅 Polish

  • Make Jsx.element a private empty record to avoid unnecessary Primitive_option.some. #7450

12.0.0-alpha.12

🐛 Bug fix

  • Fix node.js ExperimentalWarning. #7379
  • Fix issue with gentype and stdlib json. #7378
  • Fix type of RegExp.Result.matches. #7393
  • Add optional flags argument to RegExp.fromString and deprecate RegExp.fromStringWithFlags. #7393

🏠 Internal

  • Better representation of JSX in AST. #7286
  • Clean up default warnings. #7413

💅 Polish

  • 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 Lazy module to Stdlib. #7399

12.0.0-alpha.11

🐛 Bug fix

  • Fix Error.fromException. #7364
  • Fix signature of throw. #7365
  • Fix formatter adds superfluous parens in pipe chain. #7370

🏠 Internal

  • Remove Stdlib_Char module 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 in operator. #7342
  • AST cleanup: add Pexp_await ast node instead of res.await attribute. (The attribute is still used for await on modules currently). #7368

💅 Polish

  • More deprecations in Pervasives; add Stdlib.Pair and Stdlib.Int.Ref. #7371

12.0.0-alpha.10

🚀 New Feature

  • Add Dict.has and double Dict.forEachWithKey/Dict.mapValues performance. #7316
  • Add popover attributes to JsxDOM.domProps. #7317
  • Add Array.removeInPlace helper based on splice. #7321
  • Add inert attribute to JsxDOM.domProps. #7326
  • Make reanalyze exception tracking work with the new stdlib. #7328
  • Fix Pervasive.max using 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 raise to throw to align with JavaScript vocabulary. raise has been deprecated. #7346
  • Add unified bitwise (^) operator. #7216
  • Stdlib: rename binary operations to match JavaScript terms. #7353

💥 Breaking Change

  • Replace ~date with ~day in Date.make. #7324
  • Remove -bs-jsx-mode. #7327
  • Drop Node.js version <20 support, as it is reaching End-of-Life. #7354
  • Treat int multiplication as a normal int32 operation instead of using Math.imul. #7358

🏠 Internal

  • Clean up legacy tags handling. #7309
  • Use Yarn (Berry) workspaces for internal tooling. #7309

💅 Polish

  • 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
  • rescript package does not trigger postinstall script anymore. #7350
  • Add Stdlib Bool and Char modules and improve Pervasives deprecation messages. #7361

🐛 Bug fix

  • 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

12.0.0-alpha.9

💥 Breaking Change

💅 Polish

  • 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 t to Stdlib modules. #7302
  • Gentype: handle null/nullable/undefined from Stdlib. #7132

🐛 Bug fix

  • Fix async context checking for module await. #7271
  • Fix %external extension. #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.componentWithProps no longer works with @directive("'use memo'"). #7300

🏠 Internal

  • Remove ignore in res_scanner.ml. #7280
  • Use the new stdlib modules in the analysis tests. #7295
  • Build with OCaml 5.3.0. #7294
  • Simplify JSON.Decode implementation. #7304

12.0.0-alpha.8

🐛 Bug fix

  • Editor: Fix issue where pipe completions would not trigger with generic type arguments. #7231
  • Fix leftover assert false in code for null != 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.component and @directive. #7260
  • Fix issue where attributes on an application were not preserved by the AST conversion for ppx. #7262

🏠 Internal

  • AST cleanup: Prepare for ast async cleanup: Refactor code for @res.async payload 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.async attribute 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_instvar from AST. #7239
  • AST cleanup: Remove @res.partial attribute 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_type from 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.namedArgLoc attribute and store the location information directly into the label. #7247

💅 Polish

12.0.0-alpha.7

🐛 Bug fix

  • Editor: Fix issue where completions would stop working in some scenarios with inline records. #7227

💅 Polish

  • Add all standard CSS properties to JsxDOMStyle. #7205

🏠 Internal

  • 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

12.0.0-alpha.6

🚀 New Feature

  • Add Option.all & Result.all helpers. #7181
  • Add @react.componentWithProps for React component functions taking a props record instead of labeled arguments. #7203

🐛 Bug fix

  • 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

🏠 Internal

  • 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

12.0.0-alpha.5

🚀 New Feature

  • Introduce "Unified operators" for arithmetic operators (+, -, *, /, mod). #7057
  • Add remainder (%, aka modulus) operator. #7152

🐛 Bug fix

  • Fix and clean up boolean and/or optimizations. #7134 #7151
  • Fix identifiers with name arguments and eval to be mangled. #7163

💅 Polish

  • 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 == null checks 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

🏠 Internal

  • Move rescript-editor-analysis and rescript-tools into compiler repo. #7000

12.0.0-alpha.4

💥 Breaking Change

  • OCaml compatibility in the stdlib and primitives are dropped/deprecated. #6984
  • Remove JSX v3. #7072
  • Remove js_cast.res. #7075

🚀 New Feature

  • 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 rescript npm package. #7108 #7116
  • Handle absolute filepaths in gentype. #7104

🐛 Bug fix

  • 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

💅 Polish

  • Add some context to error message for unused variables. #7050
  • Improve error message when passing children prop 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 @variadic bindings. #7030
  • Improve error messages around JSX components. #7038
  • Improve output of record copying. #7043
  • Provide additional context in error message when unit is expected. #7045
  • Improve error message when passing an object where a record is expected. #7101

🏠 Internal

  • 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_tests on Windows. #7065
  • Rename folder "jscomp" to "compiler". #7086
  • Disable -bs-cross-module-opt for tests. #7071
  • Move ounit_tests into the tests folder. #7096
  • Move syntax_tests into the tests folder. #7090 #7097
  • Capitalize runtime filenames. #7110
  • Build mocha tests as esmodule / .mjs. #7115
  • Use dict instead of Dict.t everywhere. #7136

12.0.0-alpha.3

🐛 Bug fix

  • Revert "Throws an instance of JavaScript's new Error() and adds the extension payload for cause option" (#6611). #7016
  • Fix dict literals error. #7019

12.0.0-alpha.2

🚀 New Feature

  • 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

🐛 Bug Fix

  • 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 @as attribute and _ placholder (fixed argument). #6970
  • Disallow spreading anything but regular variants inside of other variants. #6980
  • Fix comment removed when function signature has type keyword. #6997
  • Fix parse error on doc comment before "and" in type def. #7001

🏠 Internal

  • Add dev container. #6962
  • Convert more tests to the node test runner. #6956
  • Remove attribute "internal.arity". #7004
  • Remove dead modules. #7008

💅 Polish

  • 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 case bodies
    • Fixed tabulation for throw new Error bodies
    • Removed empty line at the end of switch statement
    • Removed empty default case from switch statement in the generated code
  • Optimised the Type Extension runtime code and removed trailing /1 from RE_EXN_ID. #6958
  • Compact output for anonymous functions. #6945 #7013
  • Rewatch 1.0.9. #7010

12.0.0-alpha.1

🚀 New Feature

  • Allow @directive on functions for emitting function level directive code (let serverAction = @directive("'use server'") (~name) => {...}). #6756
  • Add rewatch to the npm package as an alternative build tool. #6762
  • Throws an instance of JavaScript's new Error() and adds the extension payload for cause option. #6611
  • Allow free vars in types for type coercion e :> t. #6828
  • Allow private in 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.globalThis object binding. #6909

💥 Breaking Change

  • Make j and js allowed names for tag functions. #6817
  • lazy syntax is no longer supported. If you're using it, use Lazy module or React.lazy_ instead. #6342
  • Remove handling of attributes with bs. prefix (@bs.as -> @as etc.). #6643
  • Remove obsolete @bs.open feature. #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 .ml to .res via format. #6848
  • Remove support for compiling .ml files, and general cleanup. #6852
  • Remove rescript convert subcommand. #6860
  • Remove support for @bs.send.pipe. This also removes all functions in Js_typed_array that rely on @bs.send.pipe. #6858 #6891
  • Remove deprecated Js.Vector and Js.List. #6900
  • Remove support for %time extension. #6924
  • Remove caml_external_polyfill module and the related behavior. #6925

🐛 Bug Fix

  • 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 uses Curry at runtime. #6872
  • Avoid generation of Curry with reverse application |>. #6876
  • Fix issue where the internal ppx for pipe -> would not use uncurried application in uncurried mode. #6878

🏠 Internal

  • Build with OCaml 5.2.0. #6797
  • Convert OCaml codebase to snake case style. #6702
  • Fix -nostdlib internal 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 :> t2 was only supported in .ml syntax and never by the .res parser. #6829
  • Convert caml_format and js_math to .res. #6834
  • Convert js.ml files to .res. #6835
  • Remove old .ml tests. #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 -uncurried command-line flag. #6885
  • Cleanup: remove tracking of uncurried state in parser/printer. #6888
  • Remove %opaque primitive. #6892
  • Reunify JsxC/JsxU -> Jsx etc. #6895
  • Remove the transformation of foo(1,2) into Js.Internal.opaqueFullApply(Internal.opaque(f), 1, 2), and change the back-end to treat all applications as uncurried. #6893
  • Remove @uncurry from ReScript sources (others, tests). #6938
  • Remove leftover uncurried handling. #6939 #6940
  • Start converting tests from mocha to the node test runner. #6956

💅 Polish

  • Make the --help arg 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 let instead of var. #6102
  • Turn off transformation for closures inside loops when capturing loop variables, now that let is emitted instead of var. #6480
  • Improve unused attribute warning message. #6787
  • Remove internal option use-stdlib from build schema. #6778
  • Fix Js.Types.JSBigInt payload to use native bigint type. #6911
  • Deprecate %external extension, which has never been officially introduced. #6906
  • Deprecate xxxU functions in Belt. #6941
  • Improve error messages for function arity errors. #6990
  • Add missing HTML attribute capture to JsxDOM.res. #7006

11.1.3

🐛 Bug Fix

  • 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 @uncurry attribute in uncurried mode, to avoid generating calls to Curry at 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 _param in recursive functions with unit argument. #6907

11.1.3-rc.1

🐛 Bug Fix

  • Omit standard library dir from load path if -nostdlib is set. #6833

11.1.2

🐛 Bug Fix

  • Fix issue where capitalised type variables were only allowed in certain positions. #6820

11.1.2-rc.1

🚀 New Feature

  • Support Windows 11 ARM (using the x64 binaries in emulation). #6813

🐛 Bug Fix

  • Fix location of let bindings with attributes. #6791
  • PPX v4: mark props type in externals as @live to 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.element surfaces 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

11.1.1

🐛 Bug Fix

  • 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

11.1.0

🐛 Bug Fix

  • Revert escape JSX prop names with hyphens (#6705). #6731

11.1.0-rc.8

🚀 New Feature

  • Add %todo extension for leaving implementation for later. #6713
  • Add -warn-error argument for generating errors in CI. Useful for %todo extension. #6717

🐛 Bug Fix

  • 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 @send and @new. #6716
  • Fix JSX4 adding the incorrect type annotation for the prop ref in React.forwardRef component. #6718
  • Fix description for warning number 110. #6725

💅 Polish

  • Module spec es6 and es6-global is deprecated in favor of esmodule. #6709

11.1.0-rc.7

🐛 Bug Fix

  • Fix variance setting for builtin dict type. Fixes issues around inference. #6707

11.1.0-rc.6

🚀 New Feature

🐛 Bug Fix

  • Fix mishandling of uncurried functions in super errors. #6694

11.1.0-rc.5

🐛 Bug Fix

  • Fix misparsing in/after JSX. #6686
  • Fix @deriving(accessors) outputting curried functions in uncurried mode. #6687

11.1.0-rc.4

🐛 Bug Fix

  • 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

:nail-care: Polish

  • Omit undefined in external function calls for trailing optional arguments when not supplied. #6653
  • Make pattern match suggestions to be easier to copy-paste. #6656

11.1.0-rc.3

💅 Polish

  • No parens around tagged template literals. #6639
  • Allow identifier with modules in tagged template literals (e.g. Pg.sqlselect * from ${table} where id = ${id}). #6645

🐛 Bug Fix

  • Fix compiler crash when reexporting tagged template literal externals. #6645

11.1.0-rc.2

🚀 New Feature

🐛 Bug Fix

  • Fix issue with async and newtype in uncurried mode. #6601
  • Generic JSX transform: Rename expected module name for lowercase JSX to Elements from DOM. #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

🏠 Internal

  • Use OCaml 4.14.1 (+ Alpine 3.19 container) for CI build. #6600

11.1.0-rc.1

🚀 New Feature

  • Experimental support of tagged template literals, e.g. sql`select * from ${table}`. #6250
  • Experimental support for generic/custom JSX transforms. #6565
  • dict is now a builtin type. #6590

🐛 Bug Fix

  • GenType: distinguish inline records from unary variant cases of object type. #6586

11.0.1

🐛 Bug Fix

  • Renamed inline record fields: fix renamed field access in inline records. #6551
  • Fixed issue with coercions sometimes raising a Not_found instead of giving a proper error message. #6574
  • Fix issue with recursive modules and uncurried. #6575

💅 Polish

  • Improve error message for missing label(s) in function application. #6576

11.0.0

No changes compared to rc.9.

11.0.0-rc.9

🚀 New Feature

  • 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

🐛 Bug Fix

  • GenType: now emits full suffix on JS import path to be compatible with .res.js. #6541

💅 Polish

  • Format docstrings. #6417
  • JSX v4: make automatic mode the default. #6552

11.0.0-rc.8

🚀 New Feature

  • Add support for type coercion for invariant type arguments such as array payloads. #6518
  • Start treating rescript command the same as the rescript build command, so now you can do rescript -w. #6524

🐛 Bug Fix

  • Fix accidental removal of Belt.Result.Ok and Belt.Result.Error constructors 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 @as in labels in uncurried externals, which was broken. #6527

💅 Polish

  • GenType: make outputs DCE-friendly. #6508

11.0.0-rc.7

🚀 New Feature

  • Allow empty inline records in variants. #6494
  • Allow empty record patterns in pattern matching. #6494

🐛 Bug Fix

  • 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

11.0.0-rc.6

🚀 New Feature

  • Freely configurable suffix for generated .js files. #6472

🐛 Bug Fix

  • Fix issue with GenType and result introduced 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

💅 Polish

  • Improve some error messages in rescript.conf parsing. #6469

11.0.0-rc.5

🚀 New Feature

  • 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 int to float. #6448

🐛 Bug Fix

  • Fix issue with dynamic import of module in nested expressions. #6431
  • Fix issue where GenType was not supporting @tag on 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 await fails to compile (all locations would point to the internal function unsafe_await). #6452
  • Fix renaming fields (with @as) in inline records doesn't work when destructuring. #6456
  • Fix rc.4 regressions:
    • Don't show compilation time when calling rescript build -help command. #6439
    • Running rescript build -w with a compilation error doesn't exit with an error code and continues waiting for changes. #6460

🏠 Internal

  • Remove dependency stdlib-406 -> belt. #6453
  • Playground: Add support for implicitly opened modules. #6446

💅 Polish

  • Add Deno to reserved names, so that modules named Deno don't clash with the globally exposed Deno object. #6428
  • Disable ESLint/TSLint on gentype outputs properly. #6442
  • Improve rescript CLI to use stdout/stderr appropriately for help command's message. #6439
  • Generate f() instead of f(undefined) for f(). #6459

11.0.0-rc.4

🚀 New Feature

  • 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. #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.json configuration file and deprecate bsconfig.json. #6382

💥 Breaking Change

  • 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. #6420
  • Add smart printer for pipe chains. #6411 (the formatter will reformat existing code in certain cases)
  • Js.Json.t now uses Boolean(bool) instead of explicit @as(true) True | @as(false) False. #6421

🐛 Bug Fix

  • 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

💅 Polish

  • 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 build command. #6404
  • Improve help message for build and clean commands. #6404
  • Pass through the -verbose flag 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

11.0.0-rc.3

🐛 Bug Fix

  • Fix issue with JSX V4 when component props have the default value with same name. #6377
  • Fixed code formatter with "uncurried": false in bsconfig. #6378

💅 Polish

  • Add Bun to reserved names, so that modules named Bun don't clash with the globally exposed Bun object. #6381

11.0.0-rc.2

🚀 New Feature

  • rescript build will always build its dependency by default. The argument -with-deps is not needed anymore. #6350

💥 Breaking Change

  • 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

🐛 Bug Fix

  • Fixed outcome printer resolution of uncurried config. #6353

11.0.0-rc.1

🚀 New Feature

  • GenType: Propagate comments from record fields to emitted TypeScript types. #6333

💥 Breaking Change

  • $$default is no longer exported from the generated JavaScript when using default exports. #6328

💅 Polish

  • 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

11.0.0-beta.4

🚀 New Feature

  • 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

💥 Breaking Change

  • 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

🐛 Bug Fix

  • Fixed outcome printing of uncurried higher order function types. #6323
  • Fixed printing of type constraints in template literal substitutions. #6324

11.0.0-beta.3

🚀 New Feature

  • 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

🐛 Bug Fix

  • Fix issue with dynamic import of modules in expressions. #6310

11.0.0-beta.2

🚀 New Feature

  • 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. #6251
  • Extended untagged variants with function types. #6279

💥 Breaking Change

  • Remove rudimentary node bindings and undocumented %node extension. #6285

🐛 Bug Fix

  • 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

11.0.0-beta.1

🚀 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

💥 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

🚀 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

🚀 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

🚀 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

🚀 Main New Feature

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

🐛 Bug Fix

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

11.0.0-alpha.1

🚀 Main New Feature

  • 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

💅 Polish

10.1.4

🐛 Bug Fix

🚀 New Feature

💅 Polish

10.1.3

🚀 New Feature

💥 Breaking Change

  • genType: streamline the treatment of optionals as undefined https://github.com/rescript-lang/rescript-compiler/pull/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

🐛 Bug Fix

10.1.2

🐛 Bug Fix

10.1.1

💥 Breaking Change

  • 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 @as instead

🚀 New Feature

🐛 Bug Fix

10.1.0

🐛 Bug Fix

10.1.0-rc.5

🐛 Bug Fix

10.1.0-rc.4

🚀 New Feature

🐛 Bug Fix

10.1.0-rc.3

🚀 New Feature

🐛 Bug Fix

💅 Polish

10.1.0-rc.2

🐛 Bug Fix

10.1.0-rc.1

💥 Breaking Change

🚀 New Feature

🐛 Bug Fix

👓 Spec Compliance

  • Functions with consecutive dots now print as multiple arrow functions like in JavaScript.

💅 Polish

  • Add loading, aria-* DOM element attributes in JsxDOM.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 JsxPPXReactSupport module to relocate the helper functions for JSX v4 from rescript-react

10.1.0-alpha.2

🚀 New Feature

🐛 Bug Fix

💅 Polish

10.1.0-alpha.1

💥 Breaking Change

  • Pipe -> does not support a code block on the right-hand side e.g. x->{ open A; get("test") }

🚀 New Feature

🐛 Bug Fix

💅 Polish

10.0.1

🐛 Bug Fix

10.0.0

Compiler

💥 Breaking Change

  • bsconfig.json does not support // line comments anymore.
    • Example: "suffix": ".bs.js" // determine the suffix
    • Fix: remove the comment and use standard json.
  • Changed return type of Js.String.match_ as it was wrong. #5070
    • Example: any use of Js.String.match_ and Js.String2.match_
    • Fix: follow the type errors
  • 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 Feature

🐛 Bug Fix

  • 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
💅 Polish
  • 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

💥 Breaking Change

  • @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
  • 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.
  • 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.
  • 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"

🚀 New Feature

  • 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.

🐛 Bug Fix

  • 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

💥 Breaking Change

🐛 Bug Fix

💅 Polish

  • Several Belt / Js libraries are now converted to ReScript syntax, with corresponding comments in Markdown format suitable for hovering. See #5361.

Playground

🏠 Internal

  • Added jsoo_playground_main.ml as the rescript-lang.org playground bundle entrypoint

💥 Breaking Change


You can find more old changelog from docs/changelog