Changelog: swc v1.2.41

Bugfixes#

Codegen of string literals (#1287)#

The code generator of swc tries to preserve the original input, and it resulted in some bugs. It's now fixed by a huge breaking change - storing quote info in the string literal.

Note that this patch is also included in the new version of deno, which is also published today.

Normalization of \r\n in template literals (#1286)#

Thanks to @Liamolucko, swc now follows spec more closely.

\r\n in template literals are now normlized as \n.

Span of decalred items (#1282)#

Now span of various declared nodes like class declarations or function declarations include span of declare token. Due to how codegen determine codegen print comments, I expect this fix to make codegen print comments correctly.

No hang on invalid character (#1274)#

Previously, the lexer of swc hangs on invalid input. This was because it did not update the position of the character in case of error. The fix was trivial, but it's important for some environments like deno shell, which gets input from stdin.

Parse ?? correctly (#1270)#

Some tokens were not parsed correctly on ecmascript mode.

New package#

I wish this was a package about TypeScript type checkers, but I am still working hard on it still working hard. Instead, we introduce a package that allows swc to run on the web.

@swc/wasm-web is a new package which can be used for the web.