Commit Graph

76 Commits

Author SHA1 Message Date
강동윤
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
강동윤
6a1c3da326
fix(bundler): Fix bugs (#1346)
swc_bundler:
 - Fix keywords pass.

swc_ecma_transforms_optimization:
 - Remove `dbg!`.
 - `constant_propagation`: Inline only injected variables.
2021-01-22 18:39:57 +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
강동윤
a9bf9bb9e1
fix(swc): Fix bugs (#1300)
swc_ecma_codegen:
 - Handle unicode escape sequences when target is es5. (#1227, #1326)

swc_ecma_transforms_compat:
 - Handle template literals correctly. (#1314)
 - Handle private class properties correctly. (#1306)

swc:
 - Don't panic on `export * as foo from 'foo'`. (#1307)
2021-01-14 21:56:25 +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
강동윤
ebc0d0a203 fix(bundler): Publish 2021-01-11 20:08:39 +09:00
강동윤
f0ca499b92 Include build.rs 2021-01-11 20:03:12 +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
강동윤
842b6f953c
fix(ecmascript/transforms): Fix dce (#1301)
swc_bunder:
 - Fix `keywords` pass.

swc_ecma_codegen:
 - Ensure that the code generator handles unicode characters properly. (denoland/deno#8925)

swc_ecma_parser:
 - Ensure that the parser handles unicode characters properly. (denoland/deno#8925)

swc_ecma_transforms:
 - Fix dce.
2021-01-05 18:45:26 +09:00
강동윤
76d9e2a9df
feat(ecmascript/transforms): Split into multiple crates. (#1311) 2021-01-05 14:29:52 +09:00
강동윤
bc7ac45d87
fix(bundler): Don't load dynamic imports (#1297)
swc_bundler:
 - Do not load dynamically imported files.
2020-12-29 00:09:46 +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
강동윤
b66ee58ee3
fix(bundler): Fix statement ordering issue (#1264)
swc_bundler:
 - Reduce binary size by reducing usage of visitor / folders.
 - Handle `export *` and `export { default }` from same source. (denoland/deno#8530, denoland/deno#8679)
 - Fix ordering of statements. (denoland/deno#8545)
 - Sort statements in wrapped modules. (https://github.com/denoland/deno/issues/8211#issuecomment-741070299)
 - Exclude default export while handling `export *`.
 - Exclude `export { default }` and `export { foo as default }` while handling `export *`.
 - Make statements from same module to be injected together. (denoland/deno#8620)

swc_ecma_transforms:
 - fixer: Handle assignments in the callee of `new`  correctly.
 - fixer: Handle seqence expression in the callee of `new`  correctly.
2020-12-27 19:02:41 +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
강동윤
0ead8dc403
fix(ci): Fix ci (OOM & library api change) (#1284) 2020-12-20 21:31:00 +09:00
강동윤
03f9b93f58
Fix bundler (#1247)
swc_bundler:
 - Handle indirect wrapped es modules. (denoland/deno#8597, denoland/deno#8625)
 - Respect `export { foo }`. (denoland/deno#8626)

swc_ecma_parser:
- Allow `??=`, `||=`, `??=` in non-ts modules. (denoland/deno#8627)

swc_ecma_transforms:
 - Make `hygiene` check if a variable with expanded name exists. (denoland/deno#8620)
 - Handle `??=` correctly.
2020-12-09 14:23:44 +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
강동윤
547846310d
Fix bundler (#1246)
swc_bundler:
 - Reduce level of logging.
 - Handle export specifiers without alias. (denoland/deno#8573)
 - Handle normal initialization while reordering statements. (denoland/deno#8574)
 - Handle top level `await`s in wrapped modules. (denoland/deno#8584)
 - Add benchmark for the bundler.
2020-12-02 22:48:35 +09:00
강동윤
19cbdc34ff
Fix bundler (#1245)
swc_bundler:
 - Handle `default` while merging reexports. (https://github.com/denoland/deno/issues/8211#issuecomment-736498065)
2020-12-02 14:51:54 +09:00
강동윤
ea6beaa06d
Fix bundler (#1242)
swc_ecma_codegen:
 - Fix codegen of unicode escapes. (denoland/deno#8541)

swc_bundler:
 - Allow importing a module multiple time. (denoland/deno#8530)
2020-11-30 18:21:34 +09:00
강동윤
8ca3d1160d
Fix bundler (#1234)
swc_bundler:
 - Handle dependencies of circular modules in wrapped modules. (#1214)
 - Handle `export * from './file.ts'` properly. (denoland/deno#8481)
 - Fix deglobbing. (denoland/deno#8486)
2020-11-27 19:37:22 +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
강동윤
c6cfa9d73f
Fix bundler: stack overflow and circular imports (#1205)
swc_bundler:
 - Fix infinte loop (denoland/deno#8224)
 - Fix order of merging with circular imports. (Fixes denoland/deno#8246)
 - Fix detection of circular imports.
 - Fix logic of lca calculation.
 - Fix sorting algorithm.
2020-11-06 18:42:04 +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
Nayeem Rahman
64942b5006
bundler: Use a local variable for import.meta (#1201)
swc_bundler:
 - Convert `import.meta` into a local variable.
2020-11-04 18:34:05 +09:00
Nayeem Rahman
3cdb62bfd8
bundler: Improve hook for import.meta (#1195)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-11-02 15:22:21 +09:00
강동윤
ce6ded1dee
Fix bundler: luxon.js (#1196)
swc_bundler:
 - Determine order of merging based on dependency graph. (denoland/deno#8211)
2020-11-02 14:55:28 +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
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
강동윤
41d1738b82
bundler: Make output deterministic (#1166)
swc_bundler:
 - Make output deterministic
2020-10-16 18:02:42 +09:00
강동윤
ad7cb6544d
bundler: Handle computed accesses correctly (#1159)
swc_bundler:
 - Handle computed accesses to imports correctly.
 - Make planning deterministic.
 - Prefer exports over imports while planning.
 - Fix https://deno.land/x/oak@v6.3.1/examples/server.ts
2020-10-14 23:28:38 +09:00
강동윤
a5e6242601 Bump version 2020-10-14 14:39:51 +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
강동윤
6f006208ac
bundler: Fix bugs (#1154)
swc_bundler:
 - Fix importing from transitive dependencies with aliases.
 - Fix stack overflow while computing plan for modules with cyclic dependencies.
 - Handle `export *` for function / class properly. (#1155)
2020-10-10 18:32:31 +09:00
강동윤
f0ea70cb25
bundler: Allow importing and exporting from same module (#1152)
swc_bundler:
 - Allow importing and exporting from same module. (#1150)
2020-10-09 19:10:25 +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
강동윤
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
강동윤
c127cb2b48
bundler: fix bugs (#1141)
swc_bundler:
 - Handle aliased imports of reexports correctly. (#1138)
 - Fix import deglobber. (#1139)
2020-10-06 13:39:25 +09:00
강동윤
81490dec7b
Fix unexporter (#1128)
swc_bundler:
 - Make DepUnexporter unexport export declarations.
2020-10-04 16:00:56 +09:00