current position:Home>Coffeescript 2.7.0 release, JavaScript translation language

Coffeescript 2.7.0 release, JavaScript translation language

2022-04-29 06:08:17Open source China Information

CoffeeScript 2.7.0 Released .CoffeeScript  It's a set  JavaScript  Translation language , It will be similar Ruby The syntax code is compiled into JavaScript, And most of the structures are similar .CoffeeScript Have more strict grammar .

This update includes :

  • Now supports Import assertion Syntax . This allows the image export { version } from './package.json' assert { type: 'json' }  Such statements or statements like import('./calendar.json', { assert { type: 'json' } }) Such an expression .
  • CoffeeScript No longer always mending Node Error stack trace . This patch adjusts the row and column numbers to match the source CoffeeScript Generated instead of JavaScript, This can lead to conflicts with other libraries , And passing Node The new --enable-source-mapsflag  Time is unnecessary . Now? , Only when not set --enable-source-maps、 No other libraries have patched stack traces and used  require('coffeescript/register') It will be repaired when . Can pass require('coffeescript').patchStackTrace() or import { patchStackTrace } from 'coffeescript'; patchStackTrace() Explicitly enable the patch .
  • Repair the block (triple-quoted) strings Not correctly converted to JSX expression container wrapping the template literal The problem of ( Such as <div a={`...`} />).
  • Fixed for explicit [array or {object literal Non empty first line of , The behavior of the continuation does not meet the expected problem .

Details can be found at  changelog.

copyright notice
author[Open source China Information],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/116/202204261009092338.html

Random recommended