Commit Graph

35 Commits

Author SHA1 Message Date
Donny/강동윤
a6d404a8c2
chore(repo): Configure prettier (#4523) 2022-05-04 14:25:28 +00:00
Donny/강동윤
2563c7f8ff
chore(es/minifier): Improve scripts (#4339) 2022-04-17 19:53:47 +09:00
Donny/강동윤
2002554fa2
refactor(es/minifier): Clean up logging (#4322) 2022-04-13 23:23:07 +09:00
那里好脏不可以
37a8c90750
chore(*): Typo + fomatting (#4304) 2022-04-11 18:45:58 +00:00
Donny/강동윤
40b8a4e596
feat(common): Implement a pretty error reporter (#3946) 2022-03-13 19:07:18 +00:00
Donny/강동윤
b22d084180
test(es): Add an execution test system (#3994)
Description:

As we have a way to verify that input is behaving identically, we create a huge matrix of compile options and process the input with all of those options.

This system can be used to check for fixed issues easily.
For first, someone can add issues using a unix hidden directory, which starts with `.`. Those tests are ignored by `testing::fixture`.
Then, when something is changed, one can run `./scripts/check-issues.sh`. If a test succeeds, it means it's fixed and the starting dot (`.`) of the path to the test input file is removed.
2022-03-13 07:47:39 +00:00
Donny/강동윤
fcbd3c5c58
fix(api/rust): Fix transform comment api (#3962) 2022-03-11 05:46:49 +00:00
Donny/강동윤
8b3aa6d3aa
perf(es/minifier): Remove needless type parameter (#3897) 2022-03-08 10:04:14 +00:00
Donny/강동윤
292add7d26
fix(es/minifier): Make sequences less aggressive (#3480)
swc_ecma_minifier:
 - `sequences`: Abort on RHS contains the left id.
2022-02-08 19:10:22 +09:00
Donny/강동윤
210ecf83bb
feat(es/minifier): Drop more expressions from parallel optimizer (#3303)
swc_ecma_minifier:
 - `pure`: Implement more rule for dropping useless expressions.
2022-01-18 16:45:47 +09:00
Donny/강동윤
e8670b3383
refactor(es): More fix for clippy (#3280) 2022-01-16 14:33:06 +09:00
Donny/강동윤
88a258a5fb
fix(es/react): Fix createElement (#3277)
swc_ecma_transforms_react:
 - Fix arguments passed to `_createElement`. (https://github.com/vercel/next.js/issues/33291)
2022-01-15 21:55:58 +09:00
Donny/강동윤
978de5943e
chore(ci): Configure clippy (#3250) 2022-01-13 23:06:11 +09:00
Donny/강동윤
0105939426
fix(es/minifier): Drop unreachable statements eagerly (#3204)
swc_ecma_minifier:
 - `pure`: Drop unreachable statements. (Closes #3173)
2022-01-06 21:25:06 +09:00
Donny/강동윤
bf751cb690
feat(es/ast): Add rkyv support (#3166)
ast_node:
 - `#[ast_node]`: Add support for `rkyv`.

swc_common:
 - Add a feature flag for `rkyv`.

swc_ecma_ast:
 - Add a feature flag for `rkyv`.
2022-01-02 16:23:37 +09:00
Donny/강동윤
017392aa5b
feat(node-swc): Add cargo feature for v2 (#3019)
swc_node_bundler:
 - Add cargo features for versioned apis.

node-swc:
 - Add cargo features for versioned apis.
2021-12-12 22:52:58 +09:00
Donny/강동윤
e48263b2f3
refactor(visit): Remove &dyn Node from Visit (#2984)
swc_visit_macros:
 - Remove `&dyn Node` from `Visit`.
 - Implement `VisitWith<V>` for `[T]`.
2021-12-07 14:34:16 +09:00
Donny/강동윤
f052a65bf3
fix(es/compat): Preserve constructor parameters (#2975)
swc_ecma_visit:
 - Add cargo feature `debug`.
 - Add more context for `tracing` when `debug` is enabled.

swc_ecma_utils:
 - Add some logging.

swc_ecma_transforms_compat:
 - Add some logging.
 - `destructuring`: Don't drop patterns. (Closes #2139)

testing:
 - Enable logging by default.
 - Configure logging for `Tester`.
2021-12-06 20:08:50 +09:00
Donny/강동윤
694d3c5072
feat(es/minifier): Print more informantion on infinite loops (#2976)
swc_ecma_minifier:
 - Remove `OptimizerState`.
 - Dump source code if pass is over 200.
2021-12-06 19:47:02 +09:00
Donny/강동윤
1ea965cecb
fix(es/parser): Drop outdated options (#2974)
swc_ecma_parser:
 - Drop flags in `EsConfig`.
 - Drop flags in `TsConfig`.
 - Drop unused variants from `SyntaxError`.
2021-12-05 17:33:34 +09:00
Donny/강동윤
ffec782a41
chore: Inline @swc/helpers (#2972) 2021-12-05 15:46:09 +09:00
Donny/강동윤
c6cb790cd9
feat(css/minifier): Initialize crate (#2884) 2021-11-27 14:33:33 +09:00
Donny/강동윤
cdef843369
feat(es/estree): Allow emitting acorn ast (#2859)
swc_estree_ast:
 - Add `Flavor`.
 - Adjust serialization based on `Flavor`.

swc_estree_visit:
 - Remove.

testing:
 - Add `diff_json`.

testing_macros:
 - `#[fixture]`: Print input.
2021-11-25 20:16:46 +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/강동윤
2c099bfd2c
feat(es/preset_env): Use browserslist-rs (#2845)
swc_ecma_preset_env:
 - Fix `default_path`.
 - Use `browserslist-rs` for query. (Closes #2781)
2021-11-23 19:07:16 +09:00
KnorpelSenf
2e018769c2
chore: Fix typo (#2764) 2021-11-16 14:39:07 +00: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/강동윤
380722976a
feat(plugin): Proxy swc_common apis (#2646)
swc_common:
 - Add `Runtime` trait for plugin.
 - Implement `serde` for diagnostics.
 - Proxy diagnostics using `Runtime`.
 - Proxy `HygieneData::with` with `Runtime`.
 - Add implementation of `Runtime` with cargo feature `plugin-rt`.
 - Make `Runtime` implement `StableAbi`.

swc_plugin:
 - Move api code to `swc_plugin_api`.
 - Depend on `swc_common/plugin-mode`.
 - Configure `Runtime` before invoking custom transforms.
 - Use `bincode` for serde.

swc_plugin_runner:
 - Depend on `swc_common/plugin-rt`.
 - Pass `Runtime` implementation to the plugins.
 - Use `bincode` for serde.
2021-11-04 19:24:49 +09:00
Donny/강동윤
3280b4cd7a
refactor(es/parser): Deprecate JscTarget (#2600)
swc_ecma_parser:
 - Deprecate `JscTarget`.
2021-10-31 12:25:15 +00:00
Donny/강동윤
0364f9a2ae
feat(es/transforms/testing): Reduce CI time by caching execution result (#2565)
swc_ecma_transforms_testing:
 - Cache execution test result on CI.
2021-10-28 04:00:25 +00:00
Donny/강동윤
709b3c7cd6
fix(es/transforms/optimization): Fix inline_globals (#2524)
swc_ecma_transforms_optimization:
 - `inline_globals`: Skip assignment to `process.env.FOO`. (#2499)
2021-10-24 21:51:08 +00:00
Donny/강동윤
26944e159d
fix(es/transforms/base): Reimplement hygiene (#2408)
swc_ecma_transforms_base:
 - Reimplement `hygiene`.
2021-10-21 05:12:50 +00: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/강동윤
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/강동윤
123c1f5d02
chore: Fix typo (#2472) 2021-10-19 08:25:57 +00:00