Changelog: swc v1.2.40
#
Bugfixesdesign;type
for typescript enums (#1248)#
Decorator metadata can be used to create very convenient tools. swc now supports it more correctly.
For example, the code below works with swc@1.2.40+
.
#1228)#
regenerator: ternary with await (Previously, swc miscompiled the code below because regenerator
had a bug.
I tried hard to mimic its logic as much as possible, but original codebase depends on dynamic nature of javascript and requires shared &mut
, so logic differs even if it's a port.
Anyway, the code above works properly with swc@1.2.40
.
#1234)#
bundler: Circular imports in wrapped module (Previously the swc-based bundlers (deno bundle
and spack
) had a bug which occurs
- Module
path
is loaded as a wrapped module. https://deno.land/[email protected]/path/mod.ts
has circular imports internally.
This is now fixed and such code works well.
#1234)#
bundler: export * as alias (I got the bug report from deno issue tracker, and fixed it by preserving export info.
See: https://github.com/denoland/deno/issues/8481
#1234)#
bundler: fix deglobbing logic (Previously, deglobbing logic was to aggressive so that it replaces log.handlers.FileHandler
into FileHandler
.
It was because previous logic only checked the originating module. This is fixed by comparing symbols.
#1242)#
codegen: unicode escape sequnces (There was a bug which ignores the value part in unicode escapes while printing result code.
#1242)#
bundler: importing a module multiple time (I was a bit curious about the usecase, but I fixed it to be spec-compilant and it works well.
#1245)#
bundler: export default in reexport (Previously the bundler broke code below,
because https://deno.land/x/[email protected]/mod.ts
is defined as
The bundler can now handle those kinds of reexports properly.
#1246)#
bundler: export specifiers without alias (Reported with https://github.com/denoland/deno/issues/8573
The bundler didn't handled it because while checking for reexports, the bundler modifies ast so that reexport specifier without alias does not exist. But in some circumstances, the bundler injects export specifiers without alias to maintain semantic of a module.
#1246)#
bundler: improve sorting (Reported with https://github.com/denoland/deno/issues/8574
The bug was that, the code below was not treated as an initializer of globalContext
.
The fix was trivial as there were already utilities to detect initialization.
#1246)#
bundler: top-level-await flattening (This resulted in a bug because the bundler assumed wrapped module is not async.
At first glance, it seems hard to fix, but there's a simple trick.
This fixes the issue.
#1241)#
codegen: multiline jsx texts (Affected code looks like
#1241)#
async_to_generator: async method (should be
but it was transpiled as
which has wrong a
in the parameter. This is fixed by simply removing all parameters.
#1241)#
regenerator: no useless statements (I made a mistake while proting regenerator
pass. The mistake resulted in bit larger code, and very hard time debugging.
Now I find the cause of case number being not same as one of regenerator, so future bugs will be easily fixed.
#1241)#
regenerator: track finally properly (Again, regenerator
pass depends on shared mutable state hardly, and I made mistake while porting it.
Fixing it required some dirty code because we have to modify a value stored in a list after inserting it, but it's in managable range.