Commit Graph

224 Commits

Author SHA1 Message Date
OJ Kwon
ffb2ee85e6
fix(node-swc): Correctly close trace spans after completion (#3811) 2022-03-02 10:03:00 +00:00
Pig Fang
66c6cae8dc
feat(css/lints): Add CSS linter (#3765) 2022-02-27 15:31:19 +00:00
Donny/강동윤
fe0ddcc54b
feat(es/quote): Implement quasi quoter partially (#3155) 2022-02-27 13:21:38 +00:00
Donny/강동윤
80ed69d67d
chore(build): Disable LTO for local builds (#3514) 2022-02-10 17:35:15 +09:00
Donny/강동윤
74b433080b
refactor(es/minifier): Remove unused crates (#3395) 2022-01-28 20:17:08 +09:00
OJ Kwon
432d5d3fb7
feat(plugin/macro): Add safe API for plugins based on a proc-macro (#3240) 2022-01-12 09:32:52 +00:00
Donny/강동윤
c34f1a977f
chore(ci): Fix publish script (#3197)
swc_plugin_runner:
 - Use patched version of `cranelift-codegen`.
2022-01-06 17:03:28 +09:00
OJ Kwon
32d3342283
refactor(plugin): Remove codes related to the plugin system based on abi_stable (#3188) 2022-01-04 10:26:17 +00:00
Donny/강동윤
c758997180
refactor(dbg-swc): Rename esdiff to dbg-swc (#3189) 2022-01-04 18:39:43 +09:00
Donny/강동윤
1aa55e616a
feat(es/diff): Add a internal CLI program for debugging minifier (#3168) 2022-01-02 19:55:12 +09:00
Donny/강동윤
ff0b55b778 feat(es/diff): Initialize a diff tool for ecmascript (#3101)
swc_ecma_diff:
 - Initialize the project.
2021-12-23 22:01:56 +09:00
OJ Kwon
2e89a4f5a8
feat(cli): Setup packages for CLI (#3070) 2021-12-20 06:03:00 +00:00
Donny/강동윤
f21af5bcd6
feat(es/lints): Implement simple validations (#2763)
swc_ecma_lint:
 - Implement `const-assign`. (Closes #2016)
 - Implement `duplicate-bindings`. (Closes #2795)
 - Implement `duplicate-exports`. (Closes #3056)

swc:
 - Use linter.
2021-12-19 21:07:51 +09:00
Donny/강동윤
c2bbdbe9d6
feat(webpack): Add ast reducer (#2875)
swc_estree_compat:
 - Fix stack overflow related to object patterns.

swc_webpack_}ast:
 - Implement AST reducer.
2021-11-26 15:04:41 +09:00
Donny/강동윤
790a262c07
refactor(es/estree): Rename: babel => estree (#2846)
swc_babel_ast:
 - Rename as `swc_estree_ast`.

swc_babel_compat:
 - Rename as `swc_estree_compat`.

swc_babel_visit:
 - Rename as `swc_estree_visit`.
2021-11-24 05:34:41 +09:00
Donny/강동윤
6b96a3d8ed
feat: Enable logging of timings (#2833)
swc_timer:
 - Add `Timer`.
 - Add `timer!()`.

node:
 - Enable logging.
2021-11-22 21:01:08 +09:00
Donny/강동윤
1d518fe381
refactor: Flatten css (#2731) 2021-11-12 19:37:05 +09:00
Donny/강동윤
2b2f6955f2
refactor: Flatten ecmascript (#2708) 2021-11-10 19:00:54 +09:00
Donny/강동윤
4f70ee6d98
refactor: Flatten more packages (#2706) 2021-11-10 16:39:01 +09:00
Donny/강동윤
687305f280
refactor: Flatten crates (#2697) 2021-11-09 20:42:49 +09:00
Donny/강동윤
bf0007bec0
feat(rplugin): Implement general AST processing plugin system (#2671)
swc_common:
 - Implement `StableAbi` for `BytePos`.
 - Implement `StableAbi` for `Span`.

rplugin:
 - Add `StableAst`.

swc_plugin_api:
 - Drop unused dependencies.

swc_ecma_plugin_ast:
 - Initialize crate.
2021-11-09 18:46:24 +09:00
Donny/강동윤
22ce68cfaa
fix(swc): Don't print same error twice (#2692) 2021-11-09 15:18:11 +09:00
Donny/강동윤
3dc1e765e9
feat(swc): Provide &Program to pass creator (#2665)
swc:
 - Use `impl |prorgram: &Program| -> impl Fold` instead of `impl Fold`. (Closes https://github.com/swc-project/swc/issues/2664)
2021-11-06 18:05:10 +09:00
Donny/강동윤
994c9655c8
feat(es/ast): Add utils (#2657)
swc_ecma_ast:
 - Add `as_ident` to `PatOrExpr`.
 - Add `as_ident_mut` to `PatOrExpr`.
 - Replace `Is` macro for `ParOrExpr` with custom impl.
2021-11-05 16:09:08 +09:00
Donny/강동윤
3280b4cd7a
refactor(es/parser): Deprecate JscTarget (#2600)
swc_ecma_parser:
 - Deprecate `JscTarget`.
2021-10-31 12:25:15 +00:00
Donny/강동윤
e589d00f62
refactor: Move HANDLER to swc_common (#2599)
swc_common:
 - Add `HANDLER`.

swc_ecma_utils:
 - Replace `HANDLER` with one from `swc_common`.
 - Make `StmtLike` `: Send + Sync`.
2021-10-31 20:41:36 +09:00
Donny/강동윤
33bc3d2b91
feat(es/transforms/regenerator): Allow configuring import path (#2581)
swc_ecma_transforms_compat:
 - `regenerator`: Allow configuring import path of `regenerator-runtime`.
2021-10-29 14:36:11 +00:00
Donny/강동윤
4b2903e3b4
fix(es/minifier): Fix minifier (#2564)
swc_ecma_minifier:
 - Don't change depth of function while negating if statements. (#2558)

swc_ecma_transforms_optimization:
 - `dead_branch_remover`: Preserve `this`. (#2465, #2466)

swc:
 - Make `toplevel` default to true if `module` is true. (#2254)
2021-10-28 04:35:45 +00:00
Donny/강동윤
8494f6583c
fix(swc): Allow overriding specified parser config using .swcrc (#2547)
swc:
 - Merge parser config by enabling each feature. (#2546)
2021-10-26 22:39:06 +00:00
Sosuke Suzuki
65c83e8cb4
feat(es/transforms): Move stage 4 proposals to es2022 (#2519) 2021-10-24 21:28:40 +09:00
Donny/강동윤
fce3b79e79
fix(es/minifier): Improve name mangler (#2509)
swc_ecma_transforms_base:
 - Expose renamer.

swc_ecma_minifier:
 - Improve name mangler.

swc:
 - Disable hygiene if mangler is enabled.
2021-10-24 10:52:09 +00:00
Sosuke Suzuki
ecd617af39
feat(es/transforms): Move class_properties to es2022 (#2512) 2021-10-23 23:25:14 +09:00
Donny/강동윤
ecf0d7507c
feat(swc): Allow removing filename from error output (#2498)
swc:
 - Add an option to exclude filename from error messages.
2021-10-21 04:45:12 +00:00
Donny/강동윤
eef3d6e3fb
fix(es): Fix simple bugs (#2495)
swc_ecma_parser:
 - Don't panic on `declare declare`. (#2343)

swc_ecma_transforms_react:
 - Don't panic on `createElement()`. (#2492)

swc_bundler:
 - Don't panic on wasm. (#2334)

swc:
 - Disable `inline_globals` if it's not specified. (#2490)
2021-10-20 06:12:21 +00:00
Donny/강동윤
b0361caa58
feat(es/transforms/optimization): Improve inline_globals (#2479)
swc_ecma_transforms_optimization:
 - `inline_globals`: Support inlining into shorthand properties.
 - `inline_globals`: Support replacing member expressions.

swc:
 - Add an option to disable simplifier when using `inline_globals`.

node_swc:
 - Improve error message on panic.
2021-10-19 14:58:10 +00:00
Donny/강동윤
2ca6e5d79b
feat(es/transforms/optimization): Support inlining of typeofs (#2473)
swc_ecma_transforms_optimization:
 - `inline_globals`: Support inlining of `typeof`s.

swc:
 - Change error message for parsing failure to mention `Syntax Error`.
2021-10-19 09:49:18 +00:00
Donny/강동윤
123c1f5d02
chore: Fix typo (#2472) 2021-10-19 08:25:57 +00:00
Donny/강동윤
c9437d3226
fix(es): Fix bugs (#2469)
swc:
 - Fix handling of `envs`.
 - Check for already fixed issues. (#2319)
2021-10-19 06:02:46 +00:00
Donny/강동윤
28f2c7ae5d
feat(swc): Accept map for envs (#2467)
swc:
 - Support specifying map to global inlining pass.
2021-10-19 05:13:21 +00:00
Donny/강동윤
575aa44c25
perf(es/transforms): Improve performance (#2454)
swc_ecma_transforms_macros:
 - `#[parallel]`: Run hooks for single-threaded operations.

swc_ecma_transforms_compat:
 - `shorthand`: Parallel.
 - `exponentation`: Parallel.
 - `parameters`: Parallel.
 - Recover some `#[fast_path]`
2021-10-18 12:07:13 +00:00
Donny
ac772403b2 chore: Add include to swc 2021-10-18 16:49:21 +09:00
Donny/강동윤
9ba68c6863
fix(common): Fix sourcemap (#2457)
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
7225f90b9c Bump version 2021-10-18 11:09:59 +09:00
Donny/강동윤
3d204b44f0
perf(es/transforms): Make transforms parallel (#2449)
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/강동윤
1645bb30b7
perf(es/transforms): Reduce usage of #[fast_path] (#2442)
swc_ecma_ast:
 - Implement `Take` for `ObjectLit`.
 - Implement `Take` for `ArrayLit`.

swc_ecma_transforms_compat:
 - `nullish_coalescing`: Remove exponential visit.
 - `nullish_coalescing`: Migrate to `VisitMut`.
 - `optional_chaining`: Reduce exponential visit. (But it's not removed)
 - `class_properties`: Remove exponential visit.
 - `jsx_src`: Migrate to `VisitMut`.
 - `optional_chaining`: Mae it parallel.
 - `async_to_generator`: Remove `#[fast_path]`.
 - `arrow`: Remove `#[fast_path]`.
 - `destructuring`: Remove `#[fast_path]`.
 - `block_scoped_functions`:  Remove `#[fast_path]`.
 - `classes`: Remove `#[fast_path]`.
2021-10-16 08:12:02 +00:00
Donny/강동윤
130a47f42c
feat(es/transforms/module): Add an option to preserve dynamic imports (#2441)
swc_ecma_transforms_module:
 - Add `ignoreDyanmic`.
2021-10-15 19:19:14 +09:00
Donny/강동윤
4c983e9158
perf(es/codegen, es/parser): Improve performance (#2406)
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/강동윤
51d7a144bb
fix(swc): Fix order of passes (#2427)
swc_ecam_transforms_typescript:
 - Preserve more jsx-related imports.

swc:
 - Change pass ordering.
2021-10-13 16:04:49 +00:00
Donny/강동윤
76de51333d
fix(es/transforms): Fix for react + typescript (#2422)
swc_common:
 - Add `NoopComments`.
 - Implement `Comments` for `Option<C>` where C: `Comments`.
 - Add some helper methods to `Comments`.
 - Deprecate `CommentsExt`.

swc_ecma_transforms_base:
 - `resolver`: Handle `TsImportEqualsDecl`.

swc_ecma_transforms_react:
 - Reduce useless cloning using `Arc`.
 - Expose API for parsing directives like `@jsxPragma`.

swc_ecma_transforms_typescript:
 - Accept `pragma` and `pragmaFrag`.
 - Support jsx directives.
 - Preserve jsx-related imports.

swc:
 - Optimize `SwcComments`.
 - Run`resolver` before everything else.
2021-10-13 22:29:56 +09:00
Donny/강동윤
98cc79a2be
fix(es/minifer): Fix bugs (#2397)
swc_ecma_codegen:
 - Fix sourcemap of `export` tokens.
 - Fix codegen of numeric operands in left of a binary expression.
 - Fix codegen of unary operations.

swc_ecma_minifier:
 - Visit `AssignPatProp.valie`.
 - Move `inline_prevented` to analyzer.
 - Add `Ctx.dont_invoke_iife`.
 - `iife`: Check for `arugments`

swc:
 - `inline_sources_content`: true by default for `minify()`.
2021-10-11 07:44:42 +00:00