Changelog: swc v1.2.37
#
Bugfixes#1191)#
ascii-only output (Previously [swc] emitted utf-8 output and had some bug related to escape, but[swc] now emits only ascii characters.
#1170)#
error instead of panic (Previously [swc] panicked if the parse
is called with the code below.
This behavior is wrong and [swc] now emits error instead of panicking.
#1185)#
codegen bug of if (Previously [swc] emitted a wrong output for the code below.
Thanks to @braddunbar, it's now fixed and the generated code works as expected.
#1183)#
typeof helper issue (typeof
helper had a bug which occurs in a runtime without Symbol
. It's fixed by @wessberg.
#1175)#
invalid escapes in template literals (According to es2018
specification, the code below is valid.
But previously, [swc] could not parse it. This is now fixed by @braddunbar.
#1189)#
error recoveries (The parser of [swc] can now recover from strict-mode violations.
It means, even if your file has some errors, you can still get ast although it's not valid. As one purpose of [swc] is being a basic building block, this is big win.
#1157)#
dce bug (The dead code elimination pass had a bug related to class properties, and it's now fixed.
Now code like below works well after optimizing.
#1144)#
hygiene bug ([swc] had a bug which makes default value in object patterns miscompiled. This is now fixed.
#
BundlerStarting from [deno]@1.5, there's an option --no-check
in options of deno bundle
.
It uses swc_bundler
, which is a general implementation of a web asset bundler.
While integrating, the [deno] team reported many bugs and those are all fixed.
#1152)#
import and export from a module (Previously the bundler failed to process code below.
This is because there was no logic to handle exports and imports from a module. This is fixed by adding such logic.
#1159)#
computed access to namespace imports (This made https://deno.land/x/[email protected]/examples/server.ts work after bundling.
#1166)#
determinisctic output (For reliability, I made the output of swc_bundler
deterministic.
#1171)#
pass ordering (The pass ordering was wrong, and resulted in a bug, which prevents https://deno.land/x/[email protected]/examples/sseServer.ts from working after bundling.
#1154)#
export * (The bundler of [swc] had a bug related to export *
where a function or a class is exported. This is fixed by applying same rule as variable exports.
#1186)#
codegen of single arg arrow functions (Thanks to @braddunbar, [swc] now prints arrow function with single arguement properly.
#
TypeScript 4.1#1151)#
as in mapped type (Thanks to @g-plane, the code below now works.
#1190)#
template literal type (Thanks to @g-plane, the code below now works.
#1193)#
intrinsic type (Thanks to @g-plane, the code below now works.