Commit Graph

419 Commits

Author SHA1 Message Date
강동윤
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
강동윤
6a1c3da326
fix(bundler): Fix bugs ()
swc_bundler:
 - Fix keywords pass.

swc_ecma_transforms_optimization:
 - Remove `dbg!`.
 - `constant_propagation`: Inline only injected variables.
2021-01-22 18:39:57 +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
강동윤
ddc9492aed
fix(es/transforms): Handle enum in namespaces ()
swc_ecma_transforms_typescript:
 - Handle enums in namespaces. ()

swc:
 - Exclude files based on .swcrc.
2021-01-18 23:00:53 +09:00
강동윤
613a5a45dd
fix(es): Fixes for the type checker ()
swc_ecma_codegen:
 - Fix codegen of typescript interfaces.

swc_ecma_transforms_base:
 - ts_resolver: Handle ts module declarations.
2021-01-15 21:12:16 +09:00
강동윤
3faefb5836
feat(es): TypeScript 4.2 ()
swc_ecma_ast:
 - Add `is_abstract` to constructor types.

swc_ecma_codegen:
 - Fix codegen of `Bool`.
 - Implement codegen for abstract constructors.

swc_ecma_parser:
- Inline tsc parser test suite.
- Implement parsing of abstract constructor types.
2021-01-15 19:30:44 +09:00
강동윤
a9bf9bb9e1
fix(swc): Fix bugs ()
swc_ecma_codegen:
 - Handle unicode escape sequences when target is es5. (, )

swc_ecma_transforms_compat:
 - Handle template literals correctly. ()
 - Handle private class properties correctly. ()

swc:
 - Don't panic on `export * as foo from 'foo'`. ()
2021-01-14 21:56:25 +09:00
강동윤
6984217200
feat(ES/transform/typescript): Support namespace ()
swc_common:
 - Update `serde`.

swc_ecma_transforms_typescript:
 - Add support for namespace.
2021-01-12 21:59:42 +09:00
강동윤
23aebacade
fix(bundler): Fix bundler ()
swc_bundler:
 - Use two-context system properly.
 - Remove old logic.
 - keywords: Handle assignment pattern property.
 - keywords: Handle shorthand property.
 - keywords: Handle identifiers in declarations.

swc_ecma_transforms_typescript:
 - Do not remove import if there's non-type usage. (Related to )

swc_ecma_transforms_optimization:
 - dce: Handle new expression correctly.
2021-01-11 19:38:20 +09:00
강동윤
dc0d226684 Update cargo.toml 2021-01-05 21:55:00 +09:00
강동윤
842b6f953c
fix(ecmascript/transforms): Fix dce ()
swc_bunder:
 - Fix `keywords` pass.

swc_ecma_codegen:
 - Ensure that the code generator handles unicode characters properly. ()

swc_ecma_parser:
 - Ensure that the parser handles unicode characters properly. ()

swc_ecma_transforms:
 - Fix dce.
2021-01-05 18:45:26 +09:00
강동윤
76d9e2a9df
feat(ecmascript/transforms): Split into multiple crates. () 2021-01-05 14:29:52 +09:00
강동윤
ba13db54db
fix(bundler): Fix remaining bugs ()
swc_bundler:
 -  Allow `export *` and `import` from same source. (, )
 -  Handle contextual keywords. ()
 -  Prevent duplicated identifiers. ()

swc_ecma_transforms:
 - dce: Preserve tags in tagged template literals. ()
 - dce: Handle throw statement correctly. ()
2020-12-28 19:53:40 +09:00
강동윤
b66ee58ee3
fix(bundler): Fix statement ordering issue ()
swc_bundler:
 - Reduce binary size by reducing usage of visitor / folders.
 - Handle `export *` and `export { default }` from same source. (, )
 - Fix ordering of statements. ()
 - Sort statements in wrapped modules. (https://github.com/denoland/deno/issues/8211#issuecomment-741070299)
 - Exclude default export while handling `export *`.
 - Exclude `export { default }` and `export { foo as default }` while handling `export *`.
 - Make statements from same module to be injected together. ()

swc_ecma_transforms:
 - fixer: Handle assignments in the callee of `new`  correctly.
 - fixer: Handle seqence expression in the callee of `new`  correctly.
2020-12-27 19:02:41 +09:00
강동윤
6941f29943
fix(swc): Fixes for typescript type checker ()
swc_ecma_codegen:
 - Fix codegen of `TsConstructorSignature`.
 - Fix codegen of `TsIndexSignature`.
 - Fix codegen of type parameters in arrow expressions.
 - No panic on dummy span.

swc_ecma_parser:
 - Parse optoinal method correctly.

swc_ecma_transforms:
 - resolver: Handle type parameters in arrow expressions.
2020-12-27 18:18:30 +09:00
강동윤
8a8db58f1c
fix(ecmascript): Fix bugs related to string literals ()
swc_ecma_ast:
 - Add `Str.kind`.

swc_ecma_transforms:
 - Fix quotes in template literals. ()

swc_ecma_codegen:
 - Fix escape of single quotes. ()
 - Fix codegen of wrong escapes. ()

swc:
 - Ensure that  is about napi's deserialization.
2020-12-22 04:27:18 +09:00
강동윤
ccf4c2b12c
feat(fixer): Handle ?? properly ()
swc_ecma_transforms:
 -  Handle `??` properly. ()
2020-12-12 17:45:54 +09:00
강동윤
03f9b93f58
Fix bundler ()
swc_bundler:
 - Handle indirect wrapped es modules. (, )
 - Respect `export { foo }`. ()

swc_ecma_parser:
- Allow `??=`, `||=`, `??=` in non-ts modules. ()

swc_ecma_transforms:
 - Make `hygiene` check if a variable with expanded name exists. ()
 - Handle `??=` correctly.
2020-12-09 14:23:44 +09:00
강동윤
2e29d78281
fix: Decorator metadata ()
swc_ecma_transforms:
 - Emit proper typename for `design:type` used with enum. ()
2020-12-04 05:03:26 +09:00
강동윤
faa1c5f4e5
Fix bugs ()
swc_ecma_codegen:
 - Print multiline string correctly. ()

swc_ecma_transforms:
 - `optional_chaining`: Ensure that  is fixed. ()
 - `async_to_generator`: Remove method parameters. (, )
 - `regenerator`: Don't emit useless expressions. ()
 - `regenerator`: Track `finally` properly. ()

spack:
 - LRU cache for resolver.
2020-11-30 19:20:21 +09:00
강동윤
f8a1fb878d
fix(regenerator): Handle ternary correctly ()
swc_ecma_transforms:
 - Fix interaction between ternary and await. ()

testing_macors:
 - Fix for `--lib` tests.
2020-11-24 02:54:18 +09:00
강동윤
25f2ff1a45 Bump version 2020-11-22 18:17:55 +09:00
강동윤
6888c69bda
Fix codegen: preserve input ()
swc_ecma_codegen:
 - Preserve input. ()
2020-11-21 02:04:29 +09:00
강동윤
4294b5e7ba
bundler: Fix issues ()
swc_bundler:
 - Bundler rework. (denoland/deno#6802)
 - Reexports are not transitive. (denoland/deno#8246)
 - Dependencies of module with circular dependency. (denoland/deno#8302)
 - Order of injection between import vs export. (denoland/deno#8302)
 - `export *` in wrapped modules. (denoland/deno#8308, denoland/deno#8399)
 - `export { a as b }` in wrapped modules.
 - Fix denoland/deno#8314.
 - Fix denoland/deno#8325.
 - Fix denoland/deno#8344.
 - Make deno test verify exported names. 
 - Handle `export * from './foo'`.

swc_ecma_parser:
 - Don't panic on private name in interface (Closes )

swc_ecma_transforms:
 -  dce: Prevent infinite loop
 -  Faster constant propagation pass.
2020-11-19 20:42:56 +09:00
Brad Dunbar
4327d91fe3
BigInt literal keys () 2020-11-15 01:22:35 +09:00
강동윤
af0b0a9ab1
Fix fixer ()
swc_ecma_transforms:
 - fixer: Don't unwrap paren if there's a comment for inner node.
2020-11-08 10:59:36 +09:00
강동윤
0a5e23f97c
bundler: Handle swc helpers ()
swc_bundler:
 - Handle helpers from `swc_ecma_transforms`.

swc_ecma_transforms:
 - dce: Remove unused self-referential functions.
2020-11-05 09:53:18 +09:00
강동윤
f21a28844d
resolver: handle class declarations ()
swc_ecma_transforms:
 - resolver: Handle class declarations ()
2020-11-03 01:30:21 +09:00
강동윤
bae0eda8bd
Fix bundler ()
swc_bundler:
 - Remove wrong assertion. ()
 - Remove wrong variables created on reexports. ()

swc_ecma_transforms:
 - inlining: Treat usage as an argument as writes. ()
 - inlining: Visit rhs of `||` and `&&`. ()
2020-10-30 14:49:02 +09:00
강동윤
a368f66e77 Bump version 2020-10-29 15:44:12 +09:00
강동윤
b2aec35eb6
Fix issues ()
swc_bundler:
 - Support emitting iife. (Closes )

swc_ecma_parser:
 - Auto-detect script / module (Closes )
 - lexer: Error recovery for strict mode and module mode.
 - More error recovery logic for strict mode violation.
 - Fix panic on invalid input. (Closes )
2020-10-28 21:20:11 +09:00
Frederik Wessberg
6b03c659ca
transforms: fix _typeof helper 2020-10-24 23:26:13 +09:00
Brad Dunbar
26c530b133
Invalid template escape in ES2018+ ()
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-20 00:17:20 +09:00
강동윤
626c881c98
bundler: Fix ordering () 2020-10-16 22:26:18 +09:00
강동윤
a5e6242601 Bump version 2020-10-14 14:39:51 +09:00
강동윤
5a91ab994c
bundler: Fix dead code elimination ()
swc_bundler:
 - Fix dce bug. ()

swc_ecma_transforms:
 - resolver: Ignore non-computed class properties.
 - dce: Handle usages in class property initializers.
2020-10-12 00:36:44 +09:00
강동윤
f0ea70cb25
bundler: Allow importing and exporting from same module ()
swc_bundler:
 - Allow importing and exporting from same module. ()
2020-10-09 19:10:25 +09:00
강동윤
75a6211e2d
Fix hygiene and bundler ()
swc_bundler:
 - Change order of execution of modules with circular imports. ()

swc_ecma_transforms:
 - hygiene: Fix handling of default in object patterns. ()
2020-10-07 14:55:02 +09:00
강동윤
0586c733e3
Fix bugs ()
swc_ecma_transforms:
 - fixer: Fix conditional expression in await expressions. ()
 - optional_chaining: Fix call expression. ()
 - hygiene: Fix codegen of computed keys. ()
2020-10-06 23:27:23 +09:00
강동윤
e4ddfcc899
export * as ns is part of ES2020 ()
swc_bundler:
 - Add direct support for `export * as ns from 'foo';`. ()

swc_ecma_transforms:
 - Split `export` pass to `export_namespace_from` and `export_default_from`.

swc:
 - Enable `export * as ns` for targets lower than es2020.
2020-10-06 20:48:29 +09:00
강동윤
aa9555865b
Fix bugs ()
swc_ecma_transforms:
 - Handle typescript class properties correctly. ()
 - Handle optional chaining properly. ()
 - Inject variables for nullisn coalescing in correct scope. ()
2020-10-04 21:59:19 +09:00
강동윤
205ce4ebe2
bundler: fix extra bugs ()
swc_bundler:
 - Prevent invalid output like `export * as helpers`
 - Prevent stack overflow which occurs while bundling `https://deno.land/x/oak@v6.2.0/mod.ts`

swc_ecma_transforms:
 - Migrate inlining pass to VisitMut
2020-10-04 00:19:35 +09:00
Nayeem Rahman
e4b8a0cc1e
fix(strip): Don't treat type-only exports as concrete references ()
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-03 17:43:09 +09:00
강동윤
9879fa59c8
bundler: fix bugs ()
swc_bundler:
 - Correct lca for circular dependencies.
 - Handle namespaced imports. ()
 - Handle namespaced reexports. ()
 - Handle shorthand properly. ()
 - Implement `import.meta` ()
 - Handle reexport mixed with imports correctly. ()
 - Handle export default decls in computed-key modules. 
 - Remove all export * from. output. ()
 - Handle export of class or function declaration in a computed module properly. ()


swc_ecma_transforms:
 - Do not rename class members. ()
2020-10-02 11:07:40 +09:00
강동윤
ab8df21797
Fix optional chaining in argument position () 2020-09-24 15:14:30 +09:00
Nayeem Rahman
a9c3072b65
fix(strip): Fix Config::import_not_used_as_values ()
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-09-23 22:52:47 +09:00
강동윤
73671ecd90
chores: Bump version of wasm () 2020-09-23 21:44:51 +09:00
강동윤
688d16f228
Import assertion / json modules ()
swc_atoms:
 - Add "assert".

swc_ecma_ast
 - Add a field to an import declaration.

swc_ecma_parser:
 - Parse assertions in import statements.
 - Parse assertions in top-level dynamic imports.
 - Parse assertions in non-top-level dynamic imports.

swc_ecma_transforms:
 - Fix compilation.
2020-09-23 14:27:27 +09:00
강동윤
6c6f1aaaa3
Fixs bugs ()
spack:
 - fix resolver. ()

swc_common:
 - preserve original sourcemap. ()

swc_ecma_transforms:
 - optional chaining: `a?.b.c.d.e`. ()
 - fixer: preserve parenthesis in `(a || b)()`. ()
 - compat::es2015: Change order of passes ()
2020-09-22 16:39:00 +09:00