Commit Graph

115 Commits

Author SHA1 Message Date
강동윤
511dc54961
Fix codegen of VisitMut for Option (#996)
swc_visit:
 - Fix codegen of VisitMut for Option
2020-08-25 16:29:11 +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
강동윤
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
강동윤
9b8bfb2455
Use stable rustc (#886) 2020-07-24 02:18:22 +09:00
강동윤
a2369be5b2
Fix random panic (#876) 2020-07-02 13:10:44 +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
강동윤
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
강동윤
31020e46d8
spack: enhancement (#845)
- Handle modules (via swcrc)
 - swc.bundle([conf1, conf2])
 - Correct chunking
2020-06-15 23:28:15 +09:00
강동윤
c73e454478
Fix source map (#835) 2020-06-11 16:26:04 +09:00
강동윤
65f2faa339
Reduce stack usage (#776) 2020-05-17 18:50:52 +09:00
Gurwinder Singh
8f72cac3a3
Directly map the box contents without unsafe (#772) 2020-05-16 14:54:02 +09:00
FabianWolff
e06a577096
Preserve commits starting with "!" when minifying (#690) (#753)
Closes #690
2020-04-22 12:36:33 +09:00
강동윤
09279432c4
Do not depend on hashbrown (#744) 2020-04-03 10:33:35 +09:00
강동윤
432d7993a3
Handle input source map (#734) 2020-03-27 14:40:01 +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
강동윤
165a2091f9 Fix hygiene 2020-03-03 16:19:45 +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
강동윤
15bef97278
VisitMut<T> and VisitMutwith<F> (#680)
This is a groundwork for dts generator.
2020-02-19 23:13:08 +09:00
강동윤
53d09d448e
Handle await-for loop just like babel (#676) 2020-02-18 12:27:13 +09:00
강동윤
4a92f5751a
CI improvement (#674) 2020-02-18 11:36:56 +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
강동윤
26eb4e3206
Collect all comments (#633)
- Comments are now appended
 - pin dashmap's version
2020-02-07 14:32:43 +09: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
강동윤
11d056c777
Extract FromVariant (#586)
Move FromVariant to a separate crate
2020-01-15 18:00:08 +09:00
강동윤
43c3ee7771 Bump version 2020-01-15 09:16:33 +09:00
강동윤
05b7328002 lint 2020-01-02 13:29:19 +09:00
강동윤
94a81c9492 Make .take_all() efficient 2020-01-02 13:28:30 +09:00
David Sherret
bac1cb52a3 Add a take_all() method to Comments. (#552) 2020-01-02 13:21:43 +09:00
강동윤
702800e0d9
Attach comments to correct node (#541) 2019-12-28 22:02:58 +09:00
강동윤
b98f17b84d Bump versions 2019-12-26 08:53:13 +09:00
David Sherret
32860576f2 Comment and TokenAndSpan - Implement Spanned (#534) 2019-12-26 08:35:43 +09:00
강동윤
31a5bed497
Legacy decorator for class and class members (#531) 2019-12-25 19:30:16 +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
강동윤
6186af04a9
Fix handling of jsx texts (#519)
swc_ecma_transforms:
 - Fix handling of jsx texts (#517)
2019-12-21 16:59:04 +09:00
강동윤
332061f44d
Parser: respect jsc.target (#507)
swc:
 - make parser respect `jsc.target`.
2019-12-14 18:51:08 +09:00
kdy1
3ec395ba75 Improve performance & update rustfmt (#504) 2019-12-13 06:21:25 +00:00
Zimon Dai
ec086a1dab use 2018 edition syntax (#479) 2019-12-02 17:10:05 +09:00
강동윤
776e014a11
Fix tests (#478) 2019-12-01 18:11:59 +09:00
강동윤
0d5da173d2 Remove loc from span 2019-11-30 14:51:22 +09:00
강동윤
265eb9e30c
Improve performance of serialization and deserialization (#475) 2019-11-30 14:49:18 +09:00
강동윤
a7a8a4a2e4
Plugin (#473)
swc_common:
 - apply patch from rust-lang/rust#59693

swc:
 - use &Options instead of Options
 - configures commons::CM
 - exposes `handler`
2019-11-29 23:46:06 +09:00
강동윤
55b473b744 #[serde(transparent)] for SyntaxContext 2019-11-28 20:04:50 +09:00
강동윤
4ab510827a Fix serde of BytePos 2019-11-28 19:55:14 +09:00
강동윤
b46c4ec300
Update dependencies (#464) 2019-11-24 14:17:27 +09:00