Commit Graph

15 Commits

Author SHA1 Message Date
Donny/강동윤
83a5a0c612
fix(es/compat): Handle private names from class properties pass (#8090)
**Related issue:**

 - Closes #7561
 - https://github.com/vercel/next.js/issues/56612
2023-11-02 22:18:17 +00:00
Donny/강동윤
0aafa75fef
feat(es/testing): Use __swc_snapshots__ for test! macro (#8191)
**Description:**

This implements something similar to `__snapshots__` of `jest`. Instead of storing the expected result as a string literal, we now store it in `$crate/tests/__swc_snapshots__/$path_to_test__$test_name.js`.

**Related issue:**

 - Closes #4509
2023-10-30 10:38:59 +09:00
Donny/강동윤
fe0bf5746f
chore(ci): Fix CI action (#8107) 2023-10-12 03:26:04 +00:00
magic-akari
38dfb91ebc
fix(es/helpers): Remove unnecessary parameters in helper_expr! macro (#7296)
**Description:**

We have moved to snake_case, so the last parameter of helper_expr is unnecessary.
2023-04-20 08:26:34 +00:00
magic-akari
703b340d39
fix(es/decorator): Preserve evaluation order (#6972)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6951.
2023-02-23 01:37:06 +00:00
magic-akari
a27ffd2242
feat(es/minifier): Drop unused import bindings (#6967) 2023-02-21 06:22:25 +00:00
HeYunfei
dabea71c44
fix(es/minifier): Preserve unused imported specifiers (#6458) 2022-11-17 00:52:19 +00:00
Donny/강동윤
8827c38faf
feat(es/minifier): Make DCE single-pass (#5699) 2022-09-01 16:30:21 +00:00
Donny/강동윤
6a97c7bef8
fix(es/utils): Fix wrong apis (#4604)
# API Changes

## `swc_ecma_utils`

### Renames

 - `find_ids` => `find_pat_ids`
 - `prepend` => `prepend_stmt`
 - `as_bool` => `cast_to_bool`
 - `as_number` => `as_pure_number`
 - `as_string` => `cast_to_string`
 - (`as_pure_bool`, `cast_to_number` is not renamed)
 - `UsageFinder` => `IdentUsageFinder`.
 - `IdentFinder` => `IdentRefFinder`.

## Changes

 - Re-export of `HANDLER` from `swc_common::errors` is removed. Use `swc_common::error::HANDLER` instead.
 - Re-export of `Id` from `swc_ecma_ast` is removed. Use `swc_ecma_ast::Id` instead.
 - `ExprCtx` is used for apis related to `Expr`.
 - `preserve_effects` is now a method of `ExprCtx`. It was a top-level function.
 - `extract_side_effects_to` is now a method of `ExprCtx`. It was a top-level function.
 - `IdentUsageFinder` (previously `UsageFinder`) now takes `Id` instead of `Ident`.
 - `IdentRefFinder` (previously `IdentFinder`) now takes `Id` instead of `Ident`.
 - `ExprExt::is_ident_ref_to` is removed.
 - `Expr::is_global_ref_to` is added.
 - `:🆔:id` is removed. Use `Ident::to_id()` instead.
2022-05-11 04:36:22 +00:00
Donny/강동윤
f30ffdf200
fix(es/decorators): Make legacy decorator identical to tsc (#4496) 2022-05-03 07:48:09 +00:00
Donny/강동윤
53610fdafc
feat(es/resolver): Use different syntax context for unresolved refs (#4436)
- We don't need a list of bindings to check if an identifier is unresolved.
 - Checking if an identifier is unresolved is now one CPU instruction.
   - Previously it was one hashmap operation.
 - This PR also improves performance, by removing the hashmaps mentioned above.
2022-04-26 07:38:50 +00:00
Austaras
112f428734
feat(es/compat): Add pure comments for class fields keys (#3939) 2022-03-10 07:13:58 +00:00
Austaras
6f076e4927
feat(es/transform): Unify logic for handling class properties (#3766) 2022-03-05 06:46:09 +00: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/강동윤
2b2f6955f2
refactor: Flatten ecmascript (#2708) 2021-11-10 19:00:54 +09:00