Boshen
3efbbb2e1f
feat(ast): add "abstract" type to MethodDefinition and PropertyDefinition ( #2536 )
...
closes #2532
```
pub enum PropertyDefinitionType {
PropertyDefinition,
TSAbstractPropertyDefinition,
}
pub enum MethodDefinitionType {
MethodDefinition,
TSAbstractMethodDefinition,
}
```
2024-02-28 17:33:11 +08:00
renovate[bot]
29b213eac7
chore(deps): update rust crates ( #2503 )
2024-02-26 10:38:11 +08:00
Andrew McClenaghan
6b3b260dcc
feat(Codegen): Improve codegen ( #2460 )
...
This gets all the new TS types working to the same level TS output was
before and fixes a bunch of other codegen
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-02-21 14:41:57 +08:00
Dunqing
197fa16613
feat(semantic): add check for duplicate class elements in checker ( #2455 )
...
1. Remove the check implementation of the parser
2. Implement it to semantic checker
3. Support typescript's check for duplicate class elements
Support checking for duplicate class elements in semantic checker is
easier to support typescript checking rules.
2024-02-21 14:10:19 +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
Dunqing
60db720fa6
feat(parser): parse import attributes in TSImportType ( #2436 )
...
close : #2394
64d2eeea7b/src/compiler/types.ts (L2177-L2185)
The corresponding test cases were skipped, so I manually added some
cases to misc
f5db48237f/tasks/coverage/src/typescript.rs (L118-L121)
2024-02-19 12:26:42 +08:00
Dunqing
b5deb9a708
fix(codegen): when async is on the left-hand side of a for-of, wrap it in parentheses ( #2407 )
...
Refer to
55e1127a49/internal/js_printer/js_printer.go (L3097-L3104)
2024-02-13 22:42:23 +08:00
Boshen
1cbd7539fb
feat(coverage): add prettier idempotency test ( #2402 )
...
closes #1329
2024-02-12 15:30:16 +08:00
Boshen
70a0076eed
refactor: remove global allocator from non-user facing apps ( #2401 )
...
The runtime performance gains does not out weight the compilation speed from
building the custom allocators, which takes about a minute to build on
slower machines.
2024-02-12 14:09:05 +08:00
Dunqing
73e116e8a1
fix(parser): incorrect parsing of class accessor property name ( #2386 )
2024-02-11 22:57:13 +08:00
Dunqing
0df7e296f9
feat(tasks/codegen): check node version >= 20 ( #2385 )
...
This syntax only works on node >= 20
`import value from './json-value-array_FIXTURE.json' with { type: 'json'
};`
2024-02-11 19:23:11 +08:00
Boshen
ef336cb66b
feat(parser): recover from async x [newline] => x ( #2375 )
...
```javascript
async x
=> x
```
Babel recovers and displays "No line break is allowed before '=>'
2024-02-10 11:19:08 +08:00
Dunqing
2eb489e996
fix(codegen): format new expession + import expression with the correct parentheses ( #2346 )
...
Similar to #2330
2024-02-09 20:51:50 +08:00
Dunqing
55011e2793
feat(codegen): avoid printing comma in ArrayAssignmentTarget if the elements is empty ( #2331 )
2024-02-06 22:45:19 +08:00
Boshen
43a9cb5522
chore: update snapshot
2024-02-06 22:17:59 +08:00
Dunqing
a3570d41f0
feat(semantic): report parameter related errors for setter/getter ( #2316 )
2024-02-05 17:38:43 +08:00
Dunqing
9ca13d040d
feat(semantic): report type parameter list cannot be empty ( #2315 )
2024-02-05 16:05:51 +08:00
Dunqing
d6d931cd80
fix(tasks/coverage): when providing filter, do not run just submodules ( #2310 )
2024-02-05 15:06:37 +08:00
Dunqing
f53c54ced9
feat(semantic): report unexpected type annotation in ArrayPattern ( #2309 )
2024-02-05 13:45:52 +08:00
underfin
2f97b332bd
chore: codegen test skip v8 failed test ( #2283 )
...
Because v8 isn't pass some test262 tests, we also need to skip them, you
can find it at
https://chromium.googlesource.com/v8/v8/+/refs/heads/main/test/test262/test262.status .
2024-02-04 14:02:39 +08:00
Boshen
d2f7ea2923
chore: manually clone git modules instead of using submodules ( #2274 )
...
closes #2231
Submodules are a blocker for beginners, we should make it clone on
demand.
It is also a blocker for people who wants to target this repo as a crate
for testing purposes, cargo will do a full clone if you specify
oxc_parser = { git = "this repo" } in Cargo.toml
2024-02-02 11:56:18 +00:00
Boshen
28daf83b19
feat(semantic): report no class name error ( #2273 )
...
closes #2144
2024-02-02 19:05:00 +08:00
Boshen
650f6c942f
refactor: use our forked version of miette::Reporter for tests ( #2266 )
2024-02-02 16:15:31 +08:00
Dunqing
da2ffdf7a0
feat(semantic): check parameters property ( #2264 )
2024-02-02 15:58:32 +08:00
Dunqing
d71175e712
feat(semantic): check optional parameters ( #2263 )
2024-02-02 15:54:04 +08:00
Boshen
8d99a15ac9
feat(semantic): report error on optional variable declaration in TypeScript ( #2261 )
...
closes #2253
closes #2255
2024-02-02 14:13:10 +08:00
Tzvi Melamed
73ccf8a4da
fix(oxc_semantic): proper traversal of try statements ( #2250 )
...
Closes #2227
2024-02-01 20:46:38 +08:00
Wenzhe Wang
5fb5d8a01e
chore(tasks): update codegen runtime snapshot ( #2223 )
2024-01-31 12:25:28 +08:00
renovate[bot]
d7a9bcf191
chore(deps): update rust crates ( #2199 )
2024-01-30 15:30:22 +08:00
Dunqing
f59e87f9c4
refactor(semantic): checking label in ContinueStatement based on LabelBuilder ( #2202 )
2024-01-29 18:24:42 +08:00
Dunqing
56adfb1a86
refactor(semantic): use LabelBuilder instead of UnusedLabeled ( #2184 )
...
I think `UnusedLabeled` can do more than that.
1. Collect unused label
2. Support check duplication label
3. Support check label in `BreakStatement`
4. Support check label in `ContinueStatement` (Not yet)
But then the `UnusedLabeled` name wouldn't fit, so I renamed it
`LabelBuilder` and moved it to `label.rs`
2024-01-29 15:15:07 +08:00
Dunqing
ea8cc98c34
fix(ast): AcessorProperty is missing decorators ( #2176 )
2024-01-26 15:43:05 +08:00
underfin
989ab88bc6
fix(codegen): print Directive original string ( #2157 )
...
> A Use Strict Directive may not contain an EscapeSequence or
LineContinuation.
It is `Use Strict Directive` spec, but the `expression` of `Directive`
isn't original string value, it has error if using it to codegen, so
here using `directive` of `Directive` to codegen and not to escape it.
Here is crashed test cases.
``` js
'use str\
ict';
```
The babel will print the original string, I follow it and avoid using
`print_str` because it will escape string.
I also changed some code using the `expression` of `Directive` to check
`Use Strict Directive` .
2024-01-25 15:24:05 +08:00
Boshen
ad133ba647
chore: update snapshots
2024-01-22 19:16:09 +08:00
Boshen
26571c72de
chore(just): change sync command to sync-submodules
...
This should avoid accidentally running the command
2024-01-22 17:45:13 +08:00
Boshen
2f5afff9bd
fix(parser): fix crash on TSTemplateLiteralType in function return position ( #2089 )
...
```
interface Helpers {
inspect(): `~~~~\n${string}\n~~~~`;
}
```
2024-01-19 23:14:05 +08:00
Boshen
b0f4715df1
ci: disable codegen runtime tests for now
...
It seems to be unstable across node.js versions
2024-01-15 21:24:07 +08:00
Boshen
a69b76ab77
chore: update snapshots
2024-01-15 21:13:05 +08:00
Valerii Smirnov
c60c31521e
feat(linter): eslint-plugin-import no-named-as-default-member rule ( #1988 )
...
- Docs:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md
- Code:
https://github.com/import-js/eslint-plugin-import/blob/main/src/rules/no-named-as-default-member.js
- Tests:
https://github.com/import-js/eslint-plugin-import/blob/main/tests/src/rules/no-named-as-default-member.js
2024-01-15 11:03:04 +00:00
dependabot[bot]
21909fa962
chore(deps): bump the dependencies group with 3 updates ( #2033 )
2024-01-15 15:31:32 +08:00
Dunqing
0a086860da
feat(ast): visit TSModuleReference ( #1998 )
...
### Failed cases:
* 7c29fbc4db/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/input.ts
* 7c29fbc4db/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/input.ts
We need to distinguish whether a reference is a type or a js variable
2024-01-11 23:29:29 +08:00
Dunqing
4e7b7dad78
feat(task): handle expected runtime error correctly ( #1987 )
2024-01-11 15:04:28 +08:00
Dunqing
6417d2ce9c
feat(task): test codegen runtime in run_async ( #1980 )
...
<img width="460" alt="image" src="https://github.com/oxc-project/oxc/assets/29533304/4f2d05a1-4d3e-422e-9722-0c77d4ff989d ">
2024-01-11 14:59:29 +08:00
Dunqing
ee286a0a48
feat(task): support run async in suite ( #1973 )
2024-01-11 14:54:30 +08:00
Dunqing
633b21c5d2
feat(task): skips some cases we don't care about in codegen-runtime ( #1986 )
...
#1977
2024-01-11 14:50:39 +08:00
Dunqing
fc7dbd9225
feat(task): codegen test262 runtime test ( #1959 )
2024-01-10 17:12:11 +08:00
Dunqing
b50c5ec623
fix(parser): unexpected ts type annotation in get/set ( #1942 )
...
fix: https://github.com/oxc-project/oxc/issues/1939
2024-01-08 15:07:43 +08:00
Boshen
08438e04ba
refactor(parser): remove TokenValue::RegExp from Token ( #1926 )
...
This PR is part of #1880 .
`Token` size is reduced from 48 to 40 bytes.
To reconstruct the regex pattern and flags within the parser , the regex
string is
re-parsed from the end by reading all valid flags.
In order to make things work nicely, the lexer will no longer recover
from a invalid regex.
2024-01-08 13:48:52 +08:00
Dunqing
3b4fe0edfd
feat(semantic): allow reserved keyword defined in ts module block ( #1907 )
...
https://www.typescriptlang.org/play?target=99#code/PTAEAEBcEMCcHMCmkBcpEGcB2iAekAoECAWwHsATAVwBtE1MAmABkcYBpMd8CiwAHKgCNQAYzJYMkUAGUAKgCUAkgGE5AfQCyAeQAiAUXUA5AIKb9MtDOQAeAGQByKdEgBLUaCmwAfKAC8oPwAFgBm6hjIAISgAN58oAkJAESuJPx0JIhYkBhJ7PGJoCnZiLAh0KKIeQWJSXSQ1cSFSfwVANbQSI1gzfywrgBuLlX5TbV9ZJCIolMU3YVFgkI07vPNzm6ia7UAnq6INHOjYAC+ANy8ePxksNIx5wQU0zRwiKBY0JkYrZWgIWRkWKgAgJcSSaSpdKITLZDBoaBYHZnYGgiRSQLCFaieGI5EgsRoiElMoVeigBFIlGgIawUD1HGU-Fg9E-DpIBl41HgwL9IZTDlMwk8ybTWYCrnojbucUE7l7A4UAUnAhAA
2024-01-06 12:56:27 +08:00
Dunqing
6c5b22f728
refactor(semantic): improve ClassTable implmention and merge properties and methods to elements ( #1902 )
2024-01-05 18:38:51 +08:00