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`.
swc_ecma_parser:
- Don't panic on `typeof import(T)`. (#2198)
- Fix parsing of ternary. (#2196)
swc_ecma_transforms_base:
- `fixer`: Handle unary in lhs of an exponentation expression. (#2191)
swc_ecma_transforms_compat:
- Use variable for `this` in arrow expressions. (#2212)
swc_ecma_visit:
- Add a trait `InjectVars`.
node_swc:
- Increease recursion limit while deserializing. (#2223)
swc_ecma_codegen:
- Don't panic on `Pat::Invalid`.
- Fix codegen of unary minus. (#2213)
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. (#2214)
- Fix negation of `if_return`.
swc_ecma_codegen:
- Use span for `await` token.
- Use span for debugger statements.
- Use span for object literals.
- Use span for object patterns.
- Use span for array literals.
- Use span for `try`.
- Use span for `for`.
- Use span for `return`.
- Use span for `break`.
- Use span for `continue`.
- Use span for `this`.
- Use span for `switch`.
- Use span for `catch`.
- Use span for `case`.
- Use span for `function`.
- Use span for unary expressions.
swc_ecma_minifier:
- Normalize sequences expressions if the length is 1.
swc_ecma_minifier:
- Enable some sequential merging if `collapse_vars` is set.
- Enable sequential merging for top level items.
- `if_return`: Don't inject `void` if it's not exact function body. (#2072)
- `sequences`: Add some condition for aborting. (#2078)
swc_ecma_utils:
- Add `collect_decls`.
- Add `collect_decls_with_ctxt`.
swc_ecma_transforms_optimization:
- `inline_globals`: Don't replace if a binding exists. (#1294)
swc_ecma_minifier:
- Test mangler using execution test suite.
- `mangler`: Preserve `arguments`.
- `mangler`: Handle shorthand. (#2051)
- `mangler`: Handle object pattern properties.
- `precompress`: Don't drop function declarations if the variable with same name is in different scope. (#2011)
swc_ecma_minifier:
- Remove useless `0` in sequence expressions.
- `analyzer`: Don't treat fn decl as fn expr.
- `sequences`: Use sequence expressions in front of `b`.
- `if_return`: Drop else token within same pass. (#2044)
- Fix counting logic for `pass`. (#2044)
- `analyzer`: Fix `ref_count`.
- `hygiene`: Implement `visit_prop_name`.
- `ignore_return_value`: Property access to function parameters may have side effects.
- `inline`: Treat `!0` as literal.
- Remove some dead codes if `unused` is enabled.
swc_ecma_utils:
- Fix `may_have_side_effects`.
swc_ecma_minifier:
- Introduce `bundle` mode, which can be used to parallelize processing of bundled files.
- Add a function analyzer that checks if the function references something from the outer scope.
- Split out parellsizable passes.
- Split `optimzer` into pure / non-pure.
- Run pure optimizations in parallel.
swc_common:
- Add `Span.has_mark`.
swc_ecma_codegen:
- Emit `1e3` for `1000`.
- Optimize output. (#1986)
swc_ecma_minifier:
- name mangler: Don't use keywords as an id.
- `properties`: Optimize member expression with string properties.
- `inline`: Inline some function expressions even if it's not fn-local.
- `analyzer`: Track reassignment correctly.
- `analyzer`: Track fn-local correctly.
- `sequences`: Inject `void` if required.
- `inline`: Inline function declarations correctly.
- `sequences`: Merge expressions into test of if statements.
- `sequences`: Reduce calls to an assigned variable.
- Use `Marks` instead of `&dyn Comments`.
swc_ecma_transforms_optimization:
- `expr_simplifier`: Fix infinite loops.
node/swc:
- Ensure that `.transform` performs minification. (#1989)
swc_ecma_minifier:
- Implement more rules.
swc_ecma_transforms_base:
- `resolver`: Fix syntax context of catch block.
swc_ecma_transforms_optimization:
- `expr_simplifier`: Fix a bug related to `this` of call expressions.
- `dead_branch_remover`: Don't reduce switch cases if test is now known.
- `dead_branch_remover`: Don't break `&&`.
swc_common:
- `SourceMap`: Don't panic for dummy spans.
swc_ecma_codegen:
- Use span for `throw`. (#1685)
- Use span for `var` / `let` / `const`.
- Use span for `new`.
- Use span for `if`.
- Add spans to braces of a block statement. (#1796)
swc_ecma_transforms_compat:
- `parameters`: Don't drop the span of block statements. (#1796)
swc:
- Allow specifying input source map in `.swcrc`.
- Ensure that the inline source map works properly. (#1713)
swc_ecma_transforms_base:
- `fixer`: Wrap operand of a unary expression if it's a binary expression. (#1781, #1789)
swc_ecma_transforms_module:
- Allow multiple `export *` even if it has the same item. (#1780)