Commit Graph

113 Commits

Author SHA1 Message Date
강동윤
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
강동윤
838a7a8b33
fix(es/minifier): Make use of hygiene optimizer (#2145)
swc_ecma_ast:
 - Implement `Display` for `Ident`.

swc_ecma_minifier:
 - Expose `unique_scope`, which is required for `hygiene_optimizer`.
 - Improve `hygiene_optimizer`.

swc:
 - Use hygiene optimizer. (#1600, #2137)
 - Add `jsc.experimental.optimizeHygiene`
2021-08-24 15:03:31 +00:00
Ifiok Jr
1d71a8ea95
chore: Fix typo (#2135) 2021-08-23 18:08:01 +09:00
Ifiok Jr
84cda8a9f5
chore: Fix typo (#2136) 2021-08-23 18:07:35 +09:00
Songkeys
91c239bc74
chore: Fix typo in type definition (#2116) 2021-08-20 21:53:47 +09:00
강동윤
949a4d9716
fix(es): Fix simple bugs (#2077)
swc_ecma_visit:
 - Ensure that #1967 is wrong. (#1967)

swc:
 - Add a test for #1107. (#1107)

node:
 - Make optional fields optional. (#1947)
2021-08-14 18:34:14 +00:00
강동윤
1b9584cfc0
fix(swc): Fix bugs (#2067)
swc_ecma_transforms_compat:
 - Fix optional chaining. (#2063)

node/swc:
 - Fix definition of `ImportDeclaration`. (#2059)

testing:
 - Allow using `testing` with stable `rustc`.

testing_macros:
 - Add `#[inline(never)]`.
2021-08-13 10:57:25 +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
muji
2151366b93
feat(es/loader): Support target runtime environment. (#2045)
swc_ecma_ast:
 - Add `TargetEnv`.

swc_ecma_loader:
 - Support specifying target environment.
2021-08-10 15:36:10 +09:00
강동윤
9793926cc8
fix(es/minifier): Fix bugs and implement more rules (#2032)
swc_ecma_minifier:
 - Fix an infinite loop. (#2028)
 - Don't remove span hygiene. (#2022)

swc_ecma_codegen:
 - Fix codegen of `return` with `async` arrow. (#2020)

swc:
 - Respect `minify = false`. (#2019)
2021-08-08 14:19:04 +00:00
Sosuke Suzuki
f4e0e91f64
feat(es/parser): Always enable features in ES spec (#2029) 2021-08-08 22:53:41 +09:00
OJ Kwon
abb1451061
fix(node/swc): Allow specifying filename when parsing (#2031) 2021-08-08 20:14:45 +09:00
강동윤
f44e25c3af
fix(es/minifier): Improve output of minifier (#1990)
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)
2021-08-04 00:52:47 +09:00
강동윤
d1c481790c
feat(swc): Expose minifier api (#1978)
swc_ecma_codegen:
 - Fix codegen of imports when minification is enabled.

swc_ecma_minifier:
 - Mangle identifiers used by imports.

swc:
 - Support specifing `jsc.minify`. (#704, #1371)

swc/node:
 - Add `.minify()`.
 - Add `.minifySync()`.

swc/wasm:
 - Add `.minifySync()`.
2021-07-31 06:30:06 +00:00
Sosuke Suzuki
eecaac12a0
fix(node/swc): Fix typings for parser options (#1971) 2021-07-30 12:49:55 +09:00
plylrnsdy
d5cdf444e8
fix(node/swc): Fix field name (#1923)
node/swc:
 - Rename `member` of `TsEnumDeclaration` to `members`.
2021-07-18 19:40:01 +09:00
강동윤
ff47e2539e
fix(swc): Fix bugs (#1932)
swc_common:
 - Fix handling of input source map. (#1930)

swc:
 - Respect `paths`. (#1858)

node:
 - Fix typings of `paths`.
2021-07-17 11:16:00 +00:00
강동윤
19bcb06f73
fix(swc): Fix source path of a source map file (#1902)
swc:
 - Use `output_path` to make sourcemap path relative to the `.map` file. (#1255)
2021-07-08 07:32:06 +00:00
강동윤
69186eb74d
fix(es/transforms): Fix transforms (#1900)
node-swc:
 - Use proper field name in `ObjectPattern`. (#1886)

swc_ecma_codegen:
 - Fix codegen of private properties. (#1898)

swc_ecma_transforms_compat:
 - Fix optional chaining expressions in a single-line arrow expression. (#1836)
 - `regenerator`: Preserve `ExportDefaultDecl`. (#1799)

swc_ecma_transforms_module:
 - Fix `export default function`. (#1799)
2021-07-08 04:54:57 +00:00
강동윤
211e208219
fix(node-swc): Fix visitor (#1890)
node/binding:
 - Fix visitor methods for array elements. (#1819, #1888)
 - Fix for const assertion. (#1625)
 - Verify object properties. (#906)
2021-07-04 12:35:25 +00:00
강동윤
c79db252dc
fix(swc): Fix bugs (#1753)
swc_ecma_parser:
 - Allow class members to be declared. (#1751)

node-swc:
 - Fix typescript type definitions. (#1746)
2021-05-27 11:59:04 +09:00
LongYinan
c2bd3195e8
fix(node-swc): Fix typescript definitions for react options (#1720) 2021-05-21 10:22:11 +09:00
nuintun
0cdabeb4c0
fix(node-swc): Fixed parseFile (#1654) 2021-05-09 07:03:09 +00:00
vemoo
304b57cdd4
fix(node-swc): Fix definition of JSXOpeningElement (#1608)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-05-06 19:30:14 +09:00
강동윤
82ef06afb8
feat(babel/compat): Improve performance of babelify (#1626)
swc_babel_compat:
 - Optimize.

swc:
 - Improve performance of comment storage.
2021-05-06 14:56:54 +09:00
강동윤
28bb61fb8d
fix(swc): Fix bugs (#1624)
spack:
 - Add ability to exclude module from the bundle. (#1385)

swc_ecma_ast:
 - Make `Param.decorators` optional. (#1603).

swc_ecma_transforms_compat:
 - Fix super calls in seq exprs in a class. (#1617)

swc_ecma_transforms_module:
- `common_js`: Fix dynamic imports. (#1614)

swc_ecma_transforms_typescript:
 - Fix common js imports. (#1593)
2021-04-30 06:25:24 +00:00
LongYinan
e9d58fa002
fix(node-swc): Fix outdated types (#1621) 2021-04-30 12:20:21 +09:00
WaveSheep
1c1de6392b
fix(node-swc): Fix definition of FunctionDeclaration (#1602) 2021-04-23 23:19:40 +09:00
강동윤
4db24fb7f6
fix(swc): Fix various bugs (#1588)
swc_ecma_transforms_module:
 - Change the order of functions exported as default. (#1568)
 - Handle mixed imports correctly. (#1525)

swc:
 - Ensure that #1581 is fixed. (#1581)
2021-04-18 20:58:30 +00:00
Devon Govett
d7ea5ae00c
fix(es/transforms/compat): Fix syntax context of super classes (#1586) 2021-04-18 15:40:06 +00:00
강동윤
2211a9908a
fix(swc): Fix various bugs (#1550)
swc:
 - Improve error message for invalid configs. (#1532)

swc_common:
 - Handle input source map correctly. (#1404)

swc_ecma_parser:
 - Fix parsing of generics type declarations when tsx is enabled. (#1526)

swc_ecma_transforms_compat:
 - Allow using carriage return. (#1549)
2021-04-08 12:55:02 +00:00
Arend van Beelen jr
228429c7bb
fix(node-swc): Fix handling of tagged template expressions in Visitor (#1544) 2021-04-06 15:22:05 +09:00
WaveSheep
c7dc9116e1
fix(node-swc): Fix VariableDeclarationKind typescript definition (#1542) 2021-04-06 11:43:43 +09:00
David Sherret
f1792708b4 fix(es/ast): Remove TsSignatureDecl (#1531) 2021-04-04 20:12:17 +09:00
WaveSheep
dcaea5fd31
fix(node-swc): Make Argument.spread optional (#1535) 2021-04-04 17:25:32 +09:00
강동윤
dcdac2db6f
fix(swc): Fix bugs (#1453)
swc_ecma_transforms_typescript:
  - Add option to use define propert for `strip` pass. (#1472)

node-swc:
  - Fix `keepClassNames`. (Brooooooklyn/swc-node#335)
2021-03-17 15:24:35 +09:00
강동윤
a3105428ba
fix(swc): Fix various bugs (#1440)
swc:
 - Use `hygiene_with_config` instead. (#1279)
 - Allow enabling source map with `.swcrc`. (#1309)

swc_ecma_transforms_base:
 - `hygiene`: Add an option to preserve class names. (#1279)

swc_ecma_transforms_compat:
 - `block_scoping`: Allow using `break` in switch cases. (#1415)
2021-03-01 17:19:37 +09:00
David Sherret
adcca03cfa
fix(es/ast): Remove TsTypeCastExpr it's not used (#1420) 2021-02-22 17:05:51 +09:00
Jovi De Croock
f5a90ae985
fix(node-swc): Handle empty object patterns. (#1393)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-02-14 19:57:15 +09:00
Jovi De Croock
a0898e8ce3
fix(node-swc): Don't remove plugin from options (#1390) 2021-02-13 19:34:35 +09:00
Yehuda Katz
98ae16761d
fix(node): Add es2020 to JscTarget in types.ts (#1376) 2021-02-04 12:12:19 +09:00
Michael Nicholls
bd119e6634
feat(es/preset-env): Custom config path (#1374)
swc_ecma_preset_env:
 - Support custom path.

Co-authored-by: 강동윤 <kdy1@dudy.kr>
2021-02-03 13:27:11 +09:00
강동윤
af25a88902
fix(swc): Fix bugs for v1.2.47 (#1368)
swc_ecma_parser:
 - Fix generic parsing issue in jsx context. (#1299)

swc_ecma_transforms_module:
 - Allow importing a module multiple time. (#1232)
 - Handle imports in the constructor of an exported class decl. (#1213)

swc:
 - Respect `sourceMappingURL`. (#1236)
 - Resolve `sourceMappingURL` relative from file. (#1255)
 - Respect `isModule: false` (#1258)

spack:
 - Support loading json files. (#1225)
2021-01-29 22:19:04 +09:00
Martin Feckie
261e2ec5ff
feat(node-swc):Remove duplicate type and correct name (#1267) 2020-12-12 12:44:31 +09:00
강동윤
5b2532e7e3 Remove some spack tests 2020-11-21 20:58:50 +09:00
강동윤
1f00d9ba26
Fix jest extension (#1106) 2020-09-24 19:49:12 +09:00
강동윤
4490e2551d
swc.rs (#1085)
Changes url from https://swc-project.github.io to https://swc.rs
2020-09-21 22:53:48 +09:00
강동윤
7ffb4c0bf9
Extension for jest (#1081) 2020-09-18 14:29:50 +09:00
강동윤
cfca078aa7
Update docs (#1082) 2020-09-18 14:04:48 +09:00
LongYinan
c0cb9e4401
Upgrade to napi-rs@0.3 cli (#1033) 2020-09-05 17:48:22 +09:00
강동윤
8e237288d7
Migrate to napi (#1009) 2020-08-30 15:29:42 +09:00
강동윤
c6a10251c9
Chores (#986) 2020-08-23 02:41:39 +09:00
강동윤
655fc12fcb
Make spack respect swcrc (#964) 2020-08-14 21:02:39 +09:00
강동윤
2fedf32747
swc_bundler (#943)
swc_bundler:
 - Splitted from spack

swc_ecma_parser:
 - Fix unexpected eof problem which occurs if log level is trace

swc_ecma_transforms:
 - Fix bugs of dce pass

spack:
 - Support cyclic dependencies
2020-08-12 22:18:47 +09:00
강동윤
ca43112d2a
codegen: Preserve quotes (#911) 2020-07-28 21:56:19 +09:00
강동윤
ff440157a0
Fix regenerator (#851)
swc_ecma_transforms:
 - Fix regenerator scoping issue.
2020-06-18 17:04:49 +09:00
강동윤
31020e46d8
spack: enhancement (#845)
- Handle modules (via swcrc)
 - swc.bundle([conf1, conf2])
 - Correct chunking
2020-06-15 23:28:15 +09:00
강동윤
aea757d369
spack: More extensions for node resolver (#842) 2020-06-14 22:53:45 +09:00
강동윤
fcef201695
spack: super-fast bundler (#825)
Version is alpha as it's not complete
2020-06-13 23:09:45 +09:00
강동윤
28456d0b49
Default value for options.jsc.parser.syntax (#840) 2020-06-13 02:05:49 +09:00
강동윤
1f89160986 Fix swc 2020-05-24 00:52:25 +09:00
강동윤
3a372ad29a
Move node-swc into the repository (#789)
The commit will help

 - Better testing
 - Preventing regression like #785.
 - **Implementing spack** (It requires access to neon api because of the plugin system)
2020-05-22 20:36:39 +09:00