Jul 17, 2020

BuckleScript 8.1.1 released

New Syntax Tweaks, Formatter and Converter

Cheng Lou
Syntax & Tools

Important: This is an archived blog post, kept for historical reasons. Please note that this information might be outdated.

New Release

We are happy to announce BuckleScript 8.1.1, which features syntax tweaks to the newly released syntax and also adds new capabilities for converting and formatting your code via the bsc command.

There are no breaking changes. You can install it with npm install bs-platform@8.1.1.

Newest Syntax Tweaks

Based on the feedback thread from our previous new BuckleScript syntax announcement, we've made some tweaks:

  • list[1, 2, 3] is now list{1, 2, 3}.

  • `hello 👋 ${message}` quoted string now supports proper unicode and type-safe interpolation.

Small changes, big difference. This release also marks our syntax's feature freeze for existing features: updates to the syntax in the near to medium term only be additive or contain bug fixes, no breaking changes.

A New Converter and Formatter Flag for bsc

We added a new experimental flag -fmt, which allows you to format any .res/.resi file, or convert any .re/.rei/.ml/.mli file to the new syntax.

Usage: bsc -fmt MyFile.res will print out the pretty printed content of MyFile.res to stdout.

To convert any Reason or OCaml file, just pipe the output to a new res file: node_modules/.bin/bsc -fmt src/Button.re > src/Button.res

Please note that this CLI flag is still experimental until we settle on the final API (e.g. we want to add support for passing additional parameters to the formatter, such as accepting stdin).

We are happy for feedback! Make sure to use this forum post for general discussions, or the new syntax issue trackers for bug reports.

Enjoy!

Want to read more?
Back to Overview