Commit Graph

1374 Commits

Author SHA1 Message Date
Donny/강동윤
e5f46a6800
fix(wasm): Fix bugs ()
swc:
 - Ensure that  is fixed. ()

wasm:
 - Fix `baseUrl` and `paths` support.
 - Apply `hygiene` pass.
2021-09-21 15:24:03 +00:00
Alexander Akait
b5ad03d0b1
fix(css/parser): Fix parsing of url ()
swc_css_parser:
 - Fix parsing of url values with space.
2021-09-21 23:52:28 +09:00
Pig Fang
4d500baaaa
fix(es/transforms/compat): Move the optional catch binding pass to ES2019 ()
swc_ecma_transforms_compat:
 - Move optional chaining pass to `es2019`.

Co-authored-by: Donny <kdy1997.dev@gmail.com>
2021-09-21 21:54:51 +09:00
Donny/강동윤
180dc31550
fix(es/transforms/base): Fix hygiene pass ()
swc_ecma_transforms_base:
 - `hygiene`: Consider nested scopes correctly. ()
 - `hygiene`: Fix handling of constructors.
2021-09-21 12:21:49 +00:00
Donny/강동윤
893fb087ae
chore: Add discord server link to README.md () 2021-09-21 08:39:04 +00:00
Alexander Akait
9eb45e8515
fix(css/parser): Allow @at-rules to be lowercased ()
swc_css_parser:
 - Allow lowercase for @at-rules.
2021-09-21 16:55:46 +09:00
Fábio Santos
3f306f0b79
fix(es/minifier): Don't drop used variables ()
swc_ecma_minifier:
 - Don't drop used variables. ()

Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
2021-09-21 16:45:28 +09:00
Fábio Santos
406fa3fc78
feat(es/minifier): Add CLI for debugging ()
swc_ecma_minifier:
 - Add a binary to help development.
2021-09-20 15:25:51 +09:00
Heyang Zhou
b82702cf0f
fix(swc): Remove global side effects for rust users. ()
swc:
 - Don't enable `log/release_max_level_info`.
 - Don't depend on `swc_node_base`.
2021-09-19 17:05:36 +09:00
David Sherret
8e0a5450b1
fix(es/codegen): Emit static before readonly () 2021-09-19 16:28:33 +09:00
강동윤
ce01b8a9b7
fix(es): Fix bugs ()
swc_ecma_codegen:
 - Fix source map of string literals. ()

swc_ecma_transforms_typescript:
 - Allow using same name for a module with function. ()
2021-09-18 07:52:08 +00:00
강동윤
f087d1515b
fix(es/transforms/testing): Fix comparing logic ()
swc_ecma_transform_testing:
 - Fix comparing logic.
2021-09-16 20:21:09 +09:00
강동윤
e2d8465565
fix(es/codegen): Fix codegen of ` in synthesized template literals ()
swc_ecma_codegen:
 - Fix codegen of ` in synthesized template string literals.
2021-09-16 09:26:02 +00:00
강동윤
20ce326909
feat(es/minifer): Improve minifier ()
swc_ecma_minifier:
 - `if_return`: Allow side-effect-free statements to come after `if_return`.
 - `collapse_vars`: Move variables without init to first.
 - `analyzer`: Remove useless fields.
 - Don't drop `return` tokens if there's a finally block.
 - `drop_return_value`: Drop side-effect-free return arguments.
 - `make_sequences`: Don't inject `void 0` to return args.
 - `if_terminate`: Move to the pure optimizer.
 - Fix a bug related to `RegExp`.
2021-09-16 04:23:33 +00:00
강동윤
ff389ca8d2 chore: Add a link to github sponers 2021-09-15 18:05:53 +09:00
강동윤
6f33c327cb
fix(es/transforms): Fix bugs ()
swc_ecma_transforms_compat:
 - Fix `this` in class properties. ()

swc_ecma_transforms_typescript:
 - Handle `import =` correctly. ()
 - Ensure that  is not the case anymore. ()

swc:
 - Ensure that  is not the case. ()
2021-09-15 07:46:03 +00:00
강동윤
cab37f8166
fix(ci): Publish () 2021-09-15 01:38:50 +09: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
Iron Lu
4ca85ec79c
feat(node/swc): Enable tsx automatically based on the extension () 2021-09-14 10:47:53 +09:00
Iron Lu
6e12ef0306
fix(es/transforms/compat): Add new.target to es5 () 2021-09-13 15:51:17 +09:00
강동윤
f78a504806
fix(ci): Publish v1.2.86 () 2021-09-11 09:36:06 +00:00
강동윤
9eafd0c6c4
fix(es/loader): Fix support for jsc.paths. ()
swc_ecma_loader:
 - `TsConfigResolver`: Use `baseUrl`. ()

swc:
 - Change type of `JscConfig.base_url` to `PathBuf`.

testing:
 - Improve `NormalizedOutput::compare_to_file`.
2021-09-10 12:29:26 +00:00
강동윤
9ffe47106a
fix(swc): Fix target ()
swc:
 - Fix `target` option. ()
2021-09-10 15:43:14 +09:00
강동윤
2c477780f0
fix(es): Fix bugs ()
swc_ecma_parser:
 - Don't panic on `typeof import(T)`. ()
 - Fix parsing of ternary. ()

swc_ecma_transforms_base:
 - `fixer`: Handle unary in lhs of an exponentation expression. ()

swc_ecma_transforms_compat:
 - Use variable for `this` in arrow expressions. ()

swc_ecma_visit:
 - Add a trait `InjectVars`.

node_swc:
 - Increease recursion limit while deserializing. ()
2021-09-09 20:45:20 +09:00
강동윤
a9573b9a5f
fix(css/parser): Fix parsing of selectors ()
swc_css_parser:
 - Allow parsing `foo` as selector.
2021-09-09 05:36:56 +00:00
강동윤
b4796d9d54
fix: Fix simple bugs ()
swc_ecma_utils:
 - Don't panic on jsx.

swc_ecma_transforms_typescript:
 - Drop type-only reexports. ()
2021-09-09 05:06:03 +00:00
강동윤
c8b46bf6db
feat(es/minifier): Implement more rules ()
swc_ecma_codegen:
 - Don't panic on `Pat::Invalid`.
 - Fix codegen of unary minus. ()

swc_ecma_minifier:
 - Remove identifier of function expressions if a variable with same name exists.
 - `sequences`: Merge into the argument of a throw statement.
 - Use `ignore_return_value` for `void` expressions.
 - Improve inlining.
 - Drop last `return` if the return value is not used.
 - `sequences`: Merge `c++; use(c)` as `use(++c)`.
 - `sequences`: Merge assignments with an operator.
 - `comparisons`: Optimize the comparison operator if type is equivalent.
 - Fix `negate_cost`.
 - `unused`: Fix order or variable initalizer when variables are dropped.
 - Fix `top_retain` option.
 - `if_return`: Don't merge nested if it's wrong to do so. ()
 - Fix negation of `if_return`.
2021-09-08 09:45:39 +00:00
강동윤
d8ae4c4e90
fix(css/parser): Fix parsing of selectors ()
swc_css_parser:
 - Remove `Parse<CompoundSelector>` implementation.
 - Add `Parse<ComplexSelector>` implementation.
 - Add `Parse<Vec<ComplexSelector>>` implementation.
 - Verify tokens input.
2021-09-08 01:19:14 +00:00
Sosuke Suzuki
cbc8230310
fix(es/parser): Fix parsing of static blocks ()
swc_ecma_parser:
 - Fix parsing of static blocks with line breaks. ()
2021-09-03 14:57:23 +09:00
Kitson Kelly
87f30b21a3
feat(common): Add variants to FileName () 2021-09-03 13:55:31 +09:00
강동윤
77be9f63b9
fix(swc): Improve rust apis ()
swc_ecma_transforms_testing:
 - Make `expected` not affect source map of input.

swc:
 - Accept `before` pass.
2021-09-01 23:34:37 +00:00
강동윤
cb2b0c671f
fix(es/transforms/base): Optimize hygiene ()
swc_ecma_transforms_base:
 - `hygiene`: Don't rename if not required. ()

swc_ecma_minifier:
 - Remove `hygiene_optimizer`.
2021-09-01 13:11:55 +00:00
muji
55f065b78a
doc(common): Improve doc of Take () 2021-09-01 12:52:07 +09:00
강동윤
a8cb554be5
feat: Expose .take() ()
swc_common:
 - Add `Take`. ()

swc_ecma_ast:
 - Implement `Take` for ast nodes. 

swc_ecma_transforms_base:
 - Remove `MapWithMut`.
2021-08-31 14:45:48 +00:00
David Sherret
99c35ff980
refactor(es): Use BlockStmt instead Vec<Stmt> for static blocks. ()
swc_ecma_ast:
 - Use `BlockStmt` instead of `Vec<Stmt>` for static blocks.

swc_ecma_parser:
 - Fix span of static blocks.
2021-08-31 16:12:18 +09:00
David Sherret
2f2e35af69
fix(es/parser): Remove static_blocks from TsConfig () 2021-08-31 14:52:51 +09:00
강동윤
d58642b70c
feat(common): Implement TypeEq and EqIgnoreSpan for tuples ()
swc_common:
 - Implement `TypeEq` and `EqIgnoreSpan` for tuples.
2021-08-30 12:44:46 +00:00
muji
361bc70065
fix(es/loader): Improve handling of base_dir () 2021-08-30 21:21:52 +09:00
강동윤
11fe35dbd1
feat(es/minifier): Implement static evaluator ()
swc_ecma_minifier:
 - Add an api to evaluate constants statically.
2021-08-30 05:21:38 +00:00
강동윤
ee16139a19
fix(es/transforms): Fix bugs ()
swc_ecma_transforms_compat:
 - `regenerator`: Fix variable hoisting for for-in/of loops. ()
 - Ensure  is fixed. ()
2021-08-30 04:08:24 +00:00
Sosuke Suzuki
b2c99719fd
feat(es/parser): Add tests for static blocks ()
swc_ecma_parser:
 - Add tests for multiple static blocks in a class.
2021-08-30 12:45:41 +09:00
강동윤
c0b0337d1d
fix(es): Fix easy bugs ()
swc_ecma_parser:
 - Fix parsing of complex arrow expressions in a conditional expression. ()
 - Report an error for wrong jsx, instead of `panic!`. ()

swc_ecma_transforms_react:
 - `jsx`: Handle fragment with single child correctly. ()

swc:
 - Ensure that  is an invalid issue. ()
2021-08-29 20:40:52 +00:00
Sosuke Suzuki
a10118c90f
feat(es/parser, es/codegen, es/visit): Support static blocks in classes ()
swc_ecma_ast:
 - Add support for static blocks in classes.
2021-08-30 00:03:14 +09:00
muji
5d702835e8
fix(es/loader): Fix node resolver ()
swc_ecma_module_loader:
 - Use correct base directory.
2021-08-29 17:47:15 +09:00
강동윤
97514a7549
fix(es): Fix some easy bugs ()
swc_ecma_parser:
 - Fix parsing of typescript generics in jsx context. ()

swc_ecma_transforms_base:
 - `fixer`: Handle assignment with patterns in arrow body. ()

swc_ecma_utils:
 - `as_bool`: Handle assignment with operator correctly. ()
2021-08-27 06:03:06 +00:00
David Sherret
3d58457027
refactor(es/dep_graph): Use dyn instead of impl ()
swc_ecma_dep_graph:
 - Use `dyn` instead of `impl` in `analyze_dependencies`.
2021-08-27 13:08:48 +09: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
강동윤
e468752ebc
fix(es/minifier): Fix usage via yarn resolution ()
swc_common:
 - Deprecate some unused types.

swc:
 - `BoolOrObject`: Improve the error message for deserialization failure.
 - `BoolOrObject`: Treat an empty object as `true`.
 - `JsMinifyFormatOptions`: Add fields. ()

node_swc:
 - Improve error message for deserialization failure.
2021-08-26 06:18:59 +00:00
강동윤
8c5daeec2a
fix(es/transforms/base): Fix await expressions. ()
swc_ecma_transforms_base:
 - Preserve parenthesis in `await (a || b)`. ()
2021-08-26 13:19:12 +09:00
강동윤
18e2232dbc
feat(plugin): Groundwork for rust plugin system () 2021-08-25 15:07:09 +00:00