Boshen
e6922df3bb
feat(parser): fix incorrect AST for x?.f<T>() ( #7387 )
2024-11-21 06:10:48 +00:00
Boshen
885e37f8eb
feat(transformer): Optional Chaining ( #6990 )
...
close : #6958
2024-11-21 03:12:18 +00:00
Boshen
0c1fb96760
fix(tasks/coverage): run runtime tasks concurrently to avoid timeout ( #7384 )
2024-11-21 03:05:20 +00:00
Boshen
666b6c104c
fix(parser): add missing ChainExpression in optional TSInstantiationExpression ( #7371 )
2024-11-20 11:51:55 +00:00
Boshen
7bf970a4b6
refactor(linter)!: remove tree_shaking plugin ( #7372 )
...
This rule has been in `nursery` for a long time and I don't see it
coming out of `nursery` in the foreseeable future.
closes #7031
clsoes #7057
2024-11-20 11:46:29 +00:00
renovate[bot]
b3965bbff0
chore(deps): update npm packages ( #7364 )
2024-11-20 17:26:48 +08:00
Alexander S.
d3a0119a42
feat(oxlint): add cwd property to LintRunner ( #7352 )
...
allows to use multiple `LintRunner` in one file targeting multiple
directory.
The current problem is for the test in #7348 we can not change
`env::current_dir`,
so as a workaround I introduce a new property :)
See more info here:
https://discord.com/channels/1079625926024900739/1117322804291964931/1308179827576016897
2024-11-20 12:44:50 +08:00
Boshen
514878d927
fix(transform_conformance): only run exec tests when specified ( #7359 )
2024-11-19 13:13:11 +00:00
Boshen
d60801218e
feat(transform_conformance): snapshot our transformed outputs ( #7358 )
2024-11-19 12:49:44 +00:00
Boshen
84f3bf2f97
refactor(transform_conformance): clean up test execution code ( #7357 )
2024-11-19 12:22:42 +00:00
Boshen
d0e64fd80a
refactor(transform_conformance): remove TestCase trait ( #7356 )
2024-11-19 10:52:42 +00:00
Dunqing
6cfb5df9b9
feat(transformer): support generate proper binding name from ChainExpression ( #7326 )
2024-11-19 10:31:54 +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
Boshen
65f1e82bd8
refactor(transform_conformance): clean up some code ( #7354 )
2024-11-19 09:15:14 +00:00
Boshen
7b83a3ddfa
chore(tasks/coverage): update runtime.snap
2024-11-18 18:01:49 +08:00
overlookmotel
5d853869eb
refactor(transformer/arrow-functions): use IndexMap for super getter/setters ( #7317 )
...
Generate getter/setter declarations in same order as Babel by using `IndexMap` instead of `HashMap` to store `super` getter/setter method details.
2024-11-17 10:07:34 +00:00
Nicholas Rayburn
7b7555a0ab
docs(website): Link to specific ref when generating website docs ( #7324 )
...
Currently the website links to main which is subject to change without
an update to the website. This updates the website to link to the
specific commit that was used when the website was published.
Feel free to cleanup anything in this PR.
2024-11-17 14:23:00 +08:00
Dunqing
7d75130865
fix(transformer/async-to-generator): arguments isn't correct after transformation ( #7234 )
...
Fix due to this plugin transforming the async method and async arrow function, it caused arguments no longer point the original function.
For example:
Before
```js
class Cls {
async method() {
() => {
console.log(arguments)
}
}
}
```
After:
```js
class Cls {
method() {
var _arguments = arguments;
return babelHelpers.asyncToGenerator(function* () {
() => {
console.log(_arguments);
};
})();
}
}
```
In this way, the `_arguments` is its original function's arguments
### For performance regression
It seems we need to check the IdentifierReference and BindingIdentifier if it's an `arguments`, that causes a significant regression, we may need a cheap way to do checking
2024-11-17 05:01:44 +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
7086cmd
cf99be0a0d
fix(minifier): do not compare bigint with object ( #7294 )
...
@Boshen, could you please update the snap of runtime and commit to this PR? I want to see the effects after the unit tests are added.
2024-11-16 06:01:06 +00:00
Boshen
8d8f34cfb5
chore(tasks/coverage): update runtime.snap
2024-11-15 12:48:56 +08:00
overlookmotel
f0dee76a4d
style(ast_tools): fix wonky formatting ( #7288 )
...
Follow-on after #7283 . Pure refactor. `rustfmt` was malfunctioning on this code for some reason. Alter the code slightly so it formats it nicely.
2024-11-14 22:58:16 +00:00
Boshen
b57d00d6fb
fix(tasks/compat_data): fix misplaced features ( #7284 )
...
closes #7279
2024-11-14 16:36:16 +00:00
dalaoshu
a48ebd6295
fix(tasks): cargo clippy error on rust 1.82.0 ( #7283 )
...
I mentioned this clippy issue in the discord help channel. The problem
seems to be related to using the stable rust toolchain, but when I
switched to version `1.81.0`, the issue was resolved.
However, some of the clippy suggestions might still be worth considering
and could be adopted.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-15 00:08:04 +08:00
DonIsaac
2268a0ef90
feat(linter): support overrides config field ( #6974 )
...
Part of #5653
2024-11-13 05:40:59 +00:00
camc314
3dcac1ae0b
feat(linter): react/exhaustive-deps ( #7151 )
...
Firstly, a massive thanks to @alisnic for starting this (incredibly complicated) lint rule in https://github.com/oxc-project/oxc/pull/2637 !
still a draft. current state:
3x false positives (all todo with refs)
3x false negatives (TS will catch these
13x false negatvies todo with refs
1x false negative TODO
closes #2637
relates to #2174
2024-11-12 11:42:47 +00:00
Boshen
f54d330eca
feat(tasks/lint_rules): mark eslint/no-undef-init as done ( #7244 )
...
closes #6456
2024-11-12 11:55:37 +08:00
Dunqing
eea4ab830a
fix(transformer/helper-loader): incorrect SymbolFlags for default import when SourceType is script ( #7226 )
2024-11-09 14:32:44 +00:00
Boshen
b4258ee58e
feat(transformer): add defaulted Module::Preserve option ( #7225 )
2024-11-09 12:55:13 +00:00
overlookmotel
d27e14f065
refactor(ast): AstKind::as_* methods take self ( #5546 )
...
Make `AstKind::as_*` methods (e.g. `AstKind::as_boolean_literal`) take `self`, not `&self`.
`AstKind` is `Copy`.
See: https://github.com/oxc-project/oxc/issues/5506#issuecomment-2332912976
2024-11-09 09:39:13 +00:00
Dunqing
5cfdc05d06
feat(transformer/typescript): support transform export = and import = require(...) when module is commonjs ( #7206 )
...
close : #7141
2024-11-09 09:32:28 +00:00
BitterGourd
94865a9390
feat(rulegen): support outdent and dedent tagged template expressions ( #6866 )
...
close #6645
---------
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2024-11-09 17:26:27 +08:00
Boshen
b11ed2cf7b
refactor(ast)!: remove useless ObjectProperty::init field ( #7220 )
...
closes https://github.com/oxc-project/backlog/issues/143
2024-11-09 09:00:29 +00:00
Boshen
0e4adc15dd
feat(ast)!: remove invalid expressions from TSEnumMemberName ( #7219 )
2024-11-09 08:48:14 +00:00
Dunqing
e536d47e56
feat(transformer/babel): add support for trying to get the Module from BabelPlugins ( #7218 )
...
When configuring a `transform-modules-commonjs` plugin in `options.json`, we should treat it as a `CommonJS` module
2024-11-09 08:38:15 +00:00
Boshen
324c3fe184
feat(transformer): add TransformOptions::module option ( #7188 )
2024-11-09 08:38:15 +00:00
Boshen
846711cf41
feat(transformer)!: change API to take a &TransformOptions instead of TransformOptions ( #7213 )
...
closes #7185
`TransformOption`s has an initialization cost, it should be initialized once and shared across files.
2024-11-09 06:01:13 +00:00
ottomated
092de67c47
fix(types)!: append rest field into elements for objects and arrays to align with estree ( #7212 )
...
Fixes https://github.com/oxc-project/oxc/pull/7149#discussion_r1831677446 and removes the need for some manual typescript.
2024-11-09 05:23:53 +00:00
Dunqing
ede10dc030
fix(transformer/async-to-generator): incorrect transform when super expression is inside async method ( #7171 )
...
After transformation, super expressions have moved to unexpected places. This PR replaces super expression to call expression, and then inserts the super methods to the top of the method body.
For example:
Before:
```js
class G {
async method() {
super.foo()
}
}
```
After:
```js
class G {
method() {
var _superprop_getFoo = () => super.foo,
_this = this;
return _asyncToGenerator(function* () {
_superprop_getFoo().call(_this);
})();
}
}```
2024-11-08 08:18:45 +00:00
Dunqing
1910227590
feat(transformer/async-to-generator): support inferring the function name from the ObjectPropertyValue's key ( #7201 )
...
Support for inferring function name from ObjectPropertyValue's key
For example:
```js
({ foo: async function() {} })
```
After this, we will able to infer `foo` for the object method
2024-11-08 08:18:44 +00:00
Boshen
3a20b906f4
feat(transformer): add es target to engineTargets ( #7193 )
2024-11-08 03:25:21 +00:00
Dunqing
293d072e77
fix(transformer/async-to-generator): only transform object method in exit_function ( #7199 )
...
part of #7175
2024-11-08 03:03:27 +00:00
Dunqing
b4cb587477
chore(transformer_conformance): only ignore root fixtures directory ( #7198 )
...
This blocks us from adding tests for plugins.
See the URL a2244ff089/tasks/transform_conformance/tests/babel-plugin-transform-async-to-generator/test/fixtures/arrow
2024-11-08 02:36:22 +00:00
Huáng Jùnliàng
9a6423a9f8
test(coverage): enable Babel es2022 tests ( #7194 )
...
Enabled the Babel es2022 tests. Previously they were skipped probably
because ES2022 was not yet supported at that time.
2024-11-08 09:29:36 +08:00
Boshen
6e1abde5ef
chore(transform_conformance): omit tests that we cannot pass right now ( #7192 )
2024-11-07 14:20:30 +00:00
Boshen
22898c855a
feat(transformer): warn BigInt when targeting < ES2020 ( #7184 )
...
closes #5822
2024-11-07 08:29:03 +00:00
Boshen
a579011e37
feat(transformer): add features ES2018NamedCapturingGroupsRegex and ES2018LookbehindRegex ( #7182 )
2024-11-07 07:39:33 +00:00
Boshen
ad3a2f518e
feat(tasks/compat_data): generate our own compat table ( #7176 )
2024-11-07 07:39:33 +00:00
Boshen
14ce0eef44
feat(tasks/compat_data): init compat data task ( #7156 )
2024-11-07 07:39:32 +00:00
ottomated
9d6cc9d3af
feat(estree): ESTree compatibility for all literals ( #7152 )
...
Adds some new estree macro directives:
- `#[estree(via = foo::Foo)`: Uses From to convert this struct to foo::Foo before serialization
- `#[estree(add_ts = "foo: string")]`: Adds additional fields to the typescript definitions
Used these to make all different literals estree-compatible.
2024-11-06 21:25:41 +00:00