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.
\r\n in template literals are now normlized as
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.
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.
Some tokens were not parsed correctly on ecmascript mode.
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.