Commit Graph

20 Commits

Author SHA1 Message Date
Donny/강동윤
9ba68c6863
fix(common): Fix sourcemap ()
swc_common:
 - Include the index to the name in `mappings` of a sourcemap.

swc:
 - Fix handling of `inputSourceMap`.
2021-10-18 06:43:59 +00:00
Donny/강동윤
3d204b44f0
perf(es/transforms): Make transforms parallel ()
swc_ecma_utils:
 - `collect_decls`: More parallel.

swc_ecma_transforms_macros:
 - Add `Parallel`, which is helper for `#[parallel]`.
 - Add `ParExplode`, which is helper for `#[parallel(explode)]`.

swc_ecma_transforms_macros:
 - Add `#[parllel]`.

swc_ecma_transforms_compat:
 - `sticky_regex`: Parallel.
 - `typeof_symbol`: Parallel.
 - `for_of`: Remove exponential visit.
 - `regenerator`: Remove exponential visit.
 - `object_spread`: Parallel.
 - `instance_of`: Parallel.
 - `duplicate_keys`: Parallel.
 - `logical_assignments`: Parallel.
 - `template_literal`: Parallel.
 - `block_scoped_functions`: Migrate to `VisitMut`.
 - `for_of`: Migrate to `VisitMut`.
 - `destructuring`: Reduce `Visit`.
 - `arrow`: Migrate to `VisitMut`.
 - `function_name`: Parallel.
 - `reserved_words`: Parallel.
 - `for_of`: Parallel.

swc_ecma_transforms_module:
 - `import_analyzer`: Migrate to `VisitMut`.

swc_ecma_transforms_react:
 - `jsx_src`: Parallel.
-  `jsx_self`: Migrate to `VisitMut`.
-  `jsx_self`: Parallel.

swc_ecma_transforms_proposal:
 - `export_default_from`: Migrate to `VisitMut`.

swc_ecma_transforms_optimization:
 - `inline_globals`: Parallel.
 - `json_parse`: Migrate to `VisitMut`.
 - `json_parse`: Parallel.
2021-10-18 00:03:30 +09:00
Donny/강동윤
4c983e9158
perf(es/codegen, es/parser): Improve performance ()
ast_node:
 - Make `.span()` inlinable.

swc_ecma_codegen:
 - Reduce call to *heavy* `.span()` calls.

swc_ecma_parser:
 - Reduce `memmove` by using typed-arena.

swc_bundler:
 - Make `Bundle.bundle` take `&mut self`.
 - Make drop concurrent.
2021-10-15 12:49:37 +09:00
Donny/강동윤
6d35e7c28d
fix(swc): Fix order of custom passes ()
swc:
 - Invoke `resolver` and `typescript::strip` before applying user passes.
2021-10-05 20:46:49 +00:00
Donny/강동윤
fac6f47863
perf(es/transforms): Improve performance ()
swc_ecma_ast:
 - Implement `Take` for `Function`.
 - Implement `Take` for `FnExpr`.
 - Implement `Take` for `ClassExpr`.

swc_ecma_transforms_compat:
 - Migrate `es2015::duplicate_keys` to `VisitMut`.
 - Migrate `es2015::template_literals` to `VisitMut`.
 - Migrate `es2015::function_name` to `VisitMut`.
 - Add more fast-path to `reserved_words` pass.

swc_ecma_transforms_react:
 - Reduce allocations of `pure_annotations`.
 - Migrate `pure_annotations` to `VisitMut`.
 - Migrate `jsx::display_name` to `VisitMut`.

swc_ecma_transforms_optimization:
 - Migrate `inline_globals` to `VisitMut`.
 - `inline_globals`: Use `Lrc<FxHashMap<K, V>>`.

swc:
 - Cache `current_dir()`.
 - `ModuleConfig::build`: cacnonicalize only if `paths` is used.
2021-10-05 13:31:35 +00:00
Donny/강동윤
6a41e9a0be
fix(es): Fix performance bugs ()
swc_common:
 - Optimize `SourceMap.span_until_char`.

swc_ecma_codegen:
 - Make `Emitter` generic.

swc_ecma_parser:
 - `Lexer`: Reuse allocation of `String`.
 - `Lexer`: Avoid copying useless data.
2021-09-29 12:10:38 +00:00
강동윤
48d61039d2
fix(common, node/swc): Allow inlining sourcesContent ()
swc_common:
 - Allow setting `sourceContents` of source map files. ()

swc:
 - Support `inlineSourceContents`. ()
2021-09-14 02:31:32 +00:00
강동윤
d975a197c9
fix(es): Fix source map ()
swc:
 - Fill `names` of sourcemap.
 - Don't add `sourceContents` to sourcemap if `sources` is added.

node_swc:
 - Handle source map for `minify` correctly.
 - `minify`: Accept `{ filename: code }`.
2021-08-26 10:44:38 +00:00
강동윤
879a0f39a8
feat(swc): Implement format.comments of terser ()
swc:
 - `minify`: Support `format.comments`.
 - `process_js`: Support `jsc.minify.format.comments`.
2021-08-17 14:34:37 +00:00
LongYinan
fe2a063525
perf(node/swc): Use mimalloc () 2021-08-13 18:39:13 +09:00
강동윤
c6dce67494
fix(swc): Report error correctly ()
swc_common:
  - Add some utilities for `Handler`.

swc:
 - Remove `Compiler.handler`.
 - Accept `handler` for each operations. ()
2021-08-13 07:05:40 +00:00
강동윤
e916b35dd2
feat(node/swc): Support sourceFileName ()
swc:
 - Support `sourceFileName`.
2021-08-03 00:49:34 +09:00
강동윤
104be9837b
fix(es/transforms): Fix transforms ()
swc_ecma_transforms_compat:
 - `regenerator`: Use es6 import while folding module. ()
 - `typeof_symbol`: Handle `undefined` specially. ()
 - `regenerator`: Do not create useless codes. ()
 - `typeof_symbol`: Migrate to `VisitMut`.

swc_ecma_transforms_module:
 - Add `import_hoister`.
 - Improve import analyzer. ()
 - Allow overriding `export *` wth named exports. ()

swc_ecma_transforms_testing:
 - Add a hack for `regenerator-runtime`.

swc:
 - Run import analyzer ahead of time. ()

misc:
 - Downgrade rustc to the version rust-analyzer supports.
2021-07-10 11:18:28 +00:00
강동윤
19bcb06f73
fix(swc): Fix source path of a source map file ()
swc:
 - Use `output_path` to make sourcemap path relative to the `.map` file. ()
2021-07-08 07:32:06 +00:00
강동윤
35af4c5186
chore: Publish v1.2.63 & Update rustc () 2021-07-05 12:51:09 +00:00
강동윤
2211a9908a
fix(swc): Fix various bugs ()
swc:
 - Improve error message for invalid configs. ()

swc_common:
 - Handle input source map correctly. ()

swc_ecma_parser:
 - Fix parsing of generics type declarations when tsx is enabled. ()

swc_ecma_transforms_compat:
 - Allow using carriage return. ()
2021-04-08 12:55:02 +00:00
강동윤
ddc9492aed
fix(es/transforms): Handle enum in namespaces ()
swc_ecma_transforms_typescript:
 - Handle enums in namespaces. ()

swc:
 - Exclude files based on .swcrc.
2021-01-18 23:00:53 +09:00
강동윤
2e29d78281
fix: Decorator metadata ()
swc_ecma_transforms:
 - Emit proper typename for `design:type` used with enum. ()
2020-12-04 05:03:26 +09:00
강동윤
57112fc42b
Improve transforms ()
swc_ecma_transforms:
 - Fix `this` in optional chaining expression. (https://github.com/Brooooooklyn/swc-node/issues/62)
 - Optimize typescript stripper
 - Optimize fixer
2020-09-06 19:47:15 +09:00
강동윤
b25ccc006c
Improve performance () 2020-08-26 20:50:18 +09:00