Skip to main content

Changelog: swc v1.2.76

· 2 min read

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

Improvements#

minifier#

More rules are implemented and it will emit more compact code than before.

Related: #2039.

bundler: browser in package.json (#1956)#

The bundler now supports browser field of package.json.

Implemented by @tmpfs and by #2045

Bugfixes#

Block scoping (#2027)#

Previously swc could break code like

const keys = {  a: 1,  b: 2,};
const controller = {};
for (const key in keys) {  controller[key] = (c, ...d) => {    console.log(keys[key]);  };}

which defines a rest argument in an arrow expression in a for loop.

Fixed by #2034.

Mixed import specifiers (#1734)#

Previously swc had a bug which can break your code if you import from a module using both of default specifier and named spaecifier, but with different import statemetns.

Fixed by #2034.

Constructor arguments (#2021)#

This bug is caused by code written 3 years ago, and could break some class codes if constructor uses declared class properties.

Fixed by #2034.

regenerator: || (#2024)#

Now (await sleep()) || 'fallback' works properly.

Fixed by #2034.

jsc.paths (#1934, #1935)#

Previously it was not usable with typescript, but it's finally fixed and it will work as expected.

Fixed by #2043.