강동윤
09279432c4
Do not depend on hashbrown ( #744 )
2020-04-03 10:33:35 +09:00
강동윤
da97acca20
Bump
2020-03-10 00:35:53 +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
강동윤
6e028696a5
Faster sourcemap generation for large files ( #697 )
...
We buffer operations related to source map and make it fast using an assumption that the byte positions always increment while emitting a file.
2020-03-02 20:49:08 +09:00
강동윤
8f280c535c
Performance ( #696 )
...
- Parser performance is improved by ~15%
- Codegen performance is improved by ~90% (when comment and source map is enabled)
2020-03-01 20:05:03 +09:00
David Sherret
0e8c5a6c93
Fix assignment pattern start when there is a type annotation ( #693 )
...
- Update dashmap to 3.5.1
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-02-29 10:29:34 +09:00
강동윤
1cf86b059d
Fix bugs ( #687 )
...
- stript type-only export default
- allow `continue` in a for loop
2020-02-22 14:49:04 +09:00
강동윤
e709da9d55
Fix SourceMap ( #672 )
...
Previously, `SourceMap` (taken from rustc) has a bug which reuses start position when new_source_file is invoked concurrently.
2020-02-17 15:56:41 +09:00
강동윤
348052b017
Improve optimizer ( #660 )
...
Although it's quite naive at the moment, I added two optimization passes.
- dead code elimination (Closes #607 )
- inlining
2020-02-13 11:45:14 +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
강동윤
26eb4e3206
Collect all comments ( #633 )
...
- Comments are now appended
- pin dashmap's version
2020-02-07 14:32:43 +09:00
alubbe
45604fa6e7
Remove dependency renaming to enable WASM ( #625 )
...
This PR supercedes https://github.com/swc-project/swc/pull/621 and tries to remove dependency renaming to enable WASM, as discussed in https://github.com/swc-project/swc/issues/106
2020-02-05 11:20:25 +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
강동윤
5503cde085
Extract utils from swc_ecma_transforms ( #575 )
...
swc_ecma_transforms:
- extract utils
2020-01-08 10:55:22 +09:00
강동윤
806a6d97da
Regenerator ( #554 )
...
swc_ecma_transforms:
- implement regenerator pass
- add regenerator pass to es2015 preset
swc_ecma_preset_env:
- add regenerator
2020-01-02 20:53:06 +09: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
강동윤
702800e0d9
Attach comments to correct node ( #541 )
2019-12-28 22:02:58 +09:00
강동윤
3cf1caa4b1
Bump version
2019-12-28 14:05:12 +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
강동윤
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
강동윤
6186af04a9
Fix handling of jsx texts ( #519 )
...
swc_ecma_transforms:
- Fix handling of jsx texts (#517 )
2019-12-21 16:59: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
kdy1
3ec395ba75
Improve performance & update rustfmt ( #504 )
2019-12-13 06:21:25 +00:00
강동윤
ae6de87abb
Add more tests ( #489 )
2019-12-09 21:02:51 +09:00
Zimon Dai
ec086a1dab
use 2018 edition syntax ( #479 )
2019-12-02 17:10:05 +09:00
강동윤
153cf36168
Jsonify large pure object literals ( #477 )
...
swc_ecma_transforms:
- add `jsonify` transform
2019-12-01 17:32:44 +09:00
강동윤
fc9880e4f4
Bump parser's version
2019-11-24 14:42:08 +09:00
강동윤
b46c4ec300
Update dependencies ( #464 )
2019-11-24 14:17:27 +09:00
Jasper De Sutter
716bfe05b2
Cleanup ( #448 )
...
- cargo fix
- update all crates to 2018 edition
2019-11-17 13:21:53 +09:00
강동윤
167008de6f
Expose tokenizer ( #437 )
...
swc_common:
- Added input::Input
swc_ecma_parser:
- Made lexer public
- Make input type of parser generic
- Added example of using lexer
2019-11-06 13:14:44 +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
강동윤
9f1fca55ff
Update rustc toolchain to nightly-2019-09-30
2019-10-02 13:53:56 +09:00
강동윤
febe34e280
Publish swc_ecma_transforms
2019-09-22 17:55:35 +09:00
강동윤
4f8220329f
publish
2019-09-20 13:41:11 +09:00
강동윤
a1c2538338
hashbrown & comment revamp
2019-06-25 09:41:58 +09:00
강동윤
b5bbbc0cd6
publish atoms
2019-05-02 16:06:42 +09:00
강동윤
0b4f06027d
Version
2019-05-02 16:02:45 +09:00
강동윤
ed64a60cb3
Publish ast / codegen /transforms
2019-05-02 15:50:21 +09:00
강동윤
cdf4a09e65
Fixes ( #283 )
...
swc_ecma_transforms:
- Remove State / Clone
- Fix hygiene bug of labels (#281 )
- Fix sequence expression in unary expression (#282 )
2019-02-27 22:40:19 +09:00
강동윤
e419d7d378
Cache react config ( #224 )
...
swc_ecma_transforms:
- global codemap / parser session for config parsing
- cache parsing result of react pass
- InjectHelpers pass does not require source map
2019-02-17 17:11:21 +09:00
강동윤
7fe2245a3d
Cleanup ( #152 )
...
- replace Lrc with std::sync::Arc
swc_common:
- make swc_common::sync private
- improve MoveMap
swc_ecma_codegen:
- fix codegen of import.
swc_ecma_transforms:
- properly detect valid identifier.
swc_ecma_parser:
- Fix parsing of cond expr inside paren.
2019-02-11 11:39:20 +09:00
강동윤
4c6c4bc595
Make Helper scoped thread local ( #134 )
...
This allows injecting helpers per file without any multi threading issue.
2019-02-05 14:15:38 +09:00
강동윤
a1629d3997
Implement module transforms ( #133 )
...
swc_ecma_ast:
- implement more `From<T>` for `Expr`
swc_ecma_transforms:
- fnv -> fxhash
- implement common js imports
- improve fixer
- use js_word! instead of &*sym
- add noop pass
- handle state correctly
- ExprFactory::member(), computed_member()
2019-02-05 12:50:19 +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
강동윤
b9eb110549
Cache compiled helpers
2019-01-15 11:53:43 +09:00
강동윤
1710bb6e8a
Allow using Pass
as a trait object
2019-01-14 17:54:42 +09:00
강동윤
603b83291d
jsx support ( #100 )
...
swc_ecma_parser:
- implement parser for jsx
swc_ecma_transforms:
- implement react::jsx transform
swc_ecma_codegen:
- implement code generator for jsx
2018-12-30 11:57:27 +09:00
강동윤
4ff6d4ed4a
Performance & Node binding ( #84 )
...
swc_common:
- update rustc-ap crates to v313
swc_ecma_ast:
- use bool instead of Option<Span>
swc_ecma_parser:
- remove LexerInput
- use uncons_while
- assert only on debug mode
- use Visit instead of Fold while verifying
- replace debug! with trace!
- disable logging while benchmarking
- drop slog
swc_ecma_transforms:
- classes: fold Decl instead of Stmt
swc:
- add nodejs binding
2018-12-21 16:54:36 +09:00