Dunqing
4d6bd07afe
fix(transformer/async-generator-functions): correct all binding scope id ( #7425 )
...
Fixed a bunch of semantic errors by removing moving binding logic 😢 . This plugin constructs a complex `for-await` replacement so that I wrongly move to an incorrect scope.
2024-11-22 16:29:00 +00:00
Boshen
bb2c0c219b
refactor(transformer)!: return String as error instead of OxcDiagnostic ( #7424 )
2024-11-22 16:22:49 +00:00
Dunqing
27b2268a6c
refactor(semantic)!: remove SymbolFlags::Export ( #7414 )
...
close : #7338
close : #7344
The `SymbolFlags::Export` is Initially used to solve `ExportSpecifier` that is not `IdentifierReference` that causes we cannot determine whether a Binding is not used everywhere by `Semantic`.
Since #3820 this problem is solved, so we don't need `SymbolFlags::Export` no longer. Also, removing this can help us easier to pass the `Semantic` check in `Transformer`
2024-11-22 09:17:37 +00:00
Dunqing
7ff9f13973
fix(transformer): correct all ReferenceFlags ( #7410 )
2024-11-22 09:10:55 +00:00
Dunqing
6f0fe38bff
fix(semantic)!: correct all ReferenceFlags::Write according to the spec ( #7388 )
...
close #7323
According to the specification re-design the JavaScript-part ReferenceFlags inferring approach.
* https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation
* https://tc39.es/ecma262/#sec-postfix-increment-operator-runtime-semantics-evaluation
* https://tc39.es/ecma262/#sec-runtime-semantics-restdestructuringassignmentevaluation
* ... See references of https://tc39.es/ecma262/#sec-putvalue
### Changes
1. The left-hand of `AssignmentExpression` is always `ReferenceFlags::Write`
```js
let a = 0;
console.log(a = 0);
^ Write only
```
2. The `argument` of `UpdateExpression` is always `ReferenceFlags::Read | Write`
```js
let a = 0;
a++;
^ Read and Write
```
This change might cause some trouble for `Minfier` to remove this code, because ‘a’ is not used elsewhere. I have taken a look at `esbuild` and `Terser`. Only the `Terser` can remove this code.
2024-11-22 06:08:30 +00:00
overlookmotel
f4fda2dba6
test(transformer): add --debug option to transform conformance ( #7400 )
...
Add `--debug` command line option for transformer conformance runner, same as for `cargo coverage`. It prints the paths of test fixtures before running them.
2024-11-22 02:23:10 +00:00
Boshen
1550ffc5b5
fix(tasks/lint_rules): map prefix node to n ( #7397 )
...
The `eslint-plugin-n` page is not showing any rules implemented.
2024-11-21 13:58:53 +00:00
Boshen
224775c056
feat(transformer): transform object rest spread ( #7003 )
...
https://babel.dev/docs/babel-plugin-transform-object-rest-spread
2024-11-21 11:33:26 +00:00
DonIsaac
df143ca7bb
docs(linter): add docs for config settings ( #4827 )
2024-11-21 08:08:30 +00:00
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
ottomated
dc0215c906
feat(ast_tools): Add #[estree(append_to)], remove some custom serialization code ( #7149 )
...
Removed custom logic for ObjectPattern, ArrayPattern, etc. in favor of a custom attribute macro `#[estree(append_to = "foo")]` as part of #6347
2024-11-06 21:09:45 +00:00
renovate
3da9443b0e
chore(deps): update dependency @types/node to v22.9.0 ( #7145 )
...
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@types/node](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node ) ([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node )) | [`22.8.4` -> `22.9.0`](https://renovatebot.com/diffs/npm/@types%2fnode/22.8.4/22.9.0 ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) |
---
### Configuration
📅 **Schedule**: Branch creation - "before 10am on monday" in timezone Asia/Shanghai, Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2024-11-06 06:17:36 +00:00
Dunqing
b2a888df0d
fix(transformer/async-generator-functions): incorrect transformation for for await if it's not placed in a block ( #7148 )
...
Found in https://github.com/oxc-project/monitor-oxc/actions/runs/11681867380/job/32527898715
2024-11-06 05:51:01 +00:00
Dunqing
19892ede40
fix(transformer/async-generator-functions): transform incorrectly for for await if it's in LabeledStatement ( #7147 )
...
Found in https://github.com/oxc-project/monitor-oxc/actions/runs/11681867380/job/32527898715
2024-11-06 03:27:14 +00:00
Dunqing
8573f79c6d
feat(transformer): turn on async_to_generator and async_generator_functions plugins in enable_all ( #7135 )
2024-11-06 03:27:13 +00:00
Dunqing
cd1006fec1
refactor(transformer/async-generator-functions): do not transform yield expression where inside generator function ( #7134 )
2024-11-06 03:27:13 +00:00
Dunqing
2c5734d49b
refactor(transformer/async-generator-functions): do not transform await expression where inside ArrowFunctionExpression ( #7132 )
...
The `await expr` should be transformed in AsyncToGenerator rather than AsyncGeneratorFunctions
2024-11-06 03:27:12 +00:00
Dunqing
b6a575009a
feat(transformer/arrow-function-converter): move scope to changed scope for this_var if scope have changed ( #7125 )
...
The scope can be moved or deleted, we need to check whether the scope id is the same as the container's scope id, if not, we need to move the `this_var` to the target scope id.
2024-11-06 03:02:36 +00:00
Dunqing
df772411ea
feat(transformer): enable ArrowFunctionConverter in async-to-generator and async-generator-functions plugins ( #7113 )
...
Part of https://github.com/oxc-project/oxc/pull/7074
In async-to-generator and async-generator-functions plugins, we may need to transform the async arrow function to a regular generator function, now we can reuse the ability of the ArrowFunction plugin by enabling `ArrowFunctionConverter`.
I will fix semantic errors in the follow-up PR
2024-11-06 03:02:36 +00:00
Boshen
9386435efb
feat(transform_conformance): use node instead of bun for exec tests ( #7121 )
2024-11-05 14:20:48 +08:00
overlookmotel
cc8a1917e5
feat(ast): methods on AST nodes to get scope_id etc ( #7127 )
...
Add getter and setter methods to all AST types which have a `ScopeId`, `SymbolId` or `ReferenceId` field to get the contents of that field.
Before:
```rs
let symbol_id = ident.symbol_id.get().unwrap();
```
After:
```rs
let symbol_id = ident.symbol_id();
```
This allows removing boilerplate code from the transformer, and discouraging the anti-pattern of treating these fields as if they may contain either `Some` or `None` (after semantic, they will always be `Some`).
2024-11-05 02:25:27 +00:00
Boshen
c2802e63fc
feat(transform_conformance): add babel runtime to exec tests ( #7114 )
2024-11-04 14:38:15 +00:00
Dunqing
f80085c683
refactor(transformer/async-to-generator): move handling of MethodDefinition's value to exit_function ( #7105 )
...
Part of #7074
We need to handle this before the `arrow_function` plugin inserts `_this = this` because, in the `async-to-generator` plugin, we will move the body to an inner generator function. However, we don't want `_this = this` moved to the inner generator function as well. So as long as we move first, and then insert, we can fix this problem.
The new semantic error is related to another tricky problem, I will fix it in another PR
2024-11-04 14:32:42 +00:00
Boshen
50646a49ea
refactor(tasks/website): remove scraper dependency ( #7116 )
2024-11-04 14:16:11 +00:00
overlookmotel
25d7554ec4
refactor(ast_tools): rename visitable to is_visitable ( #7104 )
...
Pure refactor. Just rename fields and vars from `visitable` to `is_visitable`, to be more descriptive.
2024-11-03 17:20:25 +00:00
Dunqing
70e2582726
ci(transformer): enable unfinished plugins in benchmark ( #7040 )
...
Even the plugins are unfinished, we still want to enable all of them to track the performance changes during the development.
2024-11-02 15:17:21 +00:00
overlookmotel
f543a8d495
refactor(ast)!: remove AstBuilder::*_from_* methods ( #7073 )
...
Remove `AstBuilder::*_from_*` methods for constructing enums. In my opinion, it's not a great pattern, and this removes 2000 of lines of code from [ast_builder.rs](https://github.com/oxc-project/oxc/pull/7073/files#diff-e34fd45077ed0a48b7fee440fdbe4c22a01d787a70a311afebfc1d310785fb70 ).
2024-11-02 01:22:56 +00:00
overlookmotel
32b4a53692
refactor(ast_tools): remove LateCtx abstraction ( #7083 )
...
`LateCtx` is just a wrapper around `Schema`. Remove it and use `Schema` instead.
2024-11-01 22:31:03 +00:00
overlookmotel
2eb9aa9b89
refactor(ast_tools): remove dead code ( #7080 )
2024-11-01 21:59:28 +00:00
overlookmotel
d89fe2c326
refactor(ast_tools): shorten code ( #7079 )
...
Shorten code by importing `rust_ast::Module` at top level.
2024-11-01 21:51:29 +00:00
overlookmotel
00cc156fb5
refactor(ast_tools): simplify module loading ( #7078 )
...
Rename var for clarity and remove unnecessary `From` impl.
2024-11-01 21:51:29 +00:00
overlookmotel
f2d10683a8
refactor(ast_tools): remove dead code ( #7077 )
2024-11-01 21:42:14 +00:00
overlookmotel
248ff18ddd
refactor(ast_tools): output progress ( #7076 )
...
Flush `stdout` after writing progress.
2024-11-01 21:26:45 +00:00
Dunqing
a2244ff089
fix(transformer/async-to-generator): output is incorrect when arrow function without params ( #7052 )
2024-11-01 15:35:57 +00:00
Boshen
f83a760d8a
refactor(transformer): deserialize BabelOptions::presets ( #7047 )
2024-11-01 06:56:27 +00:00
Boshen
52c20d633c
refactor(transformer): deserialize BabelOptions::plugins ( #7045 )
2024-11-01 05:44:57 +00:00
Boshen
4bef99c80b
chore(coverage): update runtime snapshot
2024-11-01 13:05:42 +08:00
tomoya yanagibashi
0601271b2c
fix(ast): Fix StaticMemberExpression.get_first_object ( #6969 )
...
I think `get_first_object` does not return expected expression.
For example, in case of `foo.bar.a`, it doesn't return `foo` but
`foo.bar`.
**Expected**
```
{
"type": "Identifier",
"start": 0,
"end": 3,
"name": "foo"
}
```
**Actual**
```
{
"type":"StaticMemberExpression",
"start":0,
"end":7,
"object":{
"type":"Identifier",
"start":0,
"end":3,
"name":"foo"
},
"property":{
"type":"Identifier",
"start":4,
"end":7,
"name":"bar"
},
"optional":false
}
```
---------
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2024-11-01 12:28:48 +08:00
Boshen
fcaba4a92a
feat(transformer): add TransformerOptions::env with EnvOptions ( #7037 )
2024-10-31 12:30:32 +00:00
Dunqing
934cb5e746
feat(transformer): add async_generator_functions plugin ( #6573 )
...
Passed 15/19 tests. The remaining 4 failed tests related to `this` expression, the problem same as I mentioned in #6658 . I will fix them in follow-up PRs.
2024-10-31 09:14:17 +00:00
overlookmotel
2a57a66753
test(transformer): support exec tests in Oxc folder ( #7030 )
...
Fix error when `tasks/transform_conformance/tests` contains exec tests.
2024-10-31 01:18:09 +00:00
Boshen
76947e2aec
refactor(transform): refactor Babel Targets ( #7026 )
...
Found a trick from serde to get us from `BabelTargets` to `Targets`.
2024-10-30 14:08:19 +00:00
Boshen
b8daab3663
refactor(transformer)!: API to TryFrom<&EnvOptions> for TransformOptions and TryFrom<&BabelOptions> TransformOptions ( #7020 )
...
…ions` and `TryFrom<&BabelOptions> TransformOptions`
2024-10-30 09:40:09 +00:00
Boshen
caaf00e081
fix(parser): fix incorrect parsed TSIndexSignature ( #7016 )
...
closes #6985
2024-10-30 07:34:22 +00:00
Boshen
9fd9f4f5b9
feat(linter)!: sync sindresorhus/globals; removed Object.prototype properties from builtin and es* globals ( #6991 )
2024-10-29 04:13:20 +00:00
Boshen
b518670582
chore(coverage): remove known runtime issues
2024-10-28 21:38:37 +08:00
Boshen
14f36ce3f9
chore(task/lint_rules): change not supported to "no need to implement"
...
closes #6822
2024-10-28 17:29:29 +08:00
renovate
56f5506ca9
chore(deps): update rust crates ( #6961 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [encoding_rs](https://docs.rs/encoding_rs/ ) ([source](https://redirect.github.com/hsivonen/encoding_rs )) | workspace.dependencies | patch | `0.8.34` -> `0.8.35` |
| [handlebars](https://redirect.github.com/sunng87/handlebars-rust ) | workspace.dependencies | minor | `6.1.0` -> `6.2.0` |
| [insta](https://insta.rs/ ) ([source](https://redirect.github.com/mitsuhiko/insta )) | workspace.dependencies | minor | `1.40.0` -> `1.41.0` |
| [prettyplease](https://redirect.github.com/dtolnay/prettyplease ) | workspace.dependencies | patch | `0.2.24` -> `0.2.25` |
| [regex](https://redirect.github.com/rust-lang/regex ) | workspace.dependencies | patch | `1.11.0` -> `1.11.1` |
| [saphyr](https://redirect.github.com/saphyr-rs/saphyr ) | workspace.dependencies | patch | `0.0.1` -> `0.0.3` |
| [serde](https://serde.rs ) ([source](https://redirect.github.com/serde-rs/serde )) | workspace.dependencies | patch | `1.0.210` -> `1.0.213` |
| [tokio](https://tokio.rs ) ([source](https://redirect.github.com/tokio-rs/tokio )) | workspace.dependencies | minor | `1.40.0` -> `1.41.0` |
---
### Release Notes
<details>
<summary>hsivonen/encoding_rs (encoding_rs)</summary>
### [`v0.8.35`](https://redirect.github.com/hsivonen/encoding_rs/compare/v0.8.34...v0.8.35 )
[Compare Source](https://redirect.github.com/hsivonen/encoding_rs/compare/v0.8.34...v0.8.35 )
</details>
<details>
<summary>sunng87/handlebars-rust (handlebars)</summary>
### [`v6.2.0`](https://redirect.github.com/sunng87/handlebars-rust/blob/HEAD/CHANGELOG.md#620---2024-10-26 )
[Compare Source](https://redirect.github.com/sunng87/handlebars-rust/compare/v6.1.0...v6.2.0 )
- \[Added] `@index` variable for object iteration \[[#​682](https://redirect.github.com/sunng87/handlebars-rust/issues/682 )]
- \[Changed] improve number comparison between different types \[[#​679](https://redirect.github.com/sunng87/handlebars-rust/issues/679 )]
</details>
<details>
<summary>mitsuhiko/insta (insta)</summary>
### [`v1.41.0`](https://redirect.github.com/mitsuhiko/insta/blob/HEAD/CHANGELOG.md#1410 )
[Compare Source](https://redirect.github.com/mitsuhiko/insta/compare/1.40.0...1.41.0 )
- Experimental support for binary snapshots. [#​610](https://redirect.github.com/mitsuhiko/insta/issues/610 ) (Florian Plattner)
- `--force-update-snapshots` now causes `cargo-insta` to write every snapshot, regardless of whether
snapshots fully match, and now implies `--accept`. This
allows for `--force-update-snapshots` to update inline snapshots'
delimiters and indentation.
For the previous behavior of `--force-update-snapshots`, which limited writes to
snapshots which didn't fully match, use `--require-full-match`.
The main difference between `--require-full-match` and the existing behavior of `--force-update-snapshots`
is a non-zero exit code on any snapshots which don't fully match.
Like the previous behavior or `--force-update-snapshots`, `--require-full-match`
doesn't track inline snapshots' delimiters or
indentation, so can't update if those don't match. [#​644](https://redirect.github.com/mitsuhiko/insta/issues/644 )
- Inline snapshots only use `#` characters as delimiters when required. [#​603](https://redirect.github.com/mitsuhiko/insta/issues/603 )
- Warnings for undiscovered snapshots are more robust, and include files with
custom snapshot extensions. [#​637](https://redirect.github.com/mitsuhiko/insta/issues/637 )
- Insta runs correctly on packages which reference rust files in a parent path. [#​626](https://redirect.github.com/mitsuhiko/insta/issues/626 )
- Warnings are printed when any snapshot uses a legacy format. [#​599](https://redirect.github.com/mitsuhiko/insta/issues/599 )
- `cargo insta --version` now prints a version. [#​665](https://redirect.github.com/mitsuhiko/insta/issues/665 )
- `insta` now internally uses `INSTA_UPDATE=force` rather than
`INSTA_FORCE_UPDATE=1`. (This doesn't affect users of `cargo-insta`, which
handles this internally.) [#​482](https://redirect.github.com/mitsuhiko/insta/issues/482 )
- `cargo-insta`'s integration tests continue to grow over the past couple of versions,
and now offer coverage of most of `cargo-insta`'s interface.
</details>
<details>
<summary>dtolnay/prettyplease (prettyplease)</summary>
### [`v0.2.25`](https://redirect.github.com/dtolnay/prettyplease/releases/tag/0.2.25 )
[Compare Source](https://redirect.github.com/dtolnay/prettyplease/compare/0.2.24...0.2.25 )
- Print safe and explicitly unsafe foreign items ([#​85](https://redirect.github.com/dtolnay/prettyplease/issues/85 ), [https://github.com/rust-lang/rust/issues/123743 ](https://redirect.github.com/rust-lang/rust/issues/123743 ))
</details>
<details>
<summary>rust-lang/regex (regex)</summary>
### [`v1.11.1`](https://redirect.github.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#1111-2024-10-24 )
[Compare Source](https://redirect.github.com/rust-lang/regex/compare/1.11.0...1.11.1 )
\===================
This is a new patch release of `regex` that fixes compilation on nightly
Rust when the unstable `pattern` crate feature is enabled. Users on nightly
Rust without this feature enabled are unaffected.
Bug fixes:
- [BUG #​1231](https://redirect.github.com/rust-lang/regex/issues/1231 ):
Fix the `Pattern` trait implementation as a result of nightly API breakage.
</details>
<details>
<summary>saphyr-rs/saphyr (saphyr)</summary>
### [`v0.0.3`](https://redirect.github.com/saphyr-rs/saphyr/compare/v0.0.1...v0.0.3 )
[Compare Source](https://redirect.github.com/saphyr-rs/saphyr/compare/v0.0.1...v0.0.3 )
</details>
<details>
<summary>serde-rs/serde (serde)</summary>
### [`v1.0.213`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.213 )
[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.212...v1.0.213 )
- Fix support for macro-generated `with` attributes inside a newtype struct ([#​2847](https://redirect.github.com/serde-rs/serde/issues/2847 ))
### [`v1.0.212`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.212 )
[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.211...v1.0.212 )
- Fix hygiene of macro-generated local variable accesses in serde(with) wrappers ([#​2845](https://redirect.github.com/serde-rs/serde/issues/2845 ))
### [`v1.0.211`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.211 )
[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.210...v1.0.211 )
- Improve error reporting about mismatched signature in `with` and `default` attributes ([#​2558](https://redirect.github.com/serde-rs/serde/issues/2558 ), thanks [@​Mingun](https://redirect.github.com/Mingun ))
- Show variant aliases in error message when variant deserialization fails ([#​2566](https://redirect.github.com/serde-rs/serde/issues/2566 ), thanks [@​Mingun](https://redirect.github.com/Mingun ))
- Improve binary size of untagged enum and internally tagged enum deserialization by about 12% ([#​2821](https://redirect.github.com/serde-rs/serde/issues/2821 ))
</details>
<details>
<summary>tokio-rs/tokio (tokio)</summary>
### [`v1.41.0`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.41.0 ): Tokio v1.41.0
[Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.40.0...tokio-1.41.0 )
##### 1.41.0 (Oct 22th, 2024)
##### Added
- metrics: stabilize `global_queue_depth` ([#​6854], [#​6918])
- net: add conversions for unix `SocketAddr` ([#​6868])
- sync: add `watch::Sender::sender_count` ([#​6836])
- sync: add `mpsc::Receiver::blocking_recv_many` ([#​6867])
- task: stabilize `Id` apis ([#​6793], [#​6891])
##### Added (unstable)
- metrics: add H2 Histogram option to improve histogram granularity ([#​6897])
- metrics: rename some histogram apis ([#​6924])
- runtime: add `LocalRuntime` ([#​6808])
##### Changed
- runtime: box futures larger than 16k on release mode ([#​6826])
- sync: add `#[must_use]` to `Notified` ([#​6828])
- sync: make `watch` cooperative ([#​6846])
- sync: make `broadcast::Receiver` cooperative ([#​6870])
- task: add task size to tracing instrumentation ([#​6881])
- wasm: enable `cfg_fs` for `wasi` target ([#​6822])
##### Fixed
- net: fix regression of abstract socket path in unix socket ([#​6838])
##### Documented
- io: recommend `OwnedFd` with `AsyncFd` ([#​6821])
- io: document cancel safety of `AsyncFd` methods ([#​6890])
- macros: render more comprehensible documentation for `join` and `try_join` ([#​6814], [#​6841])
- net: fix swapped examples for `TcpSocket::set_nodelay` and `TcpSocket::nodelay` ([#​6840])
- sync: document runtime compatibility ([#​6833])
[#​6793]: https://redirect.github.com/tokio-rs/tokio/pull/6793
[#​6808]: https://redirect.github.com/tokio-rs/tokio/pull/6808
[#​6810]: https://redirect.github.com/tokio-rs/tokio/pull/6810
[#​6814]: https://redirect.github.com/tokio-rs/tokio/pull/6814
[#​6821]: https://redirect.github.com/tokio-rs/tokio/pull/6821
[#​6822]: https://redirect.github.com/tokio-rs/tokio/pull/6822
[#​6826]: https://redirect.github.com/tokio-rs/tokio/pull/6826
[#​6828]: https://redirect.github.com/tokio-rs/tokio/pull/6828
[#​6833]: https://redirect.github.com/tokio-rs/tokio/pull/6833
[#​6836]: https://redirect.github.com/tokio-rs/tokio/pull/6836
[#​6838]: https://redirect.github.com/tokio-rs/tokio/pull/6838
[#​6840]: https://redirect.github.com/tokio-rs/tokio/pull/6840
[#​6841]: https://redirect.github.com/tokio-rs/tokio/pull/6841
[#​6846]: https://redirect.github.com/tokio-rs/tokio/pull/6846
[#​6854]: https://redirect.github.com/tokio-rs/tokio/pull/6854
[#​6867]: https://redirect.github.com/tokio-rs/tokio/pull/6867
[#​6868]: https://redirect.github.com/tokio-rs/tokio/pull/6868
[#​6870]: https://redirect.github.com/tokio-rs/tokio/pull/6870
[#​6881]: https://redirect.github.com/tokio-rs/tokio/pull/6881
[#​6890]: https://redirect.github.com/tokio-rs/tokio/pull/6890
[#​6891]: https://redirect.github.com/tokio-rs/tokio/pull/6891
[#​6897]: https://redirect.github.com/tokio-rs/tokio/pull/6897
[#​6918]: https://redirect.github.com/tokio-rs/tokio/pull/6918
[#​6924]: https://redirect.github.com/tokio-rs/tokio/pull/6924
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 10am on monday" in timezone Asia/Shanghai, Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions ) if that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2024-10-28 06:22:28 +00:00
ottomated
9725e3c2ec
feat(ast_tools): Add #[estree(always_flatten)] to Span ( #6935 )
...
Part of #6347
Other changes:
- added #[estree(skip)] to thisSpan in TSThisParameter
- Flattened the span in BoundaryAssertion (regex)
2024-10-28 02:13:24 +00:00
ottomated
fbc297ec7b
feat(ast_tools): Move tsify custom types to estree attribute macro ( #6934 )
...
Part of #6347
2024-10-28 01:45:27 +00:00
ottomated
169fa22350
feat(ast_tools): Default enums to rename_all = "camelCase" ( #6933 )
...
Part of #6347
2024-10-28 01:39:25 +00:00