Skip to main content

Changelog: swc v1.2.83

· 2 min read

To see full list of patches, please visit https://github.com/swc-project/swc/milestone/184?closed=1

Improvements#

sourcemap#

Now swc does not emit sourceContents in situations where sources is enough. Additionally, swc now emits names properly.

Bugfixes#

|| in await (#2155)#

Fixed by #2157

minify: Options for terser compat (#2153)#

When using @swc/core via yarn resolution, it may resulted in an error because of some terser options. swc now accepts this option and ignores them (for now), so it does not result in a json deserialization error.

Fixed by #2158

parser: Generics with jsx (#2161)#

Previously, swc failed to pares

const x = <P extends object>(  a: React.ComponentType<P>): React.ComponentType<P & { a: string }> => React.memo();

Fixed by #2166

codegen: Assignment as an arrow body (#2163)#

Previously swc could break code like

() => ({ foo } = bar());

Fixed by #2166

expr_simplifier: Assignments with operator (#2165)#

Previsouly swc mis-optimized

var bit = 0;var sum = 0;sum += (bit ^= 1) ? 0 : 1;sum += (bit ^= 1) ? 0 : 1;console.log(sum);

because it didn't check the operator of assignment while caculating value of an expression.

Fixed by #2166