Skip to main content

Changelog: swc v1.2.96

· 2 min read

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

Improvements#

Better performance#

swc now uses faster hash algorithm, namely ahash. Also, the bundler now performs tree shaking in parallel, and there are more operations which become parallel. Stay tuned!

Implemented by #2384, #2392, #2394, #2411.

Bugfixes#

parser: Parameter named async#

You can now use async as a binding identifier in more places.

Fixed by @g-plane and by #2386, #2395, @2399.

minifier: Callables#

sequences pass now considers if the next expression is callable type, e.g. an arrow expression or a function expression.

Fixed by #2379.

codegen: Comments#

swc now check for comments deeply while emitting return statements.

Fixed by #2396.

react: Attribute texts (#2351)#

swc now handles text in jsx atributes properly.

Fixed by #2396.

minifier: Inlining#

The minifier of swc now inline variables properly.

Fixed by #2379, #2412, and #2424.

codegen: Sourcemap#

swc now generates proper sourcemap entry for import and export.

Fixed by #2379

parser: ASI in class#

swc now parses

class C {  get // ignore this. comment to prevent foramtting  x() {    return 0;  }
  set // ignore this. comment to prevent foramtting  x(value) {}}

as a class with two members.

Fixed by @g-plane and by #2409.

pass ordering (#2418)#

There was a regresssion related to pass ordering.

Fixed by #2422 and by #2427.

react: Escape of html entitires (#2303)#

Fixed by @bojan88 and by #2419.

hygiene: var handling#

Now hygiene, the variable renaming pass, understand the scoping of var.

Fixed by #2421.