Skip to content

Releases: rescript-lang/rescript-compiler

11.0.0

11 Jan 20:55
1bb386d
Compare
Choose a tag to compare

ReScript's second major community-driven release is out and comes packed with new features and improvements! πŸŽ‰

πŸš€ Highlights

πŸ“‹ More Information

11.0.0-rc.9

09 Jan 17:20
bc22eb9
Compare
Choose a tag to compare
11.0.0-rc.9 Pre-release
Pre-release

πŸš€ 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

19 Dec 12:58
Compare
Choose a tag to compare
11.0.0-rc.8 Pre-release
Pre-release

πŸš€ 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

07 Dec 08:32
9711589
Compare
Choose a tag to compare
11.0.0-rc.7 Pre-release
Pre-release

πŸš€ 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

22 Nov 15:54
31ac6ab
Compare
Choose a tag to compare
11.0.0-rc.6 Pre-release
Pre-release

πŸš€ 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

31 Oct 14:56
16c6f0e
Compare
Choose a tag to compare
11.0.0-rc.5 Pre-release
Pre-release

πŸš€ 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

10 Oct 10:04
776e24d
Compare
Choose a tag to compare
11.0.0-rc.4 Pre-release
Pre-release

πŸš€ 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

05 Sep 18:28
f928653
Compare
Choose a tag to compare
11.0.0-rc.3 Pre-release
Pre-release

πŸ› 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

28 Aug 19:04
2b2c90d
Compare
Choose a tag to compare
11.0.0-rc.2 Pre-release
Pre-release

πŸš€ 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

16 Aug 14:50
a921557
Compare
Choose a tag to compare
11.0.0-rc.1 Pre-release
Pre-release

πŸš€ 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