Commit Graph

19 Commits

Author SHA1 Message Date
Donny/강동윤
8074c72ce9
fix(es/transforms/base): Fix hyigiene (#2421)
swc_ecma_transforms_base:
 - `hygiene`: Considering scoping of `var`.
 - `hygiene`: Avoid creating too many `JsWord` by caching index.
2021-10-13 17:32:37 +09:00
Donny/강동윤
ac3fbd91ac
perf(bundler): Improve performance (#2384)
*:
 - Use `ahash` instread of `rustc-hash`.

swc_ecma_transforms_optimization:
 - Make `dce` parallel.
2021-10-09 08:08:13 +00:00
Donny/강동윤
d0342a5a58
feat(swcpack): Enable concurrent mode (#2356)
swc_common:
 - Use `Mutex` from `parking_lot` instead of it from std.

swc_bundler:
 - Use `fxhash` if possible.
 - Don't `clone()` all modules if the entry has only one item.

swc_ecma_loader:
 - `NodeModulesResolver`: Use `path-clean` instead of `canonicalize`.

swc_ecma_transforms_optimization:
 - Reimplement `dce`

node_bundler:
 - Enable `concurrent` of `swc_bundler`.
2021-10-08 16:47:01 +09:00
Donny/강동윤
6d35e7c28d
fix(swc): Fix order of custom passes (#2347)
swc:
 - Invoke `resolver` and `typescript::strip` before applying user passes.
2021-10-05 20:46:49 +00:00
Donny/강동윤
fac6f47863
perf(es/transforms): Improve performance (#2329)
swc_ecma_ast:
 - Implement `Take` for `Function`.
 - Implement `Take` for `FnExpr`.
 - Implement `Take` for `ClassExpr`.

swc_ecma_transforms_compat:
 - Migrate `es2015::duplicate_keys` to `VisitMut`.
 - Migrate `es2015::template_literals` to `VisitMut`.
 - Migrate `es2015::function_name` to `VisitMut`.
 - Add more fast-path to `reserved_words` pass.

swc_ecma_transforms_react:
 - Reduce allocations of `pure_annotations`.
 - Migrate `pure_annotations` to `VisitMut`.
 - Migrate `jsx::display_name` to `VisitMut`.

swc_ecma_transforms_optimization:
 - Migrate `inline_globals` to `VisitMut`.
 - `inline_globals`: Use `Lrc<FxHashMap<K, V>>`.

swc:
 - Cache `current_dir()`.
 - `ModuleConfig::build`: cacnonicalize only if `paths` is used.
2021-10-05 13:31:35 +00:00
Donny/강동윤
8403057268
fix(es/minifier): Don't optimize new String. (#2341)
swc_ecma_transforms_optimization:
 - Don't optimize calls like `new String`.
2021-10-04 06:44:37 +00:00
Donny/강동윤
650e1494d4
fix: Migrate dependencies (#2307)
*:
 - Migrate from `log` to `tracing`. (#2284)
 - Migrate from `fxhash` to `rustc-hash`.

swc_common:
 - Add a cargo feature named `debug`.
2021-09-27 09:19:15 +00:00
Donny/강동윤
180dc31550
fix(es/transforms/base): Fix hygiene pass (#2266)
swc_ecma_transforms_base:
 - `hygiene`: Consider nested scopes correctly. (#2211)
 - `hygiene`: Fix handling of constructors.
2021-09-21 12:21:49 +00:00
강동윤
48d61039d2
fix(common, node/swc): Allow inlining sourcesContent (#2245)
swc_common:
 - Allow setting `sourceContents` of source map files. (#2218)

swc:
 - Support `inlineSourceContents`. (#2244)
2021-09-14 02:31:32 +00:00
강동윤
cb2b0c671f
fix(es/transforms/base): Optimize hygiene (#2193)
swc_ecma_transforms_base:
 - `hygiene`: Don't rename if not required. (#1600)

swc_ecma_minifier:
 - Remove `hygiene_optimizer`.
2021-09-01 13:11:55 +00:00
강동윤
d975a197c9
fix(es): Fix source map (#2159)
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
강동윤
b0278242ba
fix(bundler): Fix handling of reexports from cjs modules (#2143)
swc_bundler:
 - Handle reexports from cjs modules. (#2124)
 - Inject `__spack_require__` helper if required.
2021-08-24 07:20:15 +00:00
강동윤
c78baef2cc
fix(es/transforms/compat): Implement new.tartet (#2129)
swc_ecma_transforms_compat:
 - Handle `new.target`. (#1179)
2021-08-22 06:56:49 +00:00
muji
61e58d7329
feat(bundler): Support replacing any environment variables (#2121) 2021-08-21 16:45:59 +09:00
강동윤
879a0f39a8
feat(swc): Implement format.comments of terser (#2095)
swc:
 - `minify`: Support `format.comments`.
 - `process_js`: Support `jsc.minify.format.comments`.
2021-08-17 14:34:37 +00:00
muji
e84ed13ffe
feat(es/loader): Support more types for browser in package.json (#2060) 2021-08-16 17:34:53 +09:00
강동윤
f6aabfce9c
perf: Use ahash instead of sip hash (#2073)
swc_common:
 - Add `AHashMap`.
 - Add `AHashSet`.
2021-08-14 10:33:16 +00:00
강동윤
b0c41bb3f2
chore: Cleanup codes for fixture testing (#2070) 2021-08-14 06:34:04 +00:00
강동윤
883c1ac4e4
fix(bundler): Prepare renaming of bundler (#2066)
- Rename `spack` crate to `swc_node_bundler`. (#1113)
2021-08-13 10:03:04 +00:00