Commit Graph

310 Commits

Author SHA1 Message Date
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
강동윤
a368f66e77 Bump version 2020-10-29 15:44:12 +09:00
강동윤
32b3bbd50b
Emit only ascii (#1191)
swc_ecma_codegen:
 - Emit only ascii characters. (#1187, #1188)
2020-10-29 14:33:33 +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
Brad Dunbar
26c530b133
Invalid template escape in ES2018+ (#1175)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-20 00:17:20 +09:00
Brad Dunbar
fd760fbf09
parser: Remove unnecessary question mark (#1174) 2020-10-19 11:19:56 +09:00
강동윤
a5e6242601 Bump version 2020-10-14 14:39:51 +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
강동윤
e4ddfcc899
export * as ns is part of ES2020 (#1142)
swc_bundler:
 - Add direct support for `export * as ns from 'foo';`. (#1137)

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
강동윤
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
강동윤
4490e2551d
swc.rs (#1085)
Changes url from https://swc-project.github.io to https://swc.rs
2020-09-21 22:53:48 +09:00
강동윤
0972db98a1
parser: Parse member expression is object patterns (#1068) 2020-09-12 18:39:25 +09:00
강동윤
eb2162cbd2
Fix stack overflow (#1032)
swc_ecma_codegen:
 - Fix codegen of large binary expressions.

swc_ecma_parser:
 - Fix stack overflow while parsing large binary expressions.

swc_ecma_transforms:
 - typescrip::strip: Fix stack overflow while handling large binary operations.
 - hygiene: Fix stack overflow by migrating it to `VisitMut`.
 - hygiene: Improve performance.
 - fixer: Fix stack overflow by migrating it to `VisitMut`.
 - resolver: Migrate to `VisitMut`.
2020-09-06 15:09:02 +09:00
강동윤
a2960810ac
Add BigInt literal type (#1020) 2020-09-03 10:50:13 +09:00
강동윤
8e237288d7
Migrate to napi (#1009) 2020-08-30 15:29:42 +09:00
강동윤
9f2120ed4b
Improve performance of parser (#1004) 2020-08-27 21:33:34 +09:00
강동윤
b25ccc006c
Improve performance (#993) 2020-08-26 20:50:18 +09:00
강동윤
511dc54961
Fix codegen of VisitMut for Option (#996)
swc_visit:
 - Fix codegen of VisitMut for Option
2020-08-25 16:29:11 +09:00
강동윤
e3faea25b6
Improve performance of swc (#992)
swc_ecma_parser:
 - Make macros uses match instead of `PartialEq`

swc_ecma_codegen:
 - Move panic condition
2020-08-24 10:42:12 +09:00
강동윤
c475ab7f92 Bump versions 2020-08-21 20:06:37 +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
강동윤
3262052e33
Improve performance and reduce binary size (#973)
spack:
 - Optimize resolver

swc_bunder:
 - Parallize merging of reexports
 - Remove useless `clone`s

swc_ecma_utils:
 - Migrate DropSpan to VisitMut

swc_ecma_transforms:
 - Migrate simple transforms to VisitMut
 - Ignore types to reduce binary size
 - Hide actual types so that we can optimize it in future without breaking change

swc_visit:
 - Apply transforms for vector in-place
 - Apply transforms for box in-place
2020-08-19 01:29:49 +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
강동윤
d2b8916f9f
Fix more typescript bugs (#924)
swc_ecma_parser:
 - Fix parsing of binding identifier `await`

swc_ecma_transforms:
 - More tests for typescript::strip
 - Handle export declare class properly
 - Remove declared variables
 - Fix enums in if statement
 - Fix sequence expression in class member key
 - Fix await in extend-clause
 - Fix optional array pattern
 - Fix optional object pattern
2020-08-02 15:06:22 +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
강동윤
a74eace7e2 Bump version 2020-07-30 00:56:23 +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
강동윤
a9adb0a208
Fix parsing of comment (#857) 2020-06-22 22:03:51 +09:00
강동윤
cae9286af0 Bump versions 2020-06-20 17:43:24 +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
강동윤
28456d0b49
Default value for options.jsc.parser.syntax (#840) 2020-06-13 02:05:49 +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