Skip to main content

Changelog: swc v1.2.63

· 2 min read

Bugfixes#

common js: Duplicate named exports (#1780)#

Previously swc had a bug in common js handler which can break codes like

// constant.tsexport enum Foo {}
// File1.tsexport { Foo } from "./constant";
// file2.tsexport { Foo } from "./constant";
// index.tsexport const BIZ = "biz";export * from "./file1";export * from "./file2";

Fixed by #1846 and by @IronLu233.

bundler: Infinite hang (#1756)#

Previously the bundler hang on some complex circular import scenario.

Fixed by #1872.

comments in empty file (#1878)#

Previously swc stored comments in a file without any code as trailng comments, which is counterintuitive.

Fixed by #1879 and by @dsherret

typescript: < and > in template literal types. (#1862)#

Previously the parser of swc failed to parse < and > used in template literals, like

type A = `<`;

Fixed by #1885 and by @SimonRask

typescript + react: declare module (#1865)#

Previsouly react fast refresh transform of swc were broken by typescript declare module statements, like

function useHooks() {  return useMemo(() => 1);}
declare module "x" {}

Fixed by #1875 and by @Austaras.

method with keyword as the name (#1838)#

Previsouly swc had a bug which breaks code if a keyword is used as a method name, like

class Foo {  let() {}}

Fixed by #1891 and by @Austaras

Visitor bugs (#906, #1625, #1819, #1888)#

Fixed by #1890

misc#

License of wasm (#1798)#

License of @swc/wasm and @swc/wasm-web is now Apache-2.0 AND MIT, not Apache-2.0/MIT. This may affect license checking tools.

Fixed by #1874