Boshen
82773cb455
feat(codegen): remove underscore from bigint ( #7367 )
...
closes #7285
closes #7286
2024-11-20 09:08:51 +00:00
Dunqing
c587dd3cd6
fix(codegen): do not print parenthesis for in expression in ArrowFunctionExpression ( #7360 )
...
Please check out [esbuild](https://esbuild.github.io/try/#dAAwLjI0LjAAACgpID0+ICIiIGluIHt9 )
2024-11-19 14:29:18 +00:00
Dunqing
58db9ef322
refactor(codegen): do not print unnecessary parentheses if both sides use the same logical operator ( #7325 )
...
As shown by the changing tests, we don't need to print parentheses for them.
### Comparison
In [esbuild](https://esbuild.github.io/try/#dAAwLjI0LjAAAGEgPz8gKGIgPz8gKGMgPz8gZCkpOwooYSA/PyAoYiA/PyAoYyA/PyBkKSkpOwooYSB8fCAoYiB8fCBjKSkgfHwgZDsKYSB8fCAoYiB8fCAoYyB8fCBkKSk7CmEgJiYgKChiICYmIGMpICYmIGQp ), it will print parentheses as-is, in [SWC](https://play.swc.rs/?version=1.9.2&code=H4sIAAAAAAAAA0tUsLdX0EgCk8kgMkVT05pLIxGLMES8pgYkDiSTNTVBVIo1F5IgUDFIDKQ2UUFNTUEDKAykkjVBZIomAGEbiHtuAAAA&config=H4sIAAAAAAAAA1VQzW7DIAy%2B9ykin6tlyrHXTb3ttCdA1GmpACPbSIuqvPuAJml6w9%2Bv8ePQdXAXC6fuUZ5lSIYFeZsLIlNU81cQ0CmhWHZJ4biyKpVSztiQ%2BUmAGr6iVhPK8DkMsOJsoozEYd%2BQBb9xdBHPxF%2FeiJwd%2BossuVsVo7G68xXIhUSsv5TZYi27qSY59T1K%2BJBbn56W48vAOaoLTWuyUjDqLCz0%2FPYDTyRVNxovyw4QXHTjtF%2FdUiglIu%2FCKjXx6jf%2FYc1v6RDokhu5HL0etq5U0gLFu8BLuTZu6eDkZ7W3s8%2F%2FYy0r4MUBAAA%3D ), we have the same output now
2024-11-19 10:31:53 +00:00
Song Gao
cf3415b0e4
chore(doc): replace main/master to tag/commit to make the url always accessible ( #7298 )
2024-11-16 21:00:30 +08:00
Boshen
1282221e36
fix(codegen): print comments when block is empty ( #7236 )
...
part of #7190
2024-11-11 11:20:25 +00:00
Boshen
d1d187417b
feat(ast)!: change comment.span to real position that contain // and /* ( #7154 )
...
closes #7150
2024-11-06 05:10:33 +00:00
Boshen
40d8acfbd1
feat(codegen): improvement printing of legal comments ( #7111 )
2024-11-04 08:56:00 +00:00
Boshen
caa4b1fd2a
feat(codegen): improve printing of comments ( #7108 )
2024-11-04 05:12:59 +00:00
Boshen
001058a8e4
feat(codegen): always print legal comments on its own line ( #7089 )
2024-11-02 15:55:23 +08:00
Boshen
413973df66
feat(codegen): print linked and external legal comment ( #7059 )
...
part of #7050
2024-11-02 04:08:14 +00:00
Boshen
ee27b92465
feat(codegen): print eof legal comments ( #7058 )
...
part of https://github.com/oxc-project/oxc/issues/7050
2024-11-01 16:56:57 +00:00
Boshen
6516f9eabc
feat(codegen): print inline legal comments ( #7054 )
...
part of https://github.com/oxc-project/oxc/issues/7050
2024-11-01 16:56:56 +00:00
Boshen
05ef03dbab
fix(codegen): correct print __proto__ shorthand ( #6802 )
2024-10-23 07:16:00 +00:00
Boshen
1b7897cf01
fix(codegen): print #field in {} << 0; correctly ( #6799 )
2024-10-23 05:34:22 +00:00
Boshen
e5ed6a56a8
feat(codegen): print negative numbers ( #6624 )
2024-10-16 22:38:54 +00:00
Dunqing
e7c89a596b
test(codegen): uncomment passed tests that are related to trailing comments ( #6589 )
...
Just uncomment them and replace whitespace with `\t`
2024-10-15 16:23:41 +00:00
Dunqing
02bfbfeef5
fix(codegen): preserve parenthesis for ChainExpression ( #6430 )
...
close : #6385
The fixing way was referenced from `esbuild`, it is according to these [states](332727499e/internal/js_ast/js_ast.go (L590-L604)
)(determined in the parser) to determine whether to print parenthesis
Due to differences in implementation details, we are unable to record certain information like `esbuild` does in its parser. But fortunately, The `ParenthesisExpression` AST is actually like what `esbuild` stored states.
2024-10-13 08:03:37 +00:00
camc314
2ade16ece5
fix(codegen): invalid codegen when in inside bin expr in or loop ( #6431 )
...
https://github.com/oxc-project/monitor-oxc/actions/runs/11278829870 ??
2024-10-13 06:47:10 +00:00
camc314
6896efc00c
fix(codegen): fix in in sequence expr in for loops ( #6428 )
...
not sure if this is right, but it doesn't break any existing tests so hopefully?
2024-10-13 06:47:09 +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
Dunqing
702b574afb
refactor(codegen): only print necessary parentheses in TSAsExpression ( #6429 )
...
Part of fixing #6385
2024-10-11 02:04:27 +00:00
Dunqing
585cdd5bcd
chore(codegen): add more tests for comments from esbuild ( #6357 )
...
Copy from https://github.com/rolldown-rs/rolldown/blob/main/crates/rolldown/tests/esbuild/dce/remove_unused_pure_comment_calls/entry.js
2024-10-08 05:42:43 +00:00
Dunqing
84b2d072e8
fix(codegen): converts line comment to block comment if it is a PURE comment ( #6356 )
...
The last part of fixing https://github.com/rolldown/rolldown/pull/2375/files#r1789011257
In the following case, the pure comment was written by `//`
```ts
const Component = // #__PURE__
React.forwardRef((props, ref) => {});
```
The printed code looks like this
```ts
const Component =
// #__PURE__ React.forwardRef((props, ref) => {});
```
As you can see, it is broken because the code also commented, so we need to replace `//` with `/* */`
2024-10-08 05:42:42 +00:00
Boshen
020bb80b65
refactor(codegen)!: change to CodegenReturn::code and CodegenReturn::map ( #6310 )
2024-10-06 05:05:47 +00:00
Dunqing
8582ae3e91
fix(codegen): missing parentheses if there is a pure comment before a NewExpression as a ComputedMemberExpression's callee ( #6105 )
...
refer to 332727499e/internal/js_printer/js_printer.go (L2544)
2024-09-27 07:12:31 +00:00
Dunqing
93d509db2b
chore(codegen): test function reports duplicate error information ( #6067 )
...
<img width="649" alt="image" src="https://github.com/user-attachments/assets/7789a7b4-56fb-40a2-a76d-52a55fe2bfad ">
2024-09-27 05:51:31 +00:00
Dunqing
cca433f84a
feat(codegen): print vite / webpack special comments ( #6021 )
...
Related: https://github.com/oxc-project/oxc/issues/1046#issuecomment-2347345319
Close : #6024
2024-09-26 15:19:31 +00:00
Dunqing
fe696f0dec
refactor(codegen): simplify printing annotation comments ( #6027 )
...
Simplify printing annotation comments, reusing the architecture of printing JSDoc.
2024-09-25 06:27:18 +00:00
Boshen
9ca202a01e
fix(codegen): preserve newlines between comments ( #6014 )
...
fixes #6010
2024-09-24 05:14:02 +00:00
camc314
4a99372c14
fix(codegen): print jsdoc comments for TSEnumMembers ( #6007 )
...
closes #6006
Boshen/Dunqing please feel free to take over this PR. it's a bit outside what i normally work on. 🙂
2024-09-24 01:12:57 +00:00
Boshen
f4aefb57d8
fix(codegen): print let[0] as (let)[0] ( #5947 )
2024-09-21 15:09:55 +00:00
Boshen
d901772daa
feat(codegen): implement minify number from terser ( #5929 )
2024-09-20 14:42:28 +00:00
Boshen
9f6696a6aa
feat(codegen): add new lines to TSTypeParameterDeclaration ( #5853 )
2024-09-18 11:44:24 +00:00
Boshen
bcdbba3981
feat(codegen): print jsdoc comments that are attached to statements and class elements ( #5845 )
...
I am unable to print all comments correctly. Comments have way too much semantic meaning in JavaScript.
This PR reduces the scope to only print jsdoc comments that are attached to statements and class elements, in order to get isolated declarations shipped.
2024-09-18 07:58:22 +00:00
Boshen
5901d2a0f1
fix(codegen): various spacing issues ( #5820 )
2024-09-17 09:03:28 +00:00
Boshen
bb95306efd
refactor(codegen): change annotation comment tests to snapshot ( #5800 )
2024-09-16 05:03:43 +00:00
Boshen
4a8aec1605
feat(span)!: change SourceType::js to SourceType::cjs and SourceType::mjs ( #5606 )
2024-09-08 14:11:02 +00:00
Boshen
d62defb42d
fix(codegen): do not print trailing commas for ArrayExpression ( #5551 )
...
closes #5532
2024-09-06 16:35:10 +00:00
Boshen
1bed5ce2a5
chore: run cargo +nightly fmt to sort imports ( #5503 )
...
They are never going to be stable are they ... cedf7a4daa/.rustfmt.toml (L8-L16)
2024-09-06 04:04:26 +00:00
rzvxa
0df1d9d97b
fix(ast, codegen, linter): panics in fixers. ( #5431 )
...
Closes #5434
https://github.com/oxc-project/oxlint-ecosystem-ci/actions/runs/10685877915/job/29619941099
2024-09-05 05:59:22 +00:00
Dunqing
c78291600e
feat(codegen): print type_parameters in TaggedTemplateExpression ( #5438 )
2024-09-04 11:24:04 +00:00
Boshen
5c4c00123d
fix(codegen): print export @decorator declare abstract class Foo correctly ( #5303 )
2024-08-28 15:30:39 +00:00
Dunqing
292d162b23
feat(codegen): print missing fields for AccessorProperty ( #5291 )
...
Found in https://github.com/oxc-project/monitor-oxc/actions/runs/10592050362/job/29350666018
2024-08-28 08:42:39 +00: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
f210cf7873
fix(codegen): print TSSatisfiesExpression and TSInstantiationExpression ( #4936 )
...
I can't figure out the precedence so printing extra parentheses instead ...
2024-08-16 09:53:17 +00:00
IWANABETHATGUY
d49fb160e3
feat(oxc_codegen): support generate range leading comments ( #4898 )
...
1. Support print range leading comments for specific expr or stmt
2024-08-15 04:20:48 +00:00
Boshen
21f576252a
fix(codegen): minify large numbers ( #4889 )
2024-08-14 06:52:17 +00:00
Boshen
e8de4bde41
fix(codegen): fix whitespace issue when minifying x in new Error() ( #4886 )
2024-08-14 04:29:17 +00:00
Boshen
a2269625cc
fix(codegen): print TSNonNullExpression ( #4869 )
2024-08-13 08:47:07 +00:00