Boshen
afe728a73a
feat(parser): parse regular expression with regex parser ( #4998 )
...
Many false positives and incorrect errors. @leaysgur Enjoy 😁
Run `just conformance` to update the snapshot.
2024-08-22 03:09:55 +00:00
Boshen
fbfd852cf8
refactor(minifier): add NodeUtil trait for accessing symbols on ast nodes ( #4734 )
2024-08-08 02:48:25 +00:00
Boshen
9be29af9d4
fix(minifier): temporarily fix shadowed undefined variable ( #4678 )
2024-08-06 04:58:39 +00:00
Boshen
e8b662a314
fix(minifier): various fixes to pass minifier conformance ( #4667 )
2024-08-05 16:31:19 +00:00
Boshen
e78cba6464
refactor(minifier): ast passes infrastructure ( #4625 )
...
After studying google closure compiler, I'm leaning towards a multi-ast-pass infrastructure for the minifier.
This is one of the few places where we are going to trade maintainability over performance, given the goal of the minifier is compression size not performance.
All of the terminologies and separation of concerns are aligned with google closure compiler.
Infrastructure of `terser` and `esbuild` are not suitable for us to study nor pursuit. Their code are so tightly coupled - I failed to comprehend any of them every time I try to walk through a piece of optmization. Google closure compiler despite being written in Java, it's actually the most readable minifier out there.
To improve performance between ast passes, I envision a change detection system over a portion of the code.
The benchmark will demonstrate the performance regression of running 5 ast passes instead of 2.
To complete this PR, I need to figure out "fix-point" and order of these ast passes.
2024-08-04 11:58:39 +00:00
Boshen
6a94e3f573
fix(codegen): fixes for esbuild test cases ( #4503 )
2024-07-28 08:57:15 +00: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
aaac2d8775
fix(codegen): preserve parentheses from AST instead calculating from operator precedence ( #4055 )
...
…operator precedence
Calculating from operator precedence is currently unsafe and will result
incorrect semantics.
2024-07-05 14:01:17 +08:00
Boshen
c041e9d1a9
chore: bump test262, babel and TypeScript submodules ( #3644 )
2024-06-12 18:42:32 +08:00
Boshen
530455849b
chore(tasks): add commit sha to snapshots to make sure submodules are not outdated ( #3267 )
...
If submodules are outdated, it'll panic with the following message
```
Repository is outdated, please run `just submodules` to update it.
```
For us maintainers, we'll need the env `UPDATE_SNAPSHOT` to force an update.
2024-05-14 10:18:00 +00:00
Boshen
ad133ba647
chore: update snapshots
2024-01-22 19:16:09 +08:00
Boshen
a69b76ab77
chore: update snapshots
2024-01-15 21:13:05 +08:00
Boshen
7fca9504d2
chore: update snapshots
2023-11-28 16:27:10 +08:00
magic-akari
9ff0ffcc6f
feat(ast): implement new proposal-import-attributes ( #1476 )
...
- [Import Attributes](https://tc39.es/proposal-import-attributes )
2023-11-25 15:56:09 +08:00
Boshen
809f050a5f
feat(codegen): move minifying printer to codegen crate ( #985 )
2023-10-12 14:56:30 +08:00
Boshen
ef8aaa7bf1
feat(minifier): re-enable mangler ( #972 )
2023-10-10 14:32:58 +08:00
Cameron
5b1e1e5408
feat(parser): TypeScript 5.2 ( #811 )
...
- adds support for [Using
Declarations](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management )
Closes #786
2023-10-05 12:52:14 +13:00
Boshen
1ed8df2d83
feat(parser): parse const type parameter from TypeScript v5.0 ( #416 )
2023-06-08 22:26:35 +08:00
Wenzhe Wang
ddc129262d
feat(minifer): minify number ( #405 )
2023-06-03 21:24:39 +08:00
Boshen
f8125af850
feat(minimizer): print parentheses
2023-06-01 22:45:26 +08:00
Boshen
c613583544
chore(coverage): bump coverage status
2023-05-25 18:46:48 +08:00
Boshen
fc7a374e7c
feat(coverage): add a directory for tests
...
closes #363
2023-05-20 23:02:30 +08:00
Wenzhe Wang
9678832f2b
fix: add parens for unary expression ( #362 )
2023-05-17 10:13:48 +08:00
Wenzhe Wang
bd56bb7abe
fix(minifier): break directive prologue ( #360 )
2023-05-16 21:35:58 +08:00
Boshen
5be0d1b9fa
fix(hir): bring back ParenthesizedExpression as it caused too much chaos
2023-05-14 22:54:57 +08:00
Wenzhe Wang
e6737fdc48
fix(minifier): continue compress left expr ( #356 )
2023-05-14 13:03:34 +08:00
Boshen
6db5f4e59b
fix(minifier): print SequenceExpression and ObjectExpression with parens
2023-05-13 21:57:02 +08:00
Wenzhe Wang
7b834d4bd9
fix(minifier): not merge different kinds of declarations. ( #353 )
2023-05-13 10:51:10 +08:00
Boshen
7496bb521f
fix(minifier): print if.consequent correctly ( #349 )
2023-05-11 11:00:49 +08:00
Boshen
e753a886d2
fix(minifier): add parentheses to CallExpression on FunctionExpression
2023-05-08 23:04:35 +08:00
Boshen
c2428d8abd
chore: rename oxc_printer to oxc_formatter ( #336 )
2023-05-07 17:47:13 +08:00
Boshen
4d4fb3ac7f
chore: update submodule and snapshots
2023-04-18 21:12:18 +08:00
Boshen
92ba59443c
feat(tasks): add minifier coverage test ( #292 )
2023-04-17 21:30:04 +08:00