Commit Graph

204 Commits

Author SHA1 Message Date
Sosuke Suzuki
a086a203dd
feat(es/parser): Report an error for import.meta in script () 2021-08-04 14:38:07 +09:00
강동윤
f44e25c3af
fix(es/minifier): Improve output of minifier ()
swc_common:
 - Add `Span.has_mark`.

swc_ecma_codegen:
 - Emit `1e3` for `1000`.
 - Optimize output. ()

swc_ecma_minifier:
 - name mangler: Don't use keywords as an id.
 - `properties`: Optimize member expression with string properties.
 - `inline`: Inline some function expressions even if it's not fn-local.
 - `analyzer`: Track reassignment correctly.
 - `analyzer`: Track fn-local correctly.
 - `sequences`: Inject `void` if required.
 - `inline`: Inline function declarations correctly.
 - `sequences`: Merge expressions into test of if statements.
 - `sequences`: Reduce calls to an assigned variable.
 - Use `Marks` instead of `&dyn Comments`.


swc_ecma_transforms_optimization:
 - `expr_simplifier`: Fix infinite loops.

node/swc:
 - Ensure that `.transform` performs minification. ()
2021-08-04 00:52:47 +09:00
강동윤
4011703af5
fix(testing): Allow using it with stable rustc ()
testing_macros:
 - Make `#[fixture]` relative to cargo manifest dir.
2021-07-29 14:18:21 +09:00
강동윤
85a216ef56
feat(es/parser): Allow stripping out typescript parser ()
swc_ecma_parser:
 - Add a cargo feature to remove typescript parser.
2021-07-25 09:37:59 +00:00
David Sherret
6dc6d8a847
refactor(es/dep-graph): Remove SourceMap dependency () 2021-07-14 00:59:13 +09:00
Iron Lu
d13eff99d8
fix(es/transforms/proposal): Fix order of constructor statements ()
swc_ecma_transforms_proposal:
 - `decorators`: Fix order. ()
2021-07-13 22:32:45 +09:00
Austaras
76341068d0
fix(es/ast): Fix handling of reserved words () 2021-07-04 19:44:33 +09:00
강동윤
33f2ab2d79
fix(es/transforms): Fix transforms ()
swc_ecma_transforms_compat:
 - Organize logical assignment pass correctly.

swc_ecma_transforms_optimization:
 - `dead_branch_remover`: Handle nullish coalescing operator correctly. ()
2021-06-26 16:02:15 +09:00
강동윤
737ce63b78
chore(es/ast): Bump version () 2021-06-25 08:19:15 +00:00
강동윤
4cd43375a5
feat(swc): Add import resolvers ()
swc_ecma_loader:
 - Add `Resolve`. 
 - Add `TsConfigResolver`. 

swc_ecma_transforms_module:
 - Use `Resolve` for remapping import paths.
 - Add `ImportResolver`.
 - Add `NodeImprortResolver`.

swc:
 - Add `paths` to `.swcrc`.
 - Use `paths`. (, )
 - Canonicalize file names.
2021-06-24 06:32:09 +00:00
강동윤
6ad3f7b90e
feat(es/visit): Groundwork to use VisitMut instead of Fold ()
swc_ecma_transforms:
 - Expose `VisitMut` if possible.

swc_ecma_visit:
 - Implement `VisitMut` for` Folder<V>`.
 - Implement `VisitMut` for `AndThen<A, B>`.
2021-06-23 04:18:41 +00:00
강동윤
5a6c4fd5a0
fix(swc): Fix sourcemap ()
swc_common:
 - `SourceMap`: Don't panic for dummy spans.

swc_ecma_codegen:
 - Use span for `throw`. ()
 - Use span for `var` / `let` / `const`.
 - Use span for `new`.
 - Use span for `if`.
 - Add spans to braces of a block statement. ()

swc_ecma_transforms_compat:
 - `parameters`: Don't drop the span of block statements. ()

swc:
 - Allow specifying input source map in `.swcrc`.
 - Ensure that the inline source map works properly. ()
2021-06-18 11:34:17 +00:00
강동윤
f9bdc7b227
fix(es/parser): Fix panic on debug mode ()
swc_ecma_parser:
 - Handle undefined unicode code point gracefully. ()
2021-06-16 15:55:20 +09:00
강동윤
3c3fb359ee
fix(es): Remove UB ()
swc_ecma_parser:
 - Remove UB.

swc_ecma_codegen:
 - Remove codes related to the UB of the parser. ()
2021-06-12 05:17:09 +00:00
강동윤
97ef7c0553
fix(swc): Fix bugs ()
swc_ecma_ast:
 - Add `es2021`. 

swc_ecma_transforms_compat:
 - Handle `||=`. ()
2021-06-11 16:55:34 +09:00
강동윤
03db7adc9f
fix(es/transforms/base): Wrap binary operands of unary expressions. ()
swc_ecma_transforms_base:
 - `fixer`: Handle binary operands of unary expressions correctly. ()
2021-06-05 12:58:50 +00:00
강동윤
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
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
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
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
강동윤
d10671bbda
fix(swc): Fix various bugs. ()
swc_ecma_transforms_typescript:
 - Fix import analyzer. ()
2021-05-03 13:34:13 +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
강동윤
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
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
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
David Sherret
f1792708b4 fix(es/ast): Remove TsSignatureDecl () 2021-04-04 20:12:17 +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
Nayeem Rahman
fa3d65cd58
fix(strip): Transform static class fields to assignments ()
swc_ecam_transforms_compat:
 - Deprecate `typescript_class_properties`.

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

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-03-26 13:48:55 +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
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
강동윤
9445c109f9
fix(es/codegen): Fix codegen of arrow expressions. ()
swc_ecma_codegen:
 - Fix codegen of arrow functions.  ()
2021-03-20 15:30:54 +09:00
강동윤
dcdac2db6f
fix(swc): Fix bugs ()
swc_ecma_transforms_typescript:
  - Add option to use define propert for `strip` pass. ()

node-swc:
  - Fix `keepClassNames`. ()
2021-03-17 15:24: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
강동윤
c047e0e54d
fix(bundler): Fix bundler ()
swc_bundler:
 - Create variables for export while preparing a module. ()
 - Fix order of statements.
 - Invoke dce multiple time if required. ()

swc_ecma_transforms_optimization:
 - dce: Track modifications correctly.
2021-02-26 18:21:42 +09:00
강동윤
7f5bfdcc00
fix(bundler): Fix bugs ()
swc_bundler:
 - Improve performance
 - Use `Vec<AHashSet<usize>>` instead of `AHashSet<(usize, usize)>`.
 - Fix statement orderings. () 
 - Fix wrapped esm mixed with circular imports. ()
 - Store content of wrapped esm at top level. ()
2021-02-22 17:27:40 +09:00
Yehuda Katz
db85d123b7
Fix a number of typos ()
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-02-20 15:18:09 +09:00
강동윤
eaeffabf74
fix(es): Improve performance ()
swc_ecma_ast:
 - Add `BindingIdent`.
 - Reduce size of `Ident`.
2021-02-19 15:34:22 +09:00
강동윤
0be20ff0ae
feat(es/transforms/react): New jsx transform ()
swc_ecma_transforms_react:
  - Implement new jsx transform. (, )
2021-02-19 14:32:53 +09:00
David Sherret
313f51fab1
feat(es/parser): Allow to look at the kind of an error ()
swc_ecma_parser:
 - Add a method to look at the kind of an error without destructuring it.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-02-14 16:49:28 +09:00
강동윤
bf445a75c4
fix(swc): Fix bugs ()
swc_ecma_ast:
 - Support import assertions for exports.

swc_ecma_parser:
 - Support import assertions for exports.

swc_ecma_transform_typescript:
 - Strip `declare globals` correctly. ()

spack:
 - Re-enable multi-entry tests.
2021-02-10 17:25:28 +09:00
강동윤
0d130f8103
fix(bundler): Prevent hanging ()
swc_bundler:
 - Prevent infinite loop.
2021-01-30 13:35:07 +09:00
강동윤
947161b43b
fix(bundler): Fix bugs ()
swc_bundler:
 - Fix deglobbing of imports. (denoland/deno#8985)
 - Use correct syntax context while deglobbing imports. (denoland/deno#9212)
 - Allow reexporting from wrapped esms. (denoland/deno#8959, denoland/deno#9200)
 - Fix statement orderings. (denoland/deno#9250)
 - Emit injected items as early as possible. (denoland/deno#9250)
 - Respect `external_modules`. ()
 - Fix cjs suppport. ()

swc_ecma_transforms_base:
 - hygiene: Fix for hoisting. ()
2021-01-25 21:15:42 +09:00
강동윤
947f9c5641
fix(es/ast): Fix EqIgnoreSpan ()
swc_ecma_ast:
 - Make `EqIgnoreSpan`  impl of` StrKind` always return true.
2021-01-25 18:14:34 +09:00
강동윤
2921b903d7
fix(es/ast): Compilation ()
swc_ecma_ast:
 - Fix compilation.
2021-01-25 11:32:09 +09:00
강동윤
b7ae896bbd
fix(es): Fix bugs ()
swc_ecma_transforms_compat:
 - Handle all accesses to private class properties. ()
 - block_scoping: Inject variable correctly. ()
 - Handle async arrow function correctly. ()
2021-01-23 20:52:53 +09:00
강동윤
d4df2cece8
fix(es): Fix bugs ()
swc_ecma_parser:
 - Do not emit strict mode error while backtracking. ()

swc_ecma_transforms_proposal:
 - Handle decorator on methods with computed key.
2021-01-23 15:46:42 +09:00
강동윤
0469e3a33e
fix(es): Move and rename JscTarget ()
swc_ecma_ast:
 - Add `EsVersion`.

swc_ecma_parser:
 - Remove `JscTarget`.
 - Reexport `EsVersion` as `JscTarget`.
2021-01-20 19:43:56 +09:00
강동윤
17f17e82e6
fix(bundler): Fix bugs ()
swc_bundler:
 - Add a testing system for constant inliner.

swc_ecma_transforms_optimization:
 - const_propagation: Handle export specifiers.
 - const_propagation: Handle inlining of variables whose initializer is inlined.
 - dce: Allow dropping identifiers used in `exported` part of export specifiers.
2021-01-20 16:10:12 +09:00