Back to Coffeescript

2.5.0

documentation/sections/changelog/2.5.0.md

2.7.02.1 KB
Original Source
releaseHeader('2019-12-31', '2.5.0', '2.4.1')
  • The compiler now supports a new ast option, available via --ast on the command line or ast via the Node API. This option outputs an “abstract syntax tree,” or a JSON-like representation of the input CoffeeScript source code. This AST follows Babel’s spec as closely as possible, for compatibility with tools that work with JavaScript source code. Two tools that use this new AST output are eslint-plugin-coffee, a plugin to lint CoffeeScript via ESLint; and prettier-plugin-coffeescript, a plugin to reformat CoffeeScript source code via Prettier. The structure and properties of CoffeeScript’s AST are not final and may undergo breaking changes between CoffeeScript versions; please open an issue if you are interested in creating new integrations.
  • Numeric separators are now supported in CoffeeScript, following the same syntax as JavaScript: 1_234_567.
  • BigInt numbers are now supported in CoffeeScript, following the same syntax as JavaScript: 42n.
  • ''' and """ strings are now output as more readable JavaScript template literals, or backtick (`) strings, with actual newlines rather than \n escape sequences.
  • Classes can now contain computed properties, e.g. [someVar]: -> or @[anotherVar]: ->.
  • JSX tags can now contain XML-style namespaces, e.g. <image xlink:href="data:image/png" /> or <Something:Tag></Something:Tag>.
  • Bugfixes for comments after colons not appearing the output; reserved words mistakenly being disallowed as JSX attributes; indented leading elisions in multiline arrays; and invalid location data in source maps.