Boshen
8f179534c2
fix(coverage): remove some broken cases ( #6797 )
2024-10-23 03:10:49 +00:00
Boshen
7645e5c34b
refactor(codegen)!: remove CommentOptions API ( #6451 )
2024-10-11 13:53:28 +00:00
Boshen
520096030a
refactor(oxc)!: remove passing Trivias around ( #6446 )
...
part of #6426
2024-10-11 06:09:25 +00:00
Boshen
020bb80b65
refactor(codegen)!: change to CodegenReturn::code and CodegenReturn::map ( #6310 )
2024-10-06 05:05:47 +00:00
overlookmotel
f3e1662e4e
improve(codegen): improve oxc_codegen example ( #5198 )
...
Improve `oxc_codegen` example to demonstrate best practice of resetting the allocator once the AST stored in it is no longer needed, before parsing another file.
2024-08-25 14:58:27 +00:00
Boshen
0410314278
chore(codegen): improve examples
2024-08-24 13:38:19 +08:00
Boshen
ce4d4698b4
feat(codegen)!: remove const generic MINIFY ( #5001 )
...
This is a premature optimization, makes the code complicated, and bloats the final binary size.
The minify option is moved to `CodegenOptions`
2024-08-20 08:13:27 +00:00
Boshen
4a5695416d
fix(codegen): print raw if value is number is Infinity ( #4676 )
2024-08-06 03:24:40 +00:00
Boshen
44a10c4b91
fix(codegen): object shorthand with parens ({x: (x)}) -> ({ x }) ( #4391 )
2024-07-21 14:04:17 +00:00
Boshen
bf3d8d3e8f
fix(codegen): print annotation comment inside parens for new and call expressions ( #4290 )
2024-07-16 06:55:36 +00:00
Boshen
9a094e861e
chore(codegen): add ts snapshot test
2024-07-14 20:46:22 +08:00
Boshen
e167ef79c6
fix(codegen): print parenthesis properly ( #4245 )
...
`TSParenthesizedType` handles parenthesis in ts types.
It should be considered a bug if parenthesis is not printed correctly after this PR.
2024-07-14 04:13:10 +00:00
Boshen
5c38a0fd69
feat(codegen)!: new code gen API ( #3740 )
...
This PR introduces two type alias to avoid the confusing const generic `pub struct Codegen<'a, const MINIFY: bool>`
* CodeGenerator - Code generator without whitespace removal.
* WhitespaceRemover - Code generator with whitespace removal.
Usage is changed to a builder pattern:
```rust
CodeGenerator::new()
.enable_comment(...)
.enable_sourcemap(...)
.build(&program);
```
2024-06-18 15:50:12 +00:00
Boshen
982e6f08df
chore: make println and eprintln opt-in ( #3712 )
...
I noticed accidental `println` can be merged, which isn't really nice.
2024-06-17 10:40:34 +00:00
Boshen
4f166642a0
refactor(transformer_dts): create a Program for codegen ( #3679 )
2024-06-15 05:44:25 +00:00
Boshen
534242a729
feat(codegen)!: remove CodegenOptions::enable_typescript ( #3674 )
...
The typescript transform pass is now required to strip typescript syntax
for codegen to print things properly.
Codegen will now print whatever is in the AST.
2024-06-14 21:56:00 +08:00
Boshen
b58d8eb88f
fix!(codegen): remove the unecessary 4th argument from Codegen::new ( #3640 )
2024-06-12 07:58:54 +00:00
IWANABETHATGUY
0cdb45a1ff
feat(oxc_codegen): preserve annotate comment ( #3465 )
...
1. Copy tests from
efa3dd2d8e/internal/bundler_tests/bundler_dce_test.go (L3833-L3971)
2. Add option to preserve annotate comment like `/* #__NO_SIDE_EFFECTS__
*/` and `/* #__PURE__ */`
2024-05-30 15:25:23 +08:00
Boshen
9ced605487
refactor(parser): start porting arrow function parsing from tsc ( #3340 )
...
relates #3320
2024-05-18 22:35:29 +08:00
underfin
d9b77d853b
refactor(sourcemap): change sourcemap name to take a reference ( #2779 )
2024-03-23 21:40:05 +08:00
Boshen
ef932a3c27
refactor(codegen): clean up API around building sourcemaps ( #2602 )
...
closes #2564
2024-03-04 16:03:33 +08:00
Boshen
a2c173de57
refactor: remove panic! from examples ( #2454 )
...
relates #2308
2024-02-20 16:18:39 +08:00
Andrew McClenaghan
e6d536cb9b
feat(codegen): configurable typescript codegen ( #2443 )
...
- Adds option to `CodegenOptions` - `enable_typescript` to enable output
of TS.
- Stops skipping output that is TS when `enable_typescript` is enabled
- Adds TS support to
- Function
- FormalParameter
- BindingPattern
- Adds basic tests for TS generation
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-02-20 12:09:28 +08:00
Wenzhe Wang
6c18b3e8ec
feat(codegen): beauty class print ( #995 )
2023-10-15 16:37:01 +08:00
Boshen
f32bf27106
fix(codegen): fix some typescript codegen problems ( #989 )
2023-10-13 16:23:48 +08:00
Boshen
e0ca09b1c9
feat(codegen): implement the basics of non-minifying codegen ( #987 )
2023-10-13 13:34:21 +08:00
Boshen
f28d96c378
feat(codegen): initialize the codegen crate and struct ( #983 )
2023-10-12 10:41:44 +08:00