Commit Graph

58 Commits

Author SHA1 Message Date
강동윤
c83d19eb2f
feat(ecmascript): Remove macros (#1319)
swc_ecma_ast:
 - Drop dependency on `enum_kind`.

swc_ecma_parser:
 - Remove `swc_ecma_parser_macros`.
2021-01-05 21:39:24 +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
강동윤
08c5d83d20 Bump version 2020-12-27 13:22:02 +09:00
강동윤
34249bbf47
feat(ecmascript/ast): Add EqIgnoreSpan and TypeEq (#1295) 2020-12-27 13:11:44 +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
Brad Dunbar
4327d91fe3
BigInt literal keys (#1192) 2020-11-15 01:22:35 +09:00
강동윤
a368f66e77 Bump version 2020-10-29 15:44:12 +09:00
강동윤
11d137ac11
ast: Add support for fuzzing (#1167)
swc_common:
 - Add support for fuzzing.

swc_ecma_ast:
 - Add support for fuzzing.
2020-10-15 14:58:11 +09:00
강동윤
a5e6242601 Bump version 2020-10-14 14:39:51 +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
강동윤
a2960810ac
Add BigInt literal type (#1020) 2020-09-03 10:50:13 +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
강동윤
c475ab7f92 Bump versions 2020-08-21 20:06:37 +09:00
강동윤
2de59759de
Reduce size (#928)
Reduce binary size and make some dependencies optional for deno
2020-08-04 01:33:23 +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
강동윤
de1f967d32
Store span of ?. in an optional chaining expression (#907)
Add OptChainExpr.question_dot_token
2020-07-28 02:15:04 +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
강동윤
9b8bfb2455
Use stable rustc (#886) 2020-07-24 02:18:22 +09:00
David Sherret
d4ede122fc
Fix span of MethodProp (#877)
- Fix span of MethodProp (needs to include async keyword).

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-07-07 12:49:36 +09:00
강동윤
c0917839a5
Add empty to class member (#875) 2020-07-05 20:10:33 +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
강동윤
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
Gurwinder Singh
5f261fcd5c
Rename Import and Export Node names (#777)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-05-17 19:15:31 +09:00
David Sherret
8b4fc59805
Support template literals in types (#767) 2020-05-16 17:19:48 +09:00
강동윤
6f4e534c88 Bump versions 2020-03-10 10:39:42 +09:00
강동윤
e448a8910c
Fix bugs (#710)
- The parser now supports parsing optional patterns in .d.ts files (Closes #709)
 - The source map is handled properly (Closes #705, Closes #707)
2020-03-09 21:18:41 +09:00
강동윤
cb43a69e02
implement { Hash, Eq } for ast nodes (#684)
As NaN is`IIdent` not `Number`, we can use implement Hash and Eq for ast nodes.
2020-02-21 12:47:06 +09:00
kdy1
82e73b1121 Fix bugs (#659)
- Strip out const assertions (Closes #656)
 - Fix exclude of the file matcher (Closes #658) 
 - Automatic typescript detection (Closes #655)
2020-02-12 15:07:45 +00:00
강동윤
8afa3413ea
Remove dependency on lazy_static and chashmap (#617)
- `lazy_static` is replaced by `once_cell`
 - `chashmap` is replaced by `dashmap`
2020-01-30 23:29:12 +09:00
kdy1
96e1dbe213 Improve hygiene and use JSXAttrValue (#592)
swc_ecmacript:
 - use JSXAttrValue (Fixes #584)

swc_ecma_transforms:
 - make hygiene pass check for exported vars (Fixes #591)
2020-01-17 05:45:33 +00:00
강동윤
916858ae81
Bugfixes (#549)
swc_ecma_ast:
 - fix TsExprWithTypeArgs (closes #548)

swc_ecma_codegen:
 - allow using default import with namespace import (closes #546)

swc_ecma_parser:
 - parse import.meta (closes #545)
2020-01-01 06:57:34 +09:00
강동윤
b1e4122b02
Nullish coalescing / optional chaining / comments (#529)
swc_ecma_ast:
 - rename `TsOptChain` to `OptChainExpr` (Fixes #525)
 - add `BinOp::NullishCoalescing`

swc_ecma_parser:
 - parse `??` (Fixes #526)

swc_ecma_transforms:
 - remap comments from fixer (Fixes #528)
2019-12-24 17:01:32 +09:00
강동윤
d8541c4f63 Fix a bug 2019-12-23 14:37:25 +09:00
강동윤
24b5c44ba3
Numeric separator & Bigint (#523)
swc_ecma_ast:
 - `BigInt` literal

swc_ecma_parser:
 - numeric separators. (#521)
 - parsing of bigint literal
2019-12-22 17:14:04 +09:00
강동윤
30af06bb70
Ast (#513)
swc_ecmascript:
 - add `ExprStmt`.
 - change type of regex.expression and regex.flags.
2019-12-16 18:08:21 +09:00
강동윤
f9a649ff7a Bump version 2019-12-15 08:15:26 +09:00
강동윤
b46c4ec300
Update dependencies (#464) 2019-11-24 14:17:27 +09:00
강동윤
ae3326cd9d
Compiler apis & .swcrc improvement (#434)
- Expose high-level compiler apis (#431)
 - Support multiple entries in .swcrc (#414)
2019-10-25 10:11:24 +09:00
강동윤
4a41140854 Bump versions 2019-10-23 22:20:00 +09:00
강동윤
c7abda95d4
typescript const assertion (#419)
Fixes #401.
2019-09-18 22:54:12 +09:00
강동윤
ed64a60cb3 Publish ast / codegen /transforms 2019-05-02 15:50:21 +09:00
강동윤
a46804ab48 swc_ecma_ast:
- Split class member / property into separate types
2019-02-28 19:25:38 +09:00
강동윤
10cb9a4b21
Publish (#278)
- swc_macros_common@0.2.0
 - ast_node@0.4.1
 - string_enum @0.2.0 
 - swc_ecma_ast@0.8.0
 - swc_ecma_parser_macros@0.3.0
 - swc_ecma_codegen_macros@0.3.0
 - swc_ecma_parser@0.9.1
 - swc_ecma_parser@0.6.1
2019-02-27 10:42:22 +09:00
강동윤
dff2cb8f75
Implement deserialize for ast nodes (#274)
string_enum:
 - #[derive(StringEnum)] now derives `Deserialize`

swc_ecma_ast:
 - implement deserialize for ast nodes.
 - change ast to make it serialized / deserialized correctly

swc_ecma_parser:
 - jsx, test262, typescript tests now verify serialization and deserialization of module
2019-02-24 14:12:04 +09:00
강동윤
76ce98b685
Implement serialize for ast nodes (#244)
swc_common:
 - implement Serialize / Deserialize for span

swc_ecma_parser:
 - use json instead of {:#?} while testing
 - update test references
2019-02-20 11:35:41 +09:00
강동윤
c648232864
Classes improvements (#123)
Now swc passes all tests from `@babel/plugin-transform-classes`
2019-01-24 16:07:09 +09:00
강동윤
eebf14fbef
Allow stable rust (#118)
This pr introduces some cargo features. For `swc_common` and `swc_ecma_ast`, it introduces a feature flag `fold`.
`Fold` and `Visit` traits exist only if the feature is enabled.

For `swc_ecma_parser`, flag called `verify` is added. When disabled, we skip checking of validity of some expressions.

e.g. `{foo = bar}`

Verification is disabled by default it requires nightly compiler
2019-01-17 23:17:16 +09:00
강동윤
d4fefa8615
Reduce binary size (#116)
- remove unused debug impls
2019-01-10 18:23:25 +09:00