David Sherret
313f51fab1
feat(es/parser): Allow to look at the kind of an error ( #1396 )
...
swc_ecma_parser:
- Add a method to look at the kind of an error without destructuring it.
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-02-14 16:49:28 +09:00
Bartek Iwańczuk
8ef78a9e08
feat: add import assertion to dep analyzer ( #1387 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2021-02-10 21:49:44 +09:00
강동윤
bf445a75c4
fix(swc): Fix bugs ( #1372 )
...
swc_ecma_ast:
- Support import assertions for exports.
swc_ecma_parser:
- Support import assertions for exports.
swc_ecma_transform_typescript:
- Strip `declare globals` correctly. (#1383 )
spack:
- Re-enable multi-entry tests.
2021-02-10 17:25:28 +09:00
강동윤
0d130f8103
fix(bundler): Prevent hanging ( #1369 )
...
swc_bundler:
- Prevent infinite loop.
2021-01-30 13:35:07 +09:00
강동윤
947161b43b
fix(bundler): Fix bugs ( #1349 )
...
swc_bundler:
- Fix deglobbing of imports. (denoland/deno#8985)
- Use correct syntax context while deglobbing imports. (denoland/deno#9212)
- Allow reexporting from wrapped esms. (denoland/deno#8959, denoland/deno#9200)
- Fix statement orderings. (denoland/deno#9250)
- Emit injected items as early as possible. (denoland/deno#9250)
- Respect `external_modules`. (#1338 )
- Fix cjs suppport. (#1328 )
swc_ecma_transforms_base:
- hygiene: Fix for hoisting. (denoland/deno#9212 )
2021-01-25 21:15:42 +09:00
강동윤
947f9c5641
fix(es/ast): Fix EqIgnoreSpan ( #1360 )
...
swc_ecma_ast:
- Make `EqIgnoreSpan` impl of` StrKind` always return true.
2021-01-25 18:14:34 +09:00
강동윤
2921b903d7
fix(es/ast): Compilation ( #1357 )
...
swc_ecma_ast:
- Fix compilation.
2021-01-25 11:32:09 +09:00
강동윤
b7ae896bbd
fix(es): Fix bugs ( #1353 )
...
swc_ecma_transforms_compat:
- Handle all accesses to private class properties. (#1333 )
- block_scoping: Inject variable correctly. (#1231 )
- Handle async arrow function correctly. (#1341 )
2021-01-23 20:52:53 +09:00
강동윤
d4df2cece8
fix(es): Fix bugs ( #1347 )
...
swc_ecma_parser:
- Do not emit strict mode error while backtracking. (#1252 )
swc_ecma_transforms_proposal:
- Handle decorator on methods with computed key.
2021-01-23 15:46:42 +09:00
강동윤
0469e3a33e
fix(es): Move and rename JscTarget ( #1343 )
...
swc_ecma_ast:
- Add `EsVersion`.
swc_ecma_parser:
- Remove `JscTarget`.
- Reexport `EsVersion` as `JscTarget`.
2021-01-20 19:43:56 +09:00
강동윤
17f17e82e6
fix(bundler): Fix bugs ( #1342 )
...
swc_bundler:
- Add a testing system for constant inliner.
swc_ecma_transforms_optimization:
- const_propagation: Handle export specifiers.
- const_propagation: Handle inlining of variables whose initializer is inlined.
- dce: Allow dropping identifiers used in `exported` part of export specifiers.
2021-01-20 16:10:12 +09:00
강동윤
3faefb5836
feat(es): TypeScript 4.2 ( #1330 )
...
swc_ecma_ast:
- Add `is_abstract` to constructor types.
swc_ecma_codegen:
- Fix codegen of `Bool`.
- Implement codegen for abstract constructors.
swc_ecma_parser:
- Inline tsc parser test suite.
- Implement parsing of abstract constructor types.
2021-01-15 19:30:44 +09:00
강동윤
6984217200
feat(ES/transform/typescript): Support namespace ( #1325 )
...
swc_common:
- Update `serde`.
swc_ecma_transforms_typescript:
- Add support for namespace.
2021-01-12 21:59:42 +09:00
강동윤
23aebacade
fix(bundler): Fix bundler ( #1318 )
...
swc_bundler:
- Use two-context system properly.
- Remove old logic.
- keywords: Handle assignment pattern property.
- keywords: Handle shorthand property.
- keywords: Handle identifiers in declarations.
swc_ecma_transforms_typescript:
- Do not remove import if there's non-type usage. (Related to denoland/deno#8978 )
swc_ecma_transforms_optimization:
- dce: Handle new expression correctly.
2021-01-11 19:38:20 +09:00
강동윤
76d9e2a9df
feat(ecmascript/transforms): Split into multiple crates. ( #1311 )
2021-01-05 14:29:52 +09:00
강동윤
ba13db54db
fix(bundler): Fix remaining bugs ( #1296 )
...
swc_bundler:
- Allow `export *` and `import` from same source. (denoland/deno#8828 , denoland/deno#8725 )
- Handle contextual keywords. (denoland/deno#8680 )
- Prevent duplicated identifiers. (denoland/deno#8725 )
swc_ecma_transforms:
- dce: Preserve tags in tagged template literals. (denoland/deno#8746 )
- dce: Handle throw statement correctly. (denoland/deno#8736 )
2020-12-28 19:53:40 +09:00
강동윤
8a8db58f1c
fix(ecmascript): Fix bugs related to string literals ( #1287 )
...
swc_ecma_ast:
- Add `Str.kind`.
swc_ecma_transforms:
- Fix quotes in template literals. (#1280 )
swc_ecma_codegen:
- Fix escape of single quotes. (#1259 )
- Fix codegen of wrong escapes. (#1276 )
swc:
- Ensure that #1271 is about napi's deserialization.
2020-12-22 04:27:18 +09:00
강동윤
bf69b47791
fix(ecmascript/parser): Fix span of declare
decls. ( #1282 )
...
swc_ecma_parser:
- Include `declare` span. (#843 )
2020-12-19 23:48:13 +09:00
Luca Casonato
8ba2ae959d
feat: specifier position in DependencyDescriptor ( #1260 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-12-09 11:27:09 +09:00
강동윤
2e29d78281
fix: Decorator metadata ( #1248 )
...
swc_ecma_transforms:
- Emit proper typename for `design:type` used with enum. (#1160 )
2020-12-04 05:03:26 +09:00
강동윤
f8a1fb878d
fix(regenerator): Handle ternary correctly ( #1228 )
...
swc_ecma_transforms:
- Fix interaction between ternary and await. (#1216 )
testing_macors:
- Fix for `--lib` tests.
2020-11-24 02:54:18 +09:00
강동윤
25f2ff1a45
Bump version
2020-11-22 18:17:55 +09:00
강동윤
6888c69bda
Fix codegen: preserve input ( #1221 )
...
swc_ecma_codegen:
- Preserve input. (#1204 )
2020-11-21 02:04:29 +09:00
강동윤
4294b5e7ba
bundler: Fix issues ( #1212 )
...
swc_bundler:
- Bundler rework. (denoland/deno#6802)
- Reexports are not transitive. (denoland/deno#8246)
- Dependencies of module with circular dependency. (denoland/deno#8302)
- Order of injection between import vs export. (denoland/deno#8302)
- `export *` in wrapped modules. (denoland/deno#8308, denoland/deno#8399)
- `export { a as b }` in wrapped modules.
- Fix denoland/deno#8314.
- Fix denoland/deno#8325.
- Fix denoland/deno#8344.
- Make deno test verify exported names.
- Handle `export * from './foo'`.
swc_ecma_parser:
- Don't panic on private name in interface (Closes #1211 )
swc_ecma_transforms:
- dce: Prevent infinite loop
- Faster constant propagation pass.
2020-11-19 20:42:56 +09:00
Brad Dunbar
4327d91fe3
BigInt literal keys ( #1192 )
2020-11-15 01:22:35 +09:00
강동윤
0a5e23f97c
bundler: Handle swc helpers ( #1199 )
...
swc_bundler:
- Handle helpers from `swc_ecma_transforms`.
swc_ecma_transforms:
- dce: Remove unused self-referential functions.
2020-11-05 09:53:18 +09:00
강동윤
f21a28844d
resolver: handle class declarations ( #1200 )
...
swc_ecma_transforms:
- resolver: Handle class declarations (denoland/deno_lint#463 )
2020-11-03 01:30:21 +09:00
강동윤
bae0eda8bd
Fix bundler ( #1194 )
...
swc_bundler:
- Remove wrong assertion. (denoland/deno#8148 )
- Remove wrong variables created on reexports. (denoland/deno#8188 )
swc_ecma_transforms:
- inlining: Treat usage as an argument as writes. (denoland/deno#8180 )
- inlining: Visit rhs of `||` and `&&`. (denoland/deno#8189 )
2020-10-30 14:49:02 +09:00
강동윤
a368f66e77
Bump version
2020-10-29 15:44:12 +09:00
강동윤
32b3bbd50b
Emit only ascii ( #1191 )
...
swc_ecma_codegen:
- Emit only ascii characters. (#1187 , #1188 )
2020-10-29 14:33:33 +09:00
강동윤
b2aec35eb6
Fix issues ( #1189 )
...
swc_bundler:
- Support emitting iife. (Closes #1184 )
swc_ecma_parser:
- Auto-detect script / module (Closes #1164 )
- lexer: Error recovery for strict mode and module mode.
- More error recovery logic for strict mode violation.
- Fix panic on invalid input. (Closes #1170 )
2020-10-28 21:20:11 +09:00
Brad Dunbar
6e9d06e95a
codegen: Preserve space for postfix unary operators ( #1185 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-25 17:38:27 +09:00
강동윤
6ba64ed359
Bump version of swc_ecmascript
2020-10-20 22:17:28 +09:00
강동윤
cf01ec8277
Bump version
2020-10-20 22:09:52 +09:00
Brad Dunbar
26c530b133
Invalid template escape in ES2018+ ( #1175 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-20 00:17:20 +09:00
강동윤
626c881c98
bundler: Fix ordering ( #1171 )
2020-10-16 22:26:18 +09:00
강동윤
a5e6242601
Bump version
2020-10-14 14:39:51 +09:00
Pig Fang
aded151b8f
[typescript] 4.1 mapped type 'as' clause ( #1151 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-13 16:44:05 +09:00
강동윤
5a91ab994c
bundler: Fix dead code elimination ( #1157 )
...
swc_bundler:
- Fix dce bug. (#1156 )
swc_ecma_transforms:
- resolver: Ignore non-computed class properties.
- dce: Handle usages in class property initializers.
2020-10-12 00:36:44 +09:00
강동윤
75a6211e2d
Fix hygiene and bundler ( #1144 )
...
swc_bundler:
- Change order of execution of modules with circular imports. (#1139 )
swc_ecma_transforms:
- hygiene: Fix handling of default in object patterns. (#1138 )
2020-10-07 14:55:02 +09:00
강동윤
0586c733e3
Fix bugs ( #1143 )
...
swc_ecma_transforms:
- fixer: Fix conditional expression in await expressions. (#1133 )
- optional_chaining: Fix call expression. (#1136 )
- hygiene: Fix codegen of computed keys. (#1140 )
2020-10-06 23:27:23 +09:00
강동윤
e4ddfcc899
export * as ns is part of ES2020 ( #1142 )
...
swc_bundler:
- Add direct support for `export * as ns from 'foo';`. (#1137 )
swc_ecma_transforms:
- Split `export` pass to `export_namespace_from` and `export_default_from`.
swc:
- Enable `export * as ns` for targets lower than es2020.
2020-10-06 20:48:29 +09:00
강동윤
205ce4ebe2
bundler: fix extra bugs ( #1127 )
...
swc_bundler:
- Prevent invalid output like `export * as helpers`
- Prevent stack overflow which occurs while bundling `https://deno.land/x/oak@v6.2.0/mod.ts `
swc_ecma_transforms:
- Migrate inlining pass to VisitMut
2020-10-04 00:19:35 +09:00
Nayeem Rahman
e4b8a0cc1e
fix(strip): Don't treat type-only exports as concrete references ( #1126 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-10-03 17:43:09 +09:00
강동윤
9879fa59c8
bundler: fix bugs ( #1105 )
...
swc_bundler:
- Correct lca for circular dependencies.
- Handle namespaced imports. (#1109 )
- Handle namespaced reexports. (#1110 )
- Handle shorthand properly. (#1111 )
- Implement `import.meta` (#1115 )
- Handle reexport mixed with imports correctly. (#1116 )
- Handle export default decls in computed-key modules.
- Remove all export * from. output. (#1118 )
- Handle export of class or function declaration in a computed module properly. (#1119 )
swc_ecma_transforms:
- Do not rename class members. (#1117 )
2020-10-02 11:07:40 +09:00
강동윤
ab8df21797
Fix optional chaining in argument position ( #1104 )
2020-09-24 15:14:30 +09:00
Nayeem Rahman
a9c3072b65
fix(strip): Fix Config::import_not_used_as_values ( #1101 )
...
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-09-23 22:52:47 +09:00
강동윤
688d16f228
Import assertion / json modules ( #1100 )
...
swc_atoms:
- Add "assert".
swc_ecma_ast
- Add a field to an import declaration.
swc_ecma_parser:
- Parse assertions in import statements.
- Parse assertions in top-level dynamic imports.
- Parse assertions in non-top-level dynamic imports.
swc_ecma_transforms:
- Fix compilation.
2020-09-23 14:27:27 +09:00
강동윤
7e8ff1d342
codegen: Fix for jsx ( #1097 )
2020-09-22 19:56:59 +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
강동윤
24c597f097
bundler: fix for deno ( #1078 )
...
swc_bundler:
- Run fixer before returning bundles.
- Fix planning of circular imports.
- Support circular imports of root entries.
- Remark properly while merging complex imports mixed with exports.
2020-09-17 21:05:47 +09:00
강동윤
1af1840d01
Fix swc_bundler ( #1075 )
...
swc_bundler:
- Skip least_common_ancestor for roots.
- Correct planning for circular imports mixed with normal imports.
- Correct merging of circular imports mixed with normal imports.
2020-09-16 18:28:10 +09:00
강동윤
bc82b5567e
typescript_strip: option to remove completely unused imports ( #1060 )
2020-09-15 14:25:13 +09:00
강동윤
4d5a0dacec
resolver: Correctly set in_type ( #1071 )
2020-09-12 23:56:10 +09:00
강동윤
31d4a0ee73
Bump swc_ecmascript
2020-09-12 22:00:06 +09:00
강동윤
8a0172912e
cjs: Fix import order ( #1069 )
2020-09-12 21:52:37 +09:00
강동윤
0972db98a1
parser: Parse member expression is object patterns ( #1068 )
2020-09-12 18:39:25 +09:00
강동윤
5c76aea82b
Fix resolver ( #1064 )
...
swc_ecma_transforms:
- resolver: properly handle let and const
- resolver: handle catch parameters
- resolver: handle parameter properties
swc_ecma_visit:
- reduced compile time of debug build
2020-09-11 23:33:36 +09:00
강동윤
82ae71faa1
Fix ts_resolver ( #1049 )
2020-09-08 20:45:58 +09:00
Bartek Iwańczuk
c4cc433434
fix(dep_graph): top level dynamic import ( #1024 )
2020-09-03 23:28:25 +09:00
강동윤
1fd9bd63f9
Bump version
2020-09-03 22:51:04 +09:00
강동윤
a2960810ac
Add BigInt literal type ( #1020 )
2020-09-03 10:50:13 +09:00
강동윤
578d64a398
Support jsx pragma ( #1015 )
...
swc_ecma_transforms
- Support jsx pragma (#107 , #838 )
2020-08-30 20:32:45 +09:00
Bartek Iwańczuk
8ab466aafb
Add dependency analyzer ( #1010 )
2020-08-29 20:07:34 +09:00
강동윤
274b112ef4
Bump version
2020-08-29 20:00:34 +09:00
강동윤
9f2120ed4b
Improve performance of parser ( #1004 )
2020-08-27 21:33:34 +09:00
강동윤
d641c0216b
Bump version
2020-08-26 20:58:44 +09:00
강동윤
511dc54961
Fix codegen of VisitMut for Option ( #996 )
...
swc_visit:
- Fix codegen of VisitMut for Option
2020-08-25 16:29:11 +09:00
강동윤
6c721112ab
Bump version
2020-08-24 22:50:00 +09:00
강동윤
db4ce50373
Bugfixes ( #989 )
...
swc_ecmascript:
- Make react / const modules configurable
2020-08-23 12:29:01 +09:00
강동윤
c475ab7f92
Bump versions
2020-08-21 20:06:37 +09:00
강동윤
e6191447fe
Typescript 4.0 ( #982 )
...
swc_ecma_parser:
- Add support for optional tuple element (#978 )
2020-08-21 19:31:46 +09:00
강동윤
3262052e33
Improve performance and reduce binary size ( #973 )
...
spack:
- Optimize resolver
swc_bunder:
- Parallize merging of reexports
- Remove useless `clone`s
swc_ecma_utils:
- Migrate DropSpan to VisitMut
swc_ecma_transforms:
- Migrate simple transforms to VisitMut
- Ignore types to reduce binary size
- Hide actual types so that we can optimize it in future without breaking change
swc_visit:
- Apply transforms for vector in-place
- Apply transforms for box in-place
2020-08-19 01:29:49 +09:00
강동윤
a62af5f38f
Allow optional constructor property parameters ( #959 )
...
swc_ecma_transforms:
- Handle optional constructor property parameters properly (#958 )
2020-08-13 11:47:33 +09:00
강동윤
fe2bcb033c
New version for swc_ecmascript
2020-08-13 01:25:38 +09:00
강동윤
0989e73a99
Metadata for typescript decorator ( #939 )
...
swc_ecma_transforms:
- Allow emitting decorator metadata (#666 , #919 )
swc:
- change order of passes to allow decorator using type informations
2020-08-06 21:23:34 +09:00
강동윤
2de59759de
Reduce size ( #928 )
...
Reduce binary size and make some dependencies optional for deno
2020-08-04 01:33:23 +09:00
강동윤
0ac55ae68b
Improve ux for rust users ( #909 )
...
testing:
- Remove dependency on relative_path
swc_common:
- Span's byte positions are now self-contained and `GLOBALS` is not required while parsing.
- Changed `Comments` into a trait.
- Provide single-threaded implementation of `Comments`
- Cargo feature `tty-emiiter` (To remove tty related stuffs )
- Cargo feature `sourcemap` (To remove sourcemap for web assets)
- Removed dependency on dashmap
swc_ecma_parser:
- No duplicated comments.
- Removed dependency on once_cell and regex
- Add a test suite to visualize and test span of nodes.
swc_ecma_utils:
- Removed dependency on parser
swc:
- Remove dependency on derive_more and path-clean
- Add multi-threaded implementation of `Comments`
swc_ecmascript:
- A new crate contains `ast`, `codegen`, `parser`, `utils`, `visit`.
2020-07-31 18:49:07 +09:00
강동윤
9b8bfb2455
Use stable rustc ( #886 )
2020-07-24 02:18:22 +09:00
alubbe
45604fa6e7
Remove dependency renaming to enable WASM ( #625 )
...
This PR supercedes https://github.com/swc-project/swc/pull/621 and tries to remove dependency renaming to enable WASM, as discussed in https://github.com/swc-project/swc/issues/106
2020-02-05 11:20:25 +00:00
강동윤
5503cde085
Extract utils from swc_ecma_transforms ( #575 )
...
swc_ecma_transforms:
- extract utils
2020-01-08 10:55:22 +09:00
강동윤
6fa85b646f
preset-env ( #537 )
...
swc_ecma_preset_env:
- can inject polyfills automatically
- can apply transforms automatically
swc:
- added env config to .swcrc
2019-12-28 11:25:54 +09:00
Zimon Dai
ec086a1dab
use 2018 edition syntax ( #479 )
2019-12-02 17:10:05 +09:00
강동윤
d074063867
Parser: Error recovery ( #449 )
...
Implement some error recovery logic to parser
2019-11-17 18:36:47 +09:00
Jasper De Sutter
716bfe05b2
Cleanup ( #448 )
...
- cargo fix
- update all crates to 2018 edition
2019-11-17 13:21:53 +09:00
강동윤
ae3326cd9d
Compiler apis & .swcrc improvement ( #434 )
...
- Expose high-level compiler apis (#431 )
- Support multiple entries in .swcrc (#414 )
2019-10-25 10:11:24 +09:00
강동윤
c648232864
Classes improvements ( #123 )
...
Now swc passes all tests from `@babel/plugin-transform-classes`
2019-01-24 16:07:09 +09:00
강동윤
3638dbc42c
Groundwork for linter ( #73 )
2018-11-20 18:32:53 +09:00
강동윤
c816d699ca
Improve ast ( #70 )
...
* Update ast (bool -> Option<Span>)
* fixup! Update ast (bool -> Option<Span>)
2018-11-19 15:52:06 +09:00
강동윤
1d0c78de6c
More works ( #66 )
...
ecma_transforms:
- implement es2015::instanceof
- implement es2015::typeof_symbol
- implement inline_globals pass
ecma_parser:
- `PResult<T>` is now `Result<T, ()>` and `Err(())` means that an error is emitted.
- add docs
2018-11-18 14:00:07 +09:00
강동윤
e12dcf0452
Compiler baseline
...
- Fix binary
- Add base for transformers
This will be last large squash.
2018-11-03 16:56:43 +09:00
강동윤
f9be576e02
Ecmascript codegen ( #40 )
...
Comment is not fully supported yet
2018-10-25 13:17:05 +09:00
강동윤
9b2a5880bb
Use FileMap as an input.
2018-01-23 21:38:48 +09:00
강동윤
fd5b4d0dc0
Revert "Merge remote-tracking branch 'refs/remotes/origin/simplifier'"
...
This reverts commit 43fcbcbef2
, reversing
changes made to 15fde7b5ff
.
2018-01-14 14:00:01 +09:00
강동윤
015ccb07f4
[WIP] Working for simplfier
2018-01-14 13:30:50 +09:00
강동윤
e949c40517
ECMAScript parser ( #1 )
...
- Parser and lexer for lastest ecma spec https://tc39.github.io/ecma262
- Lexer is currently very inefficient
- Use https://github.com/tc39/test262-parser-tests/ for testing.
- Implement proc-macro based ast folder and assert_eq_ignore_span! based on it.
- Some utilities for proc macro at /macros/common
2018-01-12 16:53:06 +09:00