Commit Graph

206 Commits

Author SHA1 Message Date
Jeremy Grieshop
7e3fb0a0ab
fix(es/transforms/cjs): Allow mixing named exports and export stars. (#2583)
swc_ecma_transforms_module:
 - `common_js`: Fix _exportNames when exporting aliases and using `export *`s . (#2548)
2021-10-31 09:12:36 +00:00
Kaciras
4327d11d41
fix(swc): Use standard base64 charset for inlined source maps (#2585) 2021-10-30 16:21:29 +09:00
Donny/강동윤
33bc3d2b91
feat(es/transforms/regenerator): Allow configuring import path (#2581)
swc_ecma_transforms_compat:
 - `regenerator`: Allow configuring import path of `regenerator-runtime`.
2021-10-29 14:36:11 +00:00
Donny/강동윤
f9a8ad386d
chore: Make cargo test --all work (#2580) 2021-10-29 11:54:30 +00:00
Donny/강동윤
69cfa98c50
fix(es/minifier): Fix block unwrapping issue (#2570)
swc_ecma_minifier:
 - Check more before removing `{` and `}`.
2021-10-28 10:58:26 +00:00
Donny/강동윤
7e29685a17
chore: Fix failing tests and improve CI scripts (#2563) 2021-10-28 02:55:49 +00:00
Donny/강동윤
79a426e0d8
fix(es/minifier): Don't treat catch clause as a scope (#2557)
swc_ecma_minifier:
 - Don't treat a catch clause as a scope.
2021-10-27 11:19:30 +00:00
Donny/강동윤
5f0524c54e
fix(es/transforms/react): Revert #2542 (#2552) 2021-10-27 04:42:12 +00:00
Donny/강동윤
f81b60fd1b
fix(es/minifier): Fix minifier (#2551)
swc_ecma_minifier:
 - `hoist_props`: Check for infection. (#2506)
2021-10-27 04:19:14 +00:00
Donny/강동윤
70f55833e9
feat(es/transforms/react): Improve development more (#2542)
swc_ecma_transforms_react:
 - `jsx_src`: Add column to `__source`.
 - `jsx`: Support `jsxDEV`.
 - `jsx`: Handle `__source` and `__self` specially.
2021-10-26 11:09:09 +00:00
Donny/강동윤
b8933e3db9
fix(swc): Fix bugs (#2538)
swc_ecma_transforms_base:
 - `unique_scopes`: Handle method properties.
 - `hygiene`: Fix handling of method properties. (#2539)

swc_ecma_transforms_compat:
  - Fold children of for-of/in statements. (#2531)

swc_ecma_minifier:
 - `name_mangler`: Fix handling of method properties.
2021-10-26 07:43:32 +00:00
Donny/강동윤
e7189fbdbd
fix(es/transforms/compat): Fix async_to_generator (#2526)
swc_ecma_transforms_compat:
 - `async_to_generator`: Handle `for-await` correctly. (#2306)
2021-10-25 05:37:13 +00:00
Donny/강동윤
fce3b79e79
fix(es/minifier): Improve name mangler (#2509)
swc_ecma_transforms_base:
 - Expose renamer.

swc_ecma_minifier:
 - Improve name mangler.

swc:
 - Disable hygiene if mangler is enabled.
2021-10-24 10:52:09 +00:00
Sosuke Suzuki
ecd617af39
feat(es/transforms): Move class_properties to es2022 (#2512) 2021-10-23 23:25:14 +09:00
Donny/강동윤
f33d3218cd
feat(es/transforms/compat): Add single-property optimization to destructuring (#2511)
swc_ecma_transforms_compat:
 - `destructuring`: Convert single-property destructuring to direct field access.
2021-10-22 13:46:29 +00:00
Donny/강동윤
175c997676
fix(es/transforms/react): Fix hygiene of react fast refresh (#2501)
swc_ecma_trasnforms_react:
 - `refresh`: Use span hygiene system.
2021-10-21 14:09:00 +00:00
Donny/강동윤
9e215769cc
fix(es/minifier): Fix minifier using Deno test suite (#2503)
swc_ecma_codegen:
 - Emit `;` after private class properties.

swc_ecma_minifier:
 - `pure`: Drop more invalid expressions.
 - `sequences`: Drop more invalid expressions.
 - `strings`: Fix concat.
 - `inline`: Inline into `b` in `a[b] = foo`.
2021-10-21 11:56:48 +00:00
Nayeem Rahman
c29a6e11c9
fix(es/transforms/typescript): Fix strip (#2496)
swc_ecma_transforms_typescript:
 - Visit the RHS of import equals declaration properly.
2021-10-21 15:12:51 +09:00
Donny/강동윤
26944e159d
fix(es/transforms/base): Reimplement hygiene (#2408)
swc_ecma_transforms_base:
 - Reimplement `hygiene`.
2021-10-21 05:12:50 +00:00
Donny/강동윤
ecf0d7507c
feat(swc): Allow removing filename from error output (#2498)
swc:
 - Add an option to exclude filename from error messages.
2021-10-21 04:45:12 +00:00
Donny/강동윤
7c5b6cafd8
fix(es/minifier): Fix regexp handling (#2489)
swc_ecma_minifier:
 - Use allowlist of characters for optimizing RegExp calls.
2021-10-19 19:30:20 +00:00
Donny/강동윤
b0361caa58
feat(es/transforms/optimization): Improve inline_globals (#2479)
swc_ecma_transforms_optimization:
 - `inline_globals`: Support inlining into shorthand properties.
 - `inline_globals`: Support replacing member expressions.

swc:
 - Add an option to disable simplifier when using `inline_globals`.

node_swc:
 - Improve error message on panic.
2021-10-19 14:58:10 +00:00
Donny/강동윤
9b96885171
fix(es/transforms/compat): Fix handling of private static properties (#2478)
swc_ecma_transforms_compat:
 - `class_properties`: Replace `this` in private static property initializers. (#2476)
2021-10-19 11:21:13 +00:00
Donny/강동윤
0020e16370
fix(es/minifier): Fix minifier (#2477)
swc_ecma_minifier:
 - `MultiReplacer`: Handle inlining into shorthands.
 - `ExprReplacer`: Handle inlining into shorthands.
2021-10-19 11:00:51 +00:00
Donny/강동윤
2ca6e5d79b
feat(es/transforms/optimization): Support inlining of typeofs (#2473)
swc_ecma_transforms_optimization:
 - `inline_globals`: Support inlining of `typeof`s.

swc:
 - Change error message for parsing failure to mention `Syntax Error`.
2021-10-19 09:49:18 +00:00
Donny/강동윤
ee880d63ae
fix(swc): Change default value of inlineSourcesContent (#2471)
swc:
 - Make `inlineSourcesContent` `true` by default. (#2470)
2021-10-19 06:37:58 +00:00
Donny/강동윤
c9437d3226
fix(es): Fix bugs (#2469)
swc:
 - Fix handling of `envs`.
 - Check for already fixed issues. (#2319)
2021-10-19 06:02:46 +00:00
Donny/강동윤
01e171a4b4
test(es): Freeze as es2015 to verify base transforms (#2468) 2021-10-19 05:31:12 +00:00
Donny/강동윤
201c0fcfd0
fix(es/regenerator): Fix for nested try (#2463)
swc_ecma_transforms_compat:
 - `regenerator`: Use correct order for try locations array.
2021-10-18 15:40:53 +00:00
Donny/강동윤
5bcabb0471
fix(es/transforms/compat): Fix regenerator (#2460) 2021-10-18 12:35:26 +00:00
Donny/강동윤
575aa44c25
perf(es/transforms): Improve performance (#2454)
swc_ecma_transforms_macros:
 - `#[parallel]`: Run hooks for single-threaded operations.

swc_ecma_transforms_compat:
 - `shorthand`: Parallel.
 - `exponentation`: Parallel.
 - `parameters`: Parallel.
 - Recover some `#[fast_path]`
2021-10-18 12:07:13 +00:00
Donny/강동윤
06ca25f3d0
fix(es/minifier): Check for conditional usages while inlining (#2459)
swc_ecma_minifier:
 - `hoist_props`: Check for `used_in_cond` before inlining.
2021-10-18 07:34:17 +00:00
Donny/강동윤
9ba68c6863
fix(common): Fix sourcemap (#2457)
swc_common:
 - Include the index to the name in `mappings` of a sourcemap.

swc:
 - Fix handling of `inputSourceMap`.
2021-10-18 06:43:59 +00:00
Donny/강동윤
675c0e714f
test(es): Use typescript test suite as a golden testing (#2456) 2021-10-18 04:07:23 +00:00
Donny/강동윤
63ad4b4322
fix(es/minifier): Fix minification of react hooks (#2450)
swc_ecma_minifier:
 - `analyze`: Track for conditional usages.
 - `collapse_vars`: Don't inline a variable if usage it conditinal.
2021-10-17 15:24:17 +09:00
Donny/강동윤
1645bb30b7
perf(es/transforms): Reduce usage of #[fast_path] (#2442)
swc_ecma_ast:
 - Implement `Take` for `ObjectLit`.
 - Implement `Take` for `ArrayLit`.

swc_ecma_transforms_compat:
 - `nullish_coalescing`: Remove exponential visit.
 - `nullish_coalescing`: Migrate to `VisitMut`.
 - `optional_chaining`: Reduce exponential visit. (But it's not removed)
 - `class_properties`: Remove exponential visit.
 - `jsx_src`: Migrate to `VisitMut`.
 - `optional_chaining`: Mae it parallel.
 - `async_to_generator`: Remove `#[fast_path]`.
 - `arrow`: Remove `#[fast_path]`.
 - `destructuring`: Remove `#[fast_path]`.
 - `block_scoped_functions`:  Remove `#[fast_path]`.
 - `classes`: Remove `#[fast_path]`.
2021-10-16 08:12:02 +00:00
Donny/강동윤
7ab07ab0b9
fix(es/transforms/base): Fix resolver (#2448)
swc_ecma_transforms_base:
 - `resolver`: Handle `AssignPatProp` from `Hoister`.
2021-10-16 15:12:53 +09:00
Donny/강동윤
ee9177b753
fix(es): Fix bugs (#2447)
swc_ecma_parser:
 - Fix parsing of jsx escapes.

swc_ecma_minifier:
 - Don't mangle name as `const` or `let`. (#2446)

swc_ecma_transforms_react:
 - Fix handling of jsx escapes. (#2351)
2021-10-16 04:25:54 +00:00
Donny/강동윤
130a47f42c
feat(es/transforms/module): Add an option to preserve dynamic imports (#2441)
swc_ecma_transforms_module:
 - Add `ignoreDyanmic`.
2021-10-15 19:19:14 +09:00
Donny/강동윤
0e48284afb
fix(es/minifier): Fix bugs (#2433)
swc_ecma_minifier:
 - `sequences`: Stop searching for candidates if a dependency issue is found.
2021-10-14 13:48:14 +00:00
Donny/강동윤
f8995848b8
fix(es/transforms/proposal): Fix type detection (#2431)
swc_ecma_transforms_proposal:
 - Try the type of the LHS of an assignment pattern. (#2428)
2021-10-14 06:19:34 +00:00
Donny/강동윤
a25d67bfbf
chore: Check for issues already fixed (#2429)
- Closes #2372.
 - Closes #2351.
2021-10-14 04:15:10 +00:00
Donny/강동윤
51d7a144bb
fix(swc): Fix order of passes (#2427)
swc_ecam_transforms_typescript:
 - Preserve more jsx-related imports.

swc:
 - Change pass ordering.
2021-10-13 16:04:49 +00:00
Donny/강동윤
76de51333d
fix(es/transforms): Fix for react + typescript (#2422)
swc_common:
 - Add `NoopComments`.
 - Implement `Comments` for `Option<C>` where C: `Comments`.
 - Add some helper methods to `Comments`.
 - Deprecate `CommentsExt`.

swc_ecma_transforms_base:
 - `resolver`: Handle `TsImportEqualsDecl`.

swc_ecma_transforms_react:
 - Reduce useless cloning using `Arc`.
 - Expose API for parsing directives like `@jsxPragma`.

swc_ecma_transforms_typescript:
 - Accept `pragma` and `pragmaFrag`.
 - Support jsx directives.
 - Preserve jsx-related imports.

swc:
 - Optimize `SwcComments`.
 - Run`resolver` before everything else.
2021-10-13 22:29:56 +09:00
Donny/강동윤
8074c72ce9
fix(es/transforms/base): Fix hyigiene (#2421)
swc_ecma_transforms_base:
 - `hygiene`: Considering scoping of `var`.
 - `hygiene`: Avoid creating too many `JsWord` by caching index.
2021-10-13 17:32:37 +09:00
Donny/강동윤
62f7f655a9
fix(es/minifier): Fix iteration order (#2412)
swc_ecma_minifier:
 - Don't use `AHashMap::drain` for inlining variables.
2021-10-12 10:19:20 +00:00
Donny/강동윤
6366d05fd3
fix(es): Fix bugs (#2403)
swc:
 - Ensure that #2114 is fixed.
 - Ensure that #2310 is fixed.
2021-10-11 16:27:57 +00:00
Donny/강동윤
98cc79a2be
fix(es/minifer): Fix bugs (#2397)
swc_ecma_codegen:
 - Fix sourcemap of `export` tokens.
 - Fix codegen of numeric operands in left of a binary expression.
 - Fix codegen of unary operations.

swc_ecma_minifier:
 - Visit `AssignPatProp.valie`.
 - Move `inline_prevented` to analyzer.
 - Add `Ctx.dont_invoke_iife`.
 - `iife`: Check for `arugments`

swc:
 - `inline_sources_content`: true by default for `minify()`.
2021-10-11 07:44:42 +00:00
Donny/강동윤
ff2baf75b4
fix(swc): Fix bugs (#2396)
swc_ecma_codegen:
 - Check for comments deeply while emitting a return statement.

swc_ecma_transforms_react:
 - Fix handling of texts in attributes.
2021-10-10 09:19:47 +00:00
Donny/강동윤
ab687a0f98
fix(es/minifer): Fix handling of callable expressions (#2379)
swc_ecma_minifier:
 - `sequences`: Don't inline into arrow expression or function expressions.
 - Inject variables to arrow expressions correctly.
2021-10-10 03:47:11 +00:00