Commit Graph

1065 Commits

Author SHA1 Message Date
Donny/강동윤
dcf5f05195
fix(es/minifier): Fix minifier (#2528)
swc_ecma_minifier:
 - `collapse_vars`: Respect operator.
2021-10-25 12:24:40 +00:00
Donny/강동윤
a099e8f846
perf(es/minifier): Make name mangler parallel (#2527)
swc_ecma_minifier:
 - Remove useless `RefCell<T>`.
 - Make name mangler parallel.
2021-10-25 07:09:00 +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/강동윤
709b3c7cd6
fix(es/transforms/optimization): Fix inline_globals (#2524)
swc_ecma_transforms_optimization:
 - `inline_globals`: Skip assignment to `process.env.FOO`. (#2499)
2021-10-24 21:51:08 +00:00
Donny/강동윤
a8b29b662e
test(es/minifier): Add a test for moment.js (#2522)
swc_ecma_minifier:
 - Ensure that `moment.js` is minified correctly. (#2521)
2021-10-24 14:54:23 +00:00
Sosuke Suzuki
65c83e8cb4
feat(es/transforms): Move stage 4 proposals to es2022 (#2519) 2021-10-24 21:28:40 +09: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
Austaras
c482162206
feat(es/transforms/module): Fix transform of this for classes (#2514) 2021-10-23 21:13:56 +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
Sosuke Suzuki
91717c9c5f
feat(es/babel): Support babelify of static blocks (#2504) 2021-10-22 13:32:34 +09: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
Pig Fang
a9869e60f2
test(es/transforms/compat): Add tests for optional_catch_binding (#2502) 2021-10-21 20:41:10 +09:00
Sosuke Suzuki
52dfb55816
fix(es/transforms/compat): Change error message (#2500)
swc_ecma_transforms_compat:
 - `classes`: Use `unreachable` instead of `unimplemented ` for static blocks.
2021-10-21 15:15:08 +09: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
7af0f8c81b chore: Publish 2021-10-21 14:16:15 +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/강동윤
eef3d6e3fb
fix(es): Fix simple bugs (#2495)
swc_ecma_parser:
 - Don't panic on `declare declare`. (#2343)

swc_ecma_transforms_react:
 - Don't panic on `createElement()`. (#2492)

swc_bundler:
 - Don't panic on wasm. (#2334)

swc:
 - Disable `inline_globals` if it's not specified. (#2490)
2021-10-20 06:12:21 +00:00
Sosuke Suzuki
bb1cc974c7
feat(es/trasform): Support static blocks (#2474)
swc_ecma_transforms_proposal:
 - Add transform for static blocks, which is stage 3.
2021-10-20 14:18:55 +09:00
Donny/강동윤
cef2c8666e
fix(es/minifier): Fix join_vars (#2494)
swc_ecma_minifier:
 - Don't join `let`/`const` into narrower scope.
2021-10-20 05:17:14 +00:00
David Sherret
3886eeddd5
fix(es/parser): Fix parsing of a property named async (#2485) 2021-10-20 04:31:52 +09: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/강동윤
bf886bac73
perf(es/parser): Make typescript parser faster (#2483)
swc_ecma_parser:
 - Check for option before backtracking.
2021-10-20 00:00:48 +09: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/강동윤
123c1f5d02
chore: Fix typo (#2472) 2021-10-19 08:25:57 +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
98a18e306a chore: Publish swc_ecma_transforms_compat 2021-10-19 00:43:00 +09: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
7225f90b9c Bump version 2021-10-18 11:09:59 +09:00
Donny/강동윤
3d204b44f0
perf(es/transforms): Make transforms parallel (#2449)
swc_ecma_utils:
 - `collect_decls`: More parallel.

swc_ecma_transforms_macros:
 - Add `Parallel`, which is helper for `#[parallel]`.
 - Add `ParExplode`, which is helper for `#[parallel(explode)]`.

swc_ecma_transforms_macros:
 - Add `#[parllel]`.

swc_ecma_transforms_compat:
 - `sticky_regex`: Parallel.
 - `typeof_symbol`: Parallel.
 - `for_of`: Remove exponential visit.
 - `regenerator`: Remove exponential visit.
 - `object_spread`: Parallel.
 - `instance_of`: Parallel.
 - `duplicate_keys`: Parallel.
 - `logical_assignments`: Parallel.
 - `template_literal`: Parallel.
 - `block_scoped_functions`: Migrate to `VisitMut`.
 - `for_of`: Migrate to `VisitMut`.
 - `destructuring`: Reduce `Visit`.
 - `arrow`: Migrate to `VisitMut`.
 - `function_name`: Parallel.
 - `reserved_words`: Parallel.
 - `for_of`: Parallel.

swc_ecma_transforms_module:
 - `import_analyzer`: Migrate to `VisitMut`.

swc_ecma_transforms_react:
 - `jsx_src`: Parallel.
-  `jsx_self`: Migrate to `VisitMut`.
-  `jsx_self`: Parallel.

swc_ecma_transforms_proposal:
 - `export_default_from`: Migrate to `VisitMut`.

swc_ecma_transforms_optimization:
 - `inline_globals`: Parallel.
 - `json_parse`: Migrate to `VisitMut`.
 - `json_parse`: Parallel.
2021-10-18 00:03:30 +09:00
Donny/강동윤
de368f6bb7
fix(es/codegen): Escape backtick of synthesized template literals (#2453)
swc_ecma_codegen:
 - Escape backtick of a template literal if it's synthesized.
2021-10-17 20:44:21 +09: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/강동윤
e722bd4887
perf(es/transforms): Reduce usage of #[fast_path] (#2439)
swc_ecma_transforms_compat:
 - Remove `#[fast_path]` from passes.
 - Migrate some passes to `VisitMut`.
2021-10-15 10:18:27 +00:00
Donny/강동윤
d045244089
fix(es/codegen): Fix codegen of synthesized template literals. (#2440)
swc_ecma_codegen:
 - Don't handle synthesized backtick specially.
2021-10-15 09:12:40 +00:00
Donny/강동윤
4c983e9158
perf(es/codegen, es/parser): Improve performance (#2406)
ast_node:
 - Make `.span()` inlinable.

swc_ecma_codegen:
 - Reduce call to *heavy* `.span()` calls.

swc_ecma_parser:
 - Reduce `memmove` by using typed-arena.

swc_bundler:
 - Make `Bundle.bundle` take `&mut self`.
 - Make drop concurrent.
2021-10-15 12:49:37 +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/강동윤
647d3ed36a
chore(doc): Add an example of stripping out types (#2430) 2021-10-14 04:43:55 +00:00