Commit Graph

328 Commits

Author SHA1 Message Date
Donny
bf69cd554b chore: Publish crates 2021-12-07 18:03:14 +09:00
Donny/강동윤
4a7937d56e
fix(es/minifier): Don't create top level variables (#2985)
swc_ecma_minifier:
 - Add `module` to `TerserCompressorOptions`.
 - Don't create top level variables while inlining if `module` is false.
 - Drop more unused parameters.
2021-12-07 18:02:43 +09:00
Donny
7d4c372e8a chore: Publish crates 2021-12-07 15:19:11 +09:00
OJ Kwon
32f9369958
perf(es/compat): Migrate static_blocks to VisitMut (#2973) 2021-12-07 15:18:53 +09:00
Donny
82ece9d0ca chore: Publish crates 2021-12-07 15:15:08 +09:00
RiESAEX
ae4bb420ae
fix(es/transforms): Update helpers about array (#2970)
swc_ecma_transforms_base:
 - Update helpers. (Closes #2689)
2021-12-07 06:12:54 +00:00
Donny
b1a47ee971 chore: Publish crates 2021-12-07 14:34:44 +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
acc45e7c36 chore: Publish crates 2021-12-05 17:34:04 +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
16540fba75 chore: Publish crates 2021-12-05 16:30:42 +09:00
David Sherret
0a8a5a1c78
fix(es/typescript): transform namespace with multiple identifiers in name (#2952)
swc_ecma_transforms_typescript:
 - Allow using typescript namespace with mutli-identifer name. (Closes #2810)
2021-12-05 07:26:53 +00:00
Donny
529f980693 chore: Publish crates 2021-12-05 15:44:50 +09:00
Donny
58159d377c chore: Publish crates 2021-12-05 15:43:04 +09:00
David Sherret
97df4cef80
refactor(es/parser): Remove import_assertions from TsConfig (#2950) 2021-12-05 05:43:41 +00:00
Donny/강동윤
74363e0357
fix(webpack/ast): Preserve span (#2971) 2021-12-04 23:24:18 +09:00
Donny
fd2a788282 chore: Publish crates 2021-12-04 21:03:13 +09:00
OJ Kwon
89af8ab9a2
perf(es/compat): Migrate class_properties to VisitMut partially (#2966) 2021-12-04 11:57:52 +00:00
Donny/강동윤
2a01dd4b32
fix(webpack/ast): Reduce if statements (#2969) 2021-12-04 19:28:18 +09:00
Donny
42a93dd8ef chore: Publish crates 2021-12-04 11:53:14 +09:00
David Sherret
67280b6fb0
fix(es/typescript): Run resolver before typescript::strip (#2951)
swc_ecma_transforms_base:
 - `resolver`: Handle some typescript nodes.

swc_ecma_transforms_typescript:
 - `strip`: Use identifier span hygiene information for stripping types.
2021-12-04 02:35:16 +00:00
Donny
32e2f3e46c chore: Publish crates 2021-12-04 01:55:54 +09:00
David Sherret
beb2c73c2c
fix(swc/hygiene): Prefer not renaming top level variables (#2940)
swc_ecma_transforms_base:
 - `hygiene`: Use concept of depth to prevent renaming top level nodes.
2021-12-04 01:55:27 +09:00
Donny/강동윤
02322aaa99
chore: Make rust-analyzer faster (#2962) 2021-12-03 23:14:33 +09:00
Donny/강동윤
c346f12b32
fix(estree): Fix serialization of ObjectMethod (#2961)
swc_estree_ast:
 - Fix serialization of `ObjectMethod` for `acorn`.

swc_webpack_ast:
 - `ast_reducer`: Remove unused getter/setter properties.
2021-12-03 23:14:12 +09:00
Donny
fd8541eb9d chore: Publish crates 2021-12-03 21:23:06 +09:00
Donny/강동윤
4008a65b1e
fix(webpack/ast): Preserve more arguments of define calls (#2960) 2021-12-03 21:22:38 +09:00
Donny/강동윤
eda514bcc5
fix(webpack/ast): Fix amd support (#2959)
swc_webpack_ast:
 - `ast_reducer`: Preserve array literals in `define` calls.
2021-12-03 20:51:48 +09:00
Donny/강동윤
1eb62dc201
fix(webpack/ast): Remove more string literals (#2957) 2021-12-03 18:54:28 +09:00
Donny
348b6cf6f0 chore: Publish crates 2021-12-03 18:36:10 +09:00
OJ Kwon
084eebec84
refactor(es/compat): Migrate destructuring to VisitMut (#2947) 2021-12-03 09:27:58 +00:00
Donny
ef3ea6b467 chore: Publish crates 2021-12-03 17:25:44 +09:00
RiESAEX
99da4221ae
fix:(es/compat): Change order of passes (#2949)
swc_ecma_transforms_compat:
 - Run `shorthand` before `function_name` so we can infer name for method properties. (Closes #2150)
2021-12-03 17:20:35 +09:00
Donny
eade0374f2 chore: Publish crates 2021-12-02 17:23:50 +09:00
Pig Fang
3302d1733a
refactor(es/preset-env): Avoid unnecessary unwrap (#2943) 2021-12-02 08:03:28 +00:00
Donny
e8225a66a0 chore: Publish crates 2021-12-02 16:29:34 +09:00
David Sherret
4d993c26b6
fix(es/hygiene): Reduce renaming (#2938)
swc_ecma_transforms_base:
 - `hygiene`: Treat class methods and constructors as a scope.
2021-12-02 07:28:09 +00:00
Donny
36db1ed359 chore: Publish crates 2021-12-02 15:55:03 +09:00
RiESAEX
d8c8641e59 fix(es/parser, es/compat): transform tagged template with invalid escape sequence (#2939)
swc_ecma_parser:
 - Preserve more data for invalid escapes in template literals.

swc_ecma_transforms_compat:
 - Fix handling of template literals. (Closes #2674)
2021-12-02 15:49:45 +09:00
Donny
82c8694f4b chore: Drop freebsd for publishing 2021-12-02 11:37:40 +09:00
Donny/강동윤
0304c550a4
chore: Break cycles (#2941) 2021-12-02 10:44:27 +09:00
Donny
67dc0d3b94 chore: Publish crates 2021-12-02 10:08:22 +09:00
Austaras
1555ceb8a3
feat(es/transforms/compat): Add loose mode to parameters (#2911)
swc_ecma_utils:
 - Make `WrapperState` implement `Clone`.

swc_ecma_transforms_compat:
 - `paramters`: Fix handling of non-loose mode. (Closes #2800, Closes #2825)
2021-12-02 01:04:01 +00:00
Donny
4e214ce437 chore: Publish v1.2.116 2021-12-02 07:10:16 +09:00
Donny
3bf751ac4a chore: Publish crates 2021-12-02 03:33:26 +09:00
Alexander Akait
8781527751
fix(css/ast): Fix type definitions related to parsing unknown at-rules (#2922)
swc_css_ast:
 - Rename `FnValue` to `Function`.
2021-12-01 17:07:49 +00:00
Donny/강동윤
4539b3a610
fix(webpack/ast): Don't remove comparison of process.env.NODE_ENV (#2937) 2021-12-01 23:18:19 +09:00
Donny/강동윤
667dd1e95e
fix(webpack/ast): Fix ast reducer (#2936)
swc_webpack_ast:
 - Preserve string literals in `require`
2021-12-01 21:54:55 +09:00
Donny
f9cd49b845 chore: Publish crates 2021-12-01 21:26:31 +09:00
Donny
f8fcee1c46 chore: Publish crates 2021-12-01 21:26:01 +09:00
Donny/강동윤
9f5fc11a8f
fix(webpack/ast): Fix handling of define (#2935)
swc_webpack_ast:
 - Support `define` calls with `require` .
2021-12-01 21:25:46 +09:00
Pig Fang
8a55870ce5
feat(es/preset-env): Upgrade browserslist-rs (#2927) 2021-12-01 12:18:11 +00:00
Donny/강동윤
24de5507ae
fix(bundler): Use interop for common js dependencies (#2930)
swc_bundler:
 - Update helpers to use interop for common js deps. (Closes #2789)
2021-12-01 19:53:06 +09:00
Donny
1fabb0381a chore: Publish crates 2021-12-01 18:36:26 +09:00
Alexander Akait
0f4ad0f8c8
fix(css/ast): Fix type definition of @namespace (#2919) 2021-12-01 09:29:25 +00:00
Donny
563c63c225 chore: Publish crates 2021-12-01 15:32:22 +09:00
Donny/강동윤
18d9fd91f9
fix(webpack/ast): Fix span of null literals (#2925)
swc_webpack_ast:
 - Preserve original spans for injected `null` literals
2021-12-01 15:31:56 +09:00
Donny
86d2cebd37 chore: Publish v1.2.115 2021-12-01 14:20:52 +09:00
Donny
b6f92497bf chore: Publish crates 2021-11-30 20:20:38 +09:00
OJ Kwon
5999634952
feat(plugin/runner): Supports specifying exact path for plugin (#2918) 2021-11-30 11:19:26 +00:00
Donny
e6957ce400 chore: Publish crates 2021-11-30 19:40:27 +09:00
OJ Kwon
4075ff8029
perf(es/transform/compat): Migrate optional_chaining to VisitMut (#2891) 2021-11-30 10:00:56 +00:00
Donny/강동윤
854b598e94
fix(webpack/ast): Improve ast reducer (#2917) 2021-11-30 18:16:05 +09:00
Donny
12d31c997b chore: Publish crates 2021-11-30 13:53:41 +09:00
RiESAEX
0c1f2ebdde
fix(es/transforms/compat): Fix destructuring (#2904)
swc_ecma_transforms_compat:
 - `desturcturing`: Fix non-loose mode. (Closes #2841, Closes #2863)
2021-11-30 04:49:54 +00:00
Donny
073c3787f1 chore: Publish crates 2021-11-30 13:11:36 +09:00
Donny/강동윤
028d0ce2c6
fix(es/transforms/compat): Fix block scoping (#2916)
swc_ecma_transforms_compat:
 - `block_scoping`: Track if we are in nested loops.
 - `block_scoping`: Don't treat `break` nor `continue` in nested loops as leaper. (https://github.com/vercel/next.js/issues/31757, Closes #2799, Closes #2915)
 - `block_scoping`: Don't recurse into nested loops while looking for functions. (Closes #2622)
2021-11-30 13:11:09 +09:00
Donny
57fb69262d chore: Publish crates 2021-11-30 11:25:38 +09:00
Alexander Akait
fcd0d7a6cb
feat(css/ast): Add a flag to number types (#2905)
swc_css_ast:
 - Add a flag to distinguish integer and floats.
2021-11-30 01:54:10 +00:00
Donny
9b022dbabe chore: Publish crates 2021-11-30 10:04:41 +09:00
Donny/강동윤
32b68ef5d0
fix(webpack/ast): Fix ast reducer (#2914)
swc_webpack_ast:
 - Implement more rules.
 - Test using typescript test suites.
2021-11-30 10:04:08 +09:00
Donny
167798b599 chore: Publish crates 2021-11-30 09:41:40 +09:00
Donny
666e3cc71e chore: Revert #2907 2021-11-30 08:42:45 +09:00
Donny
655d754d0e chore: Publish crates 2021-11-30 03:55:52 +09:00
Donny
3211ad23cf chore: Publish crates 2021-11-30 00:27:19 +09:00
Alexander Akait
d7183d82e2
feat(css/parser): Add more error recovery (#2849) 2021-11-30 00:26:57 +09:00
Donny/강동윤
435faccc2e
chore: Reduce compile time (#2909) 2021-11-30 00:16:28 +09:00
Donny/강동윤
586ab0cf76
fix(webpack/ast): Adjust acorn options. (#2908)
swc_babel_ast:
 - Fix serialization of class properties.
 - Adjust `acorn` options.
2021-11-29 21:08:22 +09:00
Donny
edc0cb0a2d chore: Publish crates 2021-11-29 19:39:11 +09:00
Alexander Akait
c77ebbeb8d
feat(css/ast): Add support for nested @at-rules (#2897) 2021-11-29 19:38:49 +09:00
Donny
a46ee17281 chore: Publish crates 2021-11-29 19:30:33 +09:00
Pig Fang
5a68a360b4
fix(es/preset-env): Enable "mobile to desktop" (#2907) 2021-11-29 19:29:49 +09:00
Donny
756a9bad6a chore: Publish crates 2021-11-29 16:48:34 +09:00
Pig Fang
af216c1014
chore(es/preset-env): Upgrade browserslist-rs (#2889) 2021-11-29 16:48:07 +09:00
Donny
3d75b9a968 chore: Publish crates 2021-11-29 16:47:27 +09:00
such0624
c186aa443a
fix(es/parser): Fix parser (#2903)
swc_ecma_parser:
 - Fix `skip_ts_parameter_start`. (Closes #2160)
2021-11-29 07:46:14 +00:00
Donny/강동윤
bb66083f69
fix(swc): Unimplement Default for JsMinifyOptions (#2901) 2021-11-28 18:57:48 +09:00
Donny
188eaad24e chore: Publish crates 2021-11-28 18:09:28 +09:00
Jeremy Grieshop
6f05c101f1
fix(es/transforms/module): Fix overriding of export * (#2883)
swc_ecma_transforms_module:
 - Emit correct value for `_exportNames`. (Closes #2101)
2021-11-28 09:08:02 +00:00
Donny
875c421259 chore: Publish crates 2021-11-28 17:36:47 +09:00
Donny/강동윤
91ef3cc16e
feat(plugin): Enable plugin support under experimental flag (#2894)
swc_plugin_runner:
 - Add plugin resolver.
 - Implement cache for resolver.
 - Add some integration tests.

swc:
 - Add a cargo feature named `plugin`.
 - Add an experimental option for plugins.

node:
 - Enable `plugin`.
 - Add some integration tests.
2021-11-28 17:02:14 +09:00
Donny/강동윤
5425509208
feat(swc): Implement Default for JsMinifyOptions (#2899) 2021-11-28 10:12:02 +09:00
Donny
2485c97317 chore: Publish crates 2021-11-28 02:04:19 +09:00
Alexander Akait
c94735e540
fix(css): Handle custom properties properly (#2869)
swc_css_codegen:
 - Fix code generation of custom properties.

swc_css_parser:
 - Fix parsing of custom properties.
2021-11-27 16:11:40 +00:00
Donny/강동윤
ffcb357010
feat(plugin): Rename Plugin to JsPlugin (#2893)
swc_js_plugin_api:
 - Rename to js plugin.
 - Use rplugin and plugin ast instead of json.
2021-11-27 22:21:25 +09:00
Donny/강동윤
ddc3aca3f0
fix(swc): Fix handling of jest option (#2892)
swc:
 - Merge `jsc.transforms.hidden.jest`.
2021-11-27 21:30:09 +09:00
Donny
0d39521b91 chore: Publish crates 2021-11-27 17:51:10 +09:00
OJ Kwon
283074c86e
perf(es/transforms/compat): Migrate spread to VisitMut (#2888) 2021-11-27 08:49:37 +00:00
Donny
035b6d83da chore: Publish crates 2021-11-27 17:04:26 +09:00
Donny/강동윤
f5af22ef71
chore: Document features (#2890) 2021-11-27 16:55:42 +09:00
OJ Kwon
7bccbcc880
fix(node): Fix parseFile (#2881) 2021-11-27 07:20:54 +00:00
Donny
01d4139e42 chore: Publish crates 2021-11-27 15:53:05 +09:00
Austaras
803787ab9e
fix(es/transforms/compat): Fix arrow (#2882)
swc_ecma_transforms_compat:
 - Handle arrow expressions in constructors of classes with a super class. (Closes #2811)
2021-11-27 06:46:02 +00:00
Donny/강동윤
c6cb790cd9
feat(css/minifier): Initialize crate (#2884) 2021-11-27 14:33:33 +09:00
Donny
ad8dc4ded6 chore: Publish crates 2021-11-27 00:01:32 +09:00
OJ Kwon
43e89fd0c8
fix(es/transforms/module): Fix detection of helpers to inject (#2868) 2021-11-26 15:00:44 +00:00
Donny
72e892ec12 chore: Publish crates 2021-11-26 23:29:33 +09:00
OJ Kwon
a350d86c57
refactor(es/transforms/compat): Improve async_to_generator (#2876)
swc_ecma_transforms_compat:
 - `async_to_generator`: Remove explicit bindings for object properties.
2021-11-26 12:26:20 +00: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
a38889be91 chore: Publish crates 2021-11-26 08:31:11 +09:00
David Sherret
b853d4ac95
feat(es/parser): Implement more error recovery (#2874)
swc_ecma_parser:
 - Recover from unterminated string literals.
2021-11-25 23:12:40 +00: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
730e138925 chore: Publish crates 2021-11-25 16:17:34 +09:00
RiESAEX
a6398e9f26
fix(es/transforms/compat): Fix destructuring (#2866)
swc_ecma_transforms_compat:
 - Check length correctly. (Closes #2819, Closes #2821, Closes #2843)
2021-11-25 06:51:59 +00:00
Donny
2c9de7dd4a chore: Publish crates 2021-11-25 15:22:34 +09:00
Alexander Akait
c40e134713
fix(css/parser): Fix span of type selectors (#2870) 2021-11-25 05:47:24 +00:00
Donny/강동윤
28850eef5c
chore: Allow using #[doc(cfg)] (#2871) 2021-11-25 14:16:18 +09:00
Donny
62a48875bd chore: Publish crates 2021-11-25 14:14:43 +09:00
Alexander Akait
ce6c7ee85d
fix(css/ast): Fix AST definitions for @keyframes (#2848) 2021-11-25 04:59:40 +00:00
Donny
e04f0867fc chore: Publish crates 2021-11-24 17:04:09 +09:00
Alexander Akait
4bf1f93017
refactor(css/lexer): Follow spec more closely (#2839) 2021-11-24 07:56:07 +00:00
Donny
1cc4de3e9b chore: Publish v1.2.112 2021-11-24 15:07:18 +09:00
Donny
770da5ae9e chore: Publish crates 2021-11-24 15:05:46 +09:00
RiESAEX
cf777c5ba1
fix(es/lexer): Fix lexing of hexadecimal escape sequences (#2838) 2021-11-24 05:26:38 +00:00
Donny
a8bda3bb9c chore: Publish crates 2021-11-24 13:54:33 +09:00
OJ Kwon
1609580a4e
perf(es/transforms/compat): Migrate computed_props to VisitMut (#2857) 2021-11-24 04:49:45 +00:00
Donny
d4ffce13b5 chore: Publish crates 2021-11-24 10:08:01 +09:00
Austaras
fbcbeb4892
refactor(es/transforms/compat): Lift this replacer out of arrow (#2812)
swc_ecma_utils:
 - Add `FunctionWrapper`, which tracks `this` and `arguments`.

swc_ecma_transforms_compat:
 - `arrow`: Use `FunctionWrapper` instead of tracking `this` by itself.
 - `async_to_generator`: Use `FunctionWrapper` instead of tracking `this` by itself.
2021-11-24 00:59:06 +00: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
e4216a2e6c chore: Publish crates 2021-11-23 21:10:35 +09:00
Alexander Akait
839a99e7fd
feat(css/parser): Improve parser api (#2847)
swc_css_parser:
 - Allow parsing as more types.
2021-11-23 11:53:58 +00:00
Donny
c1e99eee3e chore: Publish crates 2021-11-23 19:07:48 +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
Donny
e99c4d26ae chore: Publish crates 2021-11-23 18:14:38 +09:00
erdmko
c8de935560
fix(bundler): Ignore require of external modules (#2840)
swc_bundler:
 - Check for external modules for `require` calls`. (Closes #2275)
2021-11-23 18:03:29 +09:00
Donny/강동윤
d0cabc37ed
chore: Publish babel crates (#2835) 2021-11-22 21:41:03 +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
7ec522f165 chore: Publish crates 2021-11-22 17:55:07 +09:00
黄伟
c5768d7672
feat(es/minifier): Improve drop_console (#2830)
swc_ecma_minifier:
 - Implement more rules for `drop_console`. (Closes #2807)
2021-11-22 17:54:36 +09:00
Yoshiaki Togami
bfa6458737
chore: Typo (#2829) 2021-11-22 05:03:41 +09:00
Donny
46e722559e chore: Publish crates 2021-11-22 01:02:49 +09:00
Donny/강동윤
79ba13cbb5
fix(es/parser): Fix comments of empty modules (#2828)
swc_ecma_parser:
 - Use correct span for storing comments when module is empty.
2021-11-22 01:02:28 +09:00
Donny
a392a4c0fd chore: Publish crates 2021-11-21 23:43:31 +09:00
Donny/강동윤
9525ea178f
fix(es/parser): Fix span of empty modules (#2827)
swc_ecma_parser:
 - Don't use dummy span for empty modules.
2021-11-21 23:42:36 +09:00
Donny/강동윤
7a6bf424c5
fix(es/transforms/base): Fix ts_resolver (#2826)
swc_ecma_transforms_base:
 - `ts_resolver`: Hoist type aliases.
2021-11-21 16:31:12 +09:00
Donny
96d8ee522c chore: Publish crates 2021-11-21 16:30:42 +09:00
OJ Kwon
a9a9833be8
perf(es/transforms/compat): Migrate block_scoping to VisitMut (#2817) 2021-11-21 07:30:11 +00:00
Donny
218a269bb5 chore: Publish crates 2021-11-21 15:48:05 +09:00