Commit Graph

73 Commits

Author SHA1 Message Date
강동윤
0bd2a3a07e
fix(es/transforms): Fix bugs ()
swc_ecma_transforms_base:
- `fixer`: Wrap operand of a unary expression if it's a binary expression. (, )

swc_ecma_transforms_module:
 - Allow multiple `export *` even if it has the same item. ()
2021-06-05 11:13:42 +09:00
강동윤
99e738643a
feat(es/minifier): Implement rules and classify tests ()
swc_ecma_minifier:
 - Classify tests so we can focus on MVP.
2021-05-28 19:44:03 +09:00
강동윤
9fa878c1a6
fix(es/transforms/base): Fix ts_resolver ()
swc_ecma_transforms_base:
 - `ts_resolver`: Handle type-only imports properly. ()
2021-05-28 14:04:00 +09:00
강동윤
ef6a745599
feat(es/minifier): Implement more rules ()
swc_ecma_minifier:
 - Implement `evaluate` partially.
 - Store 'expected output' from terser along with our result.

swc_ecma_transforms_base:
 - `fixer`: Don't wrap `+ (a % b)`.

swc_ecma_transforms_optimization:
 - `expr_simplifier`: Preserve this in calls.
2021-05-25 16:39:07 +09:00
강동윤
5e2db21e47
feat(es/minifier): Implement more rules ()
swc_ecma_codegen:
 - Don't panic while checking if 2 dots are required.

swc_ecma_minifier:
 - Implement some rules related to the option `evaluate`.
 - Implement some rules related to strings.
 - Implement some rules related to numbers.

swc_ecma_transforms_base:
 - `fixer`: Handle `- (1 / 0)`.
 - `fixer`: Handle `(void 0)(0)`.
2021-05-23 15:39:59 +09:00
강동윤
3522fc71e4
feat(es/minifier): Implement more rules ()
swc_ecma_codegen:
 - Fix codegen of `-0.0`.

swc_ecma_transforms_base:
 - `fixer`: Handle tag of tagged template literals.


swc_ecma_minifier:
 - Implement more rules for strings.
 - Implement more rules for teplate literals.
 - Implement more rules for comparisons.
 - Implement more rules for destructuring bindings.
 - Implement more rules for switch statements.
 - Implement more rules for expressions.
2021-05-23 11:19:11 +09:00
강동윤
a1341dcdc6
fix(es/transforms/compat): Fix async_to_generator pass. ()
swc_ecma_transforms_compat:
 - `async_to_generator`: Fix async iife. ()
 - `async_to_generator`: Don't apply iife optimization to named function expressions.
 - `async_to_generator`: Remove duplicated works.
 - `async_to_generator`: Support `await for`. ()
 - `async_to_generator`: Support async generators.
2021-05-21 13:13:22 +09:00
강동윤
8a2909bc51
fix(es/preset-env): Update core js compat data ()
swc_ecma_preset_env:
 - Update `core-js-compat`. (https://github.com/swc-project/swc/issues/1712#issuecomment-844959483)
2021-05-20 20:46:03 +09:00
강동윤
a0241c88b2
fix(es/transforms/base): Fix resolver ()
swc_ecma_transforms_base:
 - `ts_resolver`: Treat the type parameter of a mapped type as a binding.
2021-05-18 17:47:43 +09:00
강동윤
dee82904f8
fix(es): Fix bugs ()
swc_ecma_transforms_base:
 - `fixer`: Fix regression related to `??` and `||`. ()
2021-05-18 15:34:44 +09:00
강동윤
b044d2c6dd
fix(es/transforms/compat): Support private methods ()
swc_ecma_transforms_base:
 - Add some helpers.

swc_ecma_transforms_compat:
 - `class_properties`: Support private methods. (Closes )
2021-05-15 20:35:24 +09:00
강동윤
b4aa1d48e3
fix(es/transform): Fix bugs ()
swc_ecma_transforms_base:
 - Fix bug of `ts_resolver`.

swc_ecma_transforms_typescript:
 - `strip`: Emit `export {}` for type-only modules. ()
 - `strip`: Support scripts.
2021-05-15 16:07:24 +09:00
Pig Fang
1dbc3644a5
feat(es): Support type-only import equals declaration ()
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-05-15 14:26:24 +09:00
강동윤
2ad0af9e91
fix(es/transforms/compat): Improve performance ()
swc_ecma_transforms_compat:
 - `classes`: Fast-path.
 - `destructuring`: Fast-path.
 - `sticky_regex`: Fast-path.
 - `spread`: Fast-path.
 - `shorthand`: Fast-path.
 - `typeof_symbol`: Fast-path.
 - `block_scoped_functions`: Fast path.
 - `duplicate_keys`: Use fxhash.
 - `instance_of`: Fast path.
 - `reserved_words`: Make string comparison efficient.
2021-05-11 04:53:36 +00:00
강동윤
9381d0dbc2
fix(es/transforms/base): Fix resolver ()
swc_ecma_transforms_base:
 - `resolver`: Handle variables in for in/of loop body correctly.
2021-05-10 20:39:07 +09:00
강동윤
2b918b0c3d
fix(es/transforms/compat): Don't create unnecessary IIFE. ()
swc_ecma_transforms_compat:
 - `class_properties`: Do not create iife if possible. ()
2021-05-10 16:18:31 +09:00
Pig Fang
1548f6d799
feat(es/parser): Allow override in parameter properties ()
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-05-09 22:17:58 +09:00
Pig Fang
4aed9423de
fix(es/parser): Allow using override with static () 2021-05-09 21:04:42 +09:00
강동윤
9585500476
fix(es/transforms/base): Fix resolver ()
swc_ecma_transforms_base:
 - `resolver`: Handle function declarations in arrow body.
2021-05-09 09:52:29 +00:00
강동윤
aea08fb8c9
fix(es/tranforms/base): resolver: Handle function declarations in ts modules ()
swc_ecma_transforms_base:
 - `resolver`: Handle function names in ts modules correctly.
2021-05-09 16:03:59 +09:00
강동윤
b0b0709e1a
fix(es): Fix various bugs. ()
swc_ecma_codegen:
 - Emit comments of `BytePos(0)`. ()

swc_ecma_transforms_compat:
 - `classes`: Optimize class expresssions. ()
2021-05-09 14:23:03 +09:00
Niklas Mischkulnig
f4d0e46cbb
feat(es/transforms/compat): Add pure comment to classes ()
swc_ecma_transforms_compat:
 - Add pure annotations while tranpiling classes.
2021-05-08 15:47:20 +09:00
강동윤
1b1c46b492
fix(es/transforms/compat): Allow keywords in method names. ()
swc_ecma_transforsm_compat:
 - Allow using a keyword as a method name.
2021-05-07 11:27:25 +00:00
강동윤
abc24c9256
fix(es/transforms/resolver): Fix setter properties ()
swc_ecma_transorms_base:
 - Handle parameters of a setter property correctly.
2021-05-06 13:56:42 +09:00
강동윤
deec1f67a3
fix(es/transforms/resolver): Fix setter properties ()
swc_ecma_transorms_base:
 - Handle parameters of a setter property correctly.
2021-05-06 03:09:03 +09:00
강동윤
27a1c30fef
fix(es/transforms/fixer): Handle binary expressions in super class expr ()
swc_ecma_transforms_base:
 - Handle binary expressions in super class expressions. ()
2021-05-04 12:11:40 +09:00
강동윤
5a0bacb5b8
fix(swc): Fix various bugs ()
swc_ecma_codegen:
 - Fix codegen of `\x00`. ()

swc_ecma_preset_env:
 - Fix order of core-js imports. ()

swc_ecma_transforms_react:
 - Preserve `&nbsp;`. ()

swc:
 - Upgrade dashmap. ()
2021-04-28 14:49:21 +09:00
강동윤
46c3d62ebd
fix(swc): Fix bugs ()
spack:
 - Ensure that  is fixed. () 

swc_ecma_parser:
 - Support `async override` in classes. ()

swc_ecma_transforms_compat:
 - `async_to_generator`: Preserve this in async object methods. ()
 - `nullish_coaelscing`: Fix assignments. ()
 - `export_namespace_from`: Preserve order of statements. ()

swc:
 - Disable aes. ()
2021-04-17 06:00:14 +00:00
grimly
60ad0df3f5
@swc/helpers exports typeOf instead of typeof ()
swc_ecma_transforms_base:
 - Fix helper names.
2021-04-16 13:48:37 +09:00
Devon Govett
00461f3a76
fix(es/transforms/base): Fix precedence of yield expression inside ternary () 2021-04-15 05:50:43 +00:00
강동윤
246bdd5088
fix(bundler): Fix bugs ()
swc_bundler:
 - Ensure that denoland/deno#10141 is fixed. 
 - Run deno tests on ci.
 - Support nested `export *`. (denoland/deno#10153, denoland/deno#10174)

swc_ecma_codegen:
 - Remove `,` after rest elements. (, )

swc_ecma_transforms_optimization:
 - Don't drop items used by the discriminant of a switch.

swc_ecma_transforms_typescript:
 - Remove constructors without a body.
2021-04-14 14:00:33 +00:00
Devon Govett
d8a18dfd9e
fix(es/transforms/compat): Fix block scoping of class declarations () 2021-04-14 17:42:07 +09:00
Austaras
df2a926e9d
fix(es/transforms/module): Use correct this ()
swc_ecma_transforms_module:
 - Preserve semantics of `this` in imported functions. ()
2021-04-14 00:18:24 +09:00
Devon Govett
92bbde3b53
fix(es/transforms/base): Fix nested function scopes ()
swc_ecma_transforms_base:
 - `resolver`: Handle nested function scopes correctly.
2021-04-13 16:23:04 +09:00
Devon Govett
14edb69826
fix(es/transforms/base/fixer): Fix parens of sequence expressions ()
swc_ecma_transforms_base:
 - Fix parens of sequence expressions in callee and function parameters.
2021-04-12 06:14:55 +00:00
Devon Govett
8f5daa3bbb
feat(es/transforms/react): Add pure annotation comments ()
swc_ecma_transforms_react:
 - Add pure annotations for react.
2021-04-11 15:09:27 +09:00
강동윤
5ef3c43522
fix(es): Fix bugs. ()
swc_ecma_parser:
 - Don't panic for `try` statements without handler and finalizer. (denoland/deno#10112)

swc_ecma_transforms_base:
 - Fix `typeof`s used with `externalHelpers: true`. (, )
2021-04-10 20:55:17 +00:00
Pig Fang
39e1e54ee4
fix(es/parser): Disallow override in non-subclass ()
swc_ecma_parser:
 - Disallow `override` in classes without super class.
2021-04-07 15:38:24 +00:00
Devon Govett
beeb1f9067
fix(es/transforms/base): Fix named function expression handling in resolver () 2021-04-06 13:31:11 +09:00
David Sherret
f1792708b4 fix(es/ast): Remove TsSignatureDecl () 2021-04-04 20:12:17 +09:00
강동윤
4ab7a91fe3
fix(es): Fix for the type checker ()
swc_ecma_codegen:
 - Fix codegen of type assertions.


swc_ecma_transforms_base:
 - `resolver`: Handle getter properties.
 - •resolver`: Handle setter properties.
2021-04-01 03:01:44 +09:00
강동윤
13a9d12c84
chore(ci): Configure github actions for rustdoc () 2021-03-31 13:09:10 +09:00
강동윤
51d0cef287
fix: Fix bugs ()
swc_ecma_ast:
 - Support TypeScript 4.3. ()

swc_ecma_parser:
 - Support new syntaxes from typescript 4.3. () 

swc_ecma_transforms_compat:
 - Fix '\\`' in template literals. ()
 - `classes`: Fix super calls. ()

swc_ecma_transforms_module:
 - Respect `esModuleInterop` for dynamic imports. ()

swc_ecma_transforms_typescript:
 - `strip`: Remove `declare`-d namespaces. ()
2021-03-30 16:47:12 +09:00
강동윤
99f4f0f280
fix(swc): Fix bugs for v1.2.52 ()
swc_ecma_parser:
 - Support `private declare`. ()
 - Recover `backtracking` state while doing some nested backtracking. ()
 - Allow using `readonly` as the name of class properties. ()

swc_ecma_transforms_base:
 - `hygiene`: Keep the name of class expressions. ()

swc_ecma_transforms_typescript:
 - Allow a namespace and a class to have the same name. ()

swc:
 - Disable `tsx` if the ext of a file is ts.
2021-03-29 20:48:48 +09:00
강동윤
b7eb1f9154
fix(es/transforms/base): Fix fixer ()
swc_ecma_transforms_base:
 - Fix `('a' ?? 'b') || c`.
2021-03-27 00:45:51 +09:00
David Sherret
da62c73239
refactor(es/ast): Change TaggedTpl to have a Tpl ()
swc_ecma_ast:
 - Make `TaggedTpl` have `Tpl`.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-03-25 20:09:36 +09:00
강동윤
df3f3106df
fix(es/transforms/fixer): Fix await expressions. ()
swc_ecma_transforms_base:
 - Handle assign expressions in `await` correctly. ()
2021-03-24 19:25:04 +09:00
Nayeem Rahman
9bc074ed46
fix(strip): Combine typescript_class_properties() into strip() ()
swc_ecma_utils:
 - Use `&mut` for inject_after_super.

swc_ecma_transforms_typescript:
 - Merge `typescript_class_properties` into `strip`.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-03-21 22:31:35 +09:00
강동윤
bc07215d4d
fix(es/parser): Fix lexing of template literals. ()
swc_ecma_parser:
 - Fix lexing of template literals. ()
 - Ensure that  is not a bug of parser.
2021-03-03 17:46:36 +09:00
강동윤
a3105428ba
fix(swc): Fix various bugs ()
swc:
 - Use `hygiene_with_config` instead. ()
 - Allow enabling source map with `.swcrc`. ()

swc_ecma_transforms_base:
 - `hygiene`: Add an option to preserve class names. ()

swc_ecma_transforms_compat:
 - `block_scoping`: Allow using `break` in switch cases. ()
2021-03-01 17:19:37 +09:00