Commit Graph

176 Commits

Author SHA1 Message Date
강동윤
5ad57b02f2
fix(es/parser): Fix bugs (#1405)
swc_ecma_parser:
 - Parse generics in class methods with special name properly.
2021-02-17 01:47:00 +09:00
강동윤
9dabf00200
fix(es): Fix bugs (#1395)
swc_ecma_codegen:
 - Implement `emit_ts_type_assertion`.
 - Implement `emit_ts_type_cast_expr`. 
 - Implement `emit_ts_ns_export_decl`.
 - Implement `emit_ts_signature_decl`.

swc_ecma_parser:
 - Ensure that we report an error for invalid input. (#1391)

swc_ecma_transforms_base:
 - fixer: Handle `await (await foo)()`. (#1397)
2021-02-14 22:18:05 +09:00
강동윤
bf445a75c4
fix(swc): Fix bugs (#1372)
swc_ecma_ast:
 - Support import assertions for exports.

swc_ecma_parser:
 - Support import assertions for exports.

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

spack:
 - Re-enable multi-entry tests.
2021-02-10 17:25:28 +09:00
강동윤
af25a88902
fix(swc): Fix bugs for v1.2.47 (#1368)
swc_ecma_parser:
 - Fix generic parsing issue in jsx context. (#1299)

swc_ecma_transforms_module:
 - Allow importing a module multiple time. (#1232)
 - Handle imports in the constructor of an exported class decl. (#1213)

swc:
 - Respect `sourceMappingURL`. (#1236)
 - Resolve `sourceMappingURL` relative from file. (#1255)
 - Respect `isModule: false` (#1258)

spack:
 - Support loading json files. (#1225)
2021-01-29 22:19:04 +09:00
David Sherret
4155822283
Fix span of arrow expression with type params (#1365)
swc_ecma_parser:
 - Fix span of arrow expression with type params.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-01-28 20:55:43 +09:00
강동윤
d4df2cece8
fix(es): Fix bugs (#1347)
swc_ecma_parser:
 - Do not emit strict mode error while backtracking. (#1252)

swc_ecma_transforms_proposal:
 - Handle decorator on methods with computed key.
2021-01-23 15:46:42 +09:00
강동윤
3faefb5836
feat(es): TypeScript 4.2 (#1330)
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
강동윤
842b6f953c
fix(ecmascript/transforms): Fix dce (#1301)
swc_bunder:
 - Fix `keywords` pass.

swc_ecma_codegen:
 - Ensure that the code generator handles unicode characters properly. (denoland/deno#8925)

swc_ecma_parser:
 - Ensure that the parser handles unicode characters properly. (denoland/deno#8925)

swc_ecma_transforms:
 - Fix dce.
2021-01-05 18:45:26 +09:00
강동윤
6941f29943
fix(swc): Fixes for typescript type checker (#1146)
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
Boris
c2a99944cf
feat(ecmascript/parser): Add tests for binding patterns (#1289) 2020-12-22 14:12:33 +09:00
강동윤
8a8db58f1c
fix(ecmascript): Fix bugs related to string literals (#1287)
swc_ecma_ast:
 - Add `Str.kind`.

swc_ecma_transforms:
 - Fix quotes in template literals. (#1280)

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

swc:
 - Ensure that #1271 is about napi's deserialization.
2020-12-22 04:27:18 +09:00
강동윤
0ead8dc403
fix(ci): Fix ci (OOM & library api change) (#1284) 2020-12-20 21:31:00 +09:00
강동윤
bf69b47791
fix(ecmascript/parser): Fix span of declare decls. (#1282)
swc_ecma_parser:
 - Include `declare` span. (#843)
2020-12-19 23:48:13 +09:00
강동윤
25856f230c
feat(parser): Don't hang on unexpected inputs (#1274)
swc_ecma_parser:
 - Don't hang on unexpected inputs. (#1272, denoland/deno#8719)
2020-12-14 16:37:11 +09:00
강동윤
4294b5e7ba
bundler: Fix issues (#1212)
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 #1211)

swc_ecma_transforms:
 -  dce: Prevent infinite loop
 -  Faster constant propagation pass.
2020-11-19 20:42:56 +09:00
Pig Fang
11dbc1406c
TypeScript 4.1: intrinsic keyword (#1193)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-29 18:37:22 +09:00
Pig Fang
5ef993d9b2
TypeScript 4.1: template literal type (#1190)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-29 17:27:35 +09:00
강동윤
b2aec35eb6
Fix issues (#1189)
swc_bundler:
 - Support emitting iife. (Closes #1184)

swc_ecma_parser:
 - Auto-detect script / module (Closes #1164)
 - lexer: Error recovery for strict mode and module mode.
 - More error recovery logic for strict mode violation.
 - Fix panic on invalid input. (Closes #1170)
2020-10-28 21:20:11 +09:00
Pig Fang
aded151b8f
[typescript] 4.1 mapped type 'as' clause (#1151)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-13 16:44:05 +09:00
강동윤
688d16f228
Import assertion / json modules (#1100)
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
강동윤
0972db98a1
parser: Parse member expression is object patterns (#1068) 2020-09-12 18:39:25 +09:00
강동윤
8e237288d7
Migrate to napi (#1009) 2020-08-30 15:29:42 +09:00
강동윤
e6191447fe
Typescript 4.0 (#982)
swc_ecma_parser:
 - Add support for optional tuple element (#978)
2020-08-21 19:31:46 +09:00
강동윤
993b77b325
Improve error messages (#980)
swc_ecma_parser:
 - Improve error messages
2020-08-21 14:57:16 +09:00
강동윤
2fedf32747
swc_bundler (#943)
swc_bundler:
 - Splitted from spack

swc_ecma_parser:
 - Fix unexpected eof problem which occurs if log level is trace

swc_ecma_transforms:
 - Fix bugs of dce pass

spack:
 - Support cyclic dependencies
2020-08-12 22:18:47 +09:00
강동윤
1315d58059
Fix bugs (#949)
swc_ecma_parser:
 - Allow `in` in class properties (#944)
 - Make `delete` with optional chaining valid (#947)

swc_ecma_transforms:
 - Add a `typescript_class_properties` pass (#930)
2020-08-09 16:45:00 +09:00
강동윤
34d475fbc8
Type annotation in catch binding (#942)
swc_ecma_parser:
 - Support catch binding with type anntation (Closes #941)
2020-08-07 13:04:35 +09:00
강동윤
76bcd3d7e4
More span tests (#935) 2020-08-05 12:34:44 +09:00
강동윤
2de59759de
Reduce size (#928)
Reduce binary size and make some dependencies optional for deno
2020-08-04 01:33:23 +09:00
강동윤
5baa636a4b
Chores (coverage, documentation, etc..) (#925) 2020-08-02 19:10:28 +09:00
강동윤
0ac55ae68b
Improve ux for rust users (#909)
testing:
 - Remove dependency on relative_path

swc_common:
 - Span's byte positions are now self-contained and `GLOBALS` is not required while parsing.
 - Changed `Comments` into a trait.
 - Provide single-threaded implementation of `Comments`
 - Cargo feature `tty-emiiter` (To remove tty related stuffs )
 - Cargo feature `sourcemap` (To remove sourcemap for web assets)
 - Removed dependency on dashmap

swc_ecma_parser:
 - No duplicated comments.
 - Removed dependency on once_cell and regex
 - Add a test suite to visualize and test span of nodes.

swc_ecma_utils:
 - Removed dependency on parser

swc:
 - Remove dependency on derive_more and path-clean
 - Add multi-threaded implementation of `Comments`

swc_ecmascript:
 - A new crate contains `ast`, `codegen`, `parser`, `utils`, `visit`.
2020-07-31 18:49:07 +09:00
Bartek Iwańczuk
9cb32cbb75
fix: readonly is not stripped from private prop (#916)
swc_ecma_codegen:
 - Fix printing logic of literals and template literals
 - Fix printing of hex

swc_ecma_parser:
 - Track raw string correctly

swc_ecma_transforms:
 - typescript: Handle class properties (readonly)
 - typescript: Handle enums inside function

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-07-30 22:40:43 +09:00
강동윤
727a0aaa25
Remove stupid assertion (#914) 2020-07-30 00:55:46 +09:00
강동윤
de1f967d32
Store span of ?. in an optional chaining expression (#907)
Add OptChainExpr.question_dot_token
2020-07-28 02:15:04 +09:00
강동윤
ea885df521
Fix bugs (#901)
swc_ecma_parser:
 - Accept `export type * from '../typings'` (#896)

swc_ecma_transforms:
 - Ensure that swc does not duplicate classes (#879)
2020-07-27 20:21:52 +09:00
David Sherret
b72901b5e0
Support parsing declare properties (#897)
swc_ecma_ast:
 - ClassProperty.declare

swc_ecma_parser:
- Parsing for declare class props.
- Error when parsing a private property with a declare modifier.

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-07-26 12:53:41 +09:00
강동윤
a1d33d023a
Improve ux using swc as a rust library (#893)
swc_ecma_parser:
 - Improve parser's error reporting story
 - Replace `Session`, `Handler`, `Emitter` with Parser.take_errors()
 - Expose `Error`
 - Remove useless lifetime parameters
2020-07-25 20:26:04 +09:00
강동윤
c7a5d5fef9
Fix class hygiene issue related to class properties (#892)
swc_ecma_transforms:
  - fixed hygiene bug of class_properties pass
2020-07-24 22:02:29 +09:00
강동윤
9b8bfb2455
Use stable rustc (#886) 2020-07-24 02:18:22 +09:00
강동윤
c0917839a5
Add empty to class member (#875) 2020-07-05 20:10:33 +09:00
강동윤
38adc49e7e
Bugfixes (#873)
swc_common:
 - Fix new_source_file

swc_ecma_parser:
 - Fix parsing of paren expr in lhs of an assignment
2020-07-01 16:31:55 +09:00
강동윤
f500e9528c
Parser for TypeScript 4.0 (#867)
- Allow rest in non-last elements in tuple type
 - Allow labelled ts type element in tuple type
 - More operators
2020-06-29 16:23:33 +09:00
강동윤
fe260a02e2
ES2020 (#855)
Adapt es2020. API is not changed, but config for merged proposals are now noop.
2020-06-20 15:09:57 +09:00
강동윤
d82e6ab69d
Fix parsing of class member named declare (#822) 2020-06-04 02:52:40 +09:00
강동윤
f912e9493b
Add some tests for parser (#819) 2020-06-03 23:37:15 +09:00
David Sherret
99c164b628
Fix type-only import declaration with empty named imports being parsed as having a default import specifier (#817)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-06-03 15:41:24 +09:00
강동윤
d7bb5c18ae
Fix parsing of type annotation (#816) 2020-06-03 12:19:05 +09:00
강동윤
0efba88e3f
Improve typescript parser (#811) 2020-06-02 19:22:41 +09:00
강동윤
65f2faa339
Reduce stack usage (#776) 2020-05-17 18:50:52 +09:00
강동윤
d74f74932e Support decorators on parameters (#775)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2020-05-16 22:36:52 +09:00