renovate[bot]
e00e3abd84
chore(deps): update rust crates (major) ( #8739 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [oxc_resolver](https://redirect.github.com/oxc-project/oxc-resolver ) |
workspace.dependencies | major | `3` -> `4` |
| [ureq](https://redirect.github.com/algesten/ureq ) |
workspace.dependencies | major | `2.12.1` -> `3.0.0` |
---
### Release Notes
<details>
<summary>oxc-project/oxc-resolver (oxc_resolver)</summary>
###
[`v4.0.0`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#400---2025-01-20 )
[Compare
Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v3.0.3...oxc_resolver-v4.0.0 )
##### <!-- 0 -->Features
- \[**breaking**] generic fs cache `type Resolver =
ResolverGeneric<FsCache<FileSystemOs>>`
([#​358](https://redirect.github.com/oxc-project/oxc-resolver/issues/358 ))
- \[**breaking**] `PackageJson` and `TsConfig` traits
([#​360](https://redirect.github.com/oxc-project/oxc-resolver/issues/360 ))
##### <!-- 2 -->Performance
- use papaya instead of dashmap
([#​356](https://redirect.github.com/oxc-project/oxc-resolver/issues/356 ))
</details>
<details>
<summary>algesten/ureq (ureq)</summary>
###
[`v3.0.0`](https://redirect.github.com/algesten/ureq/blob/HEAD/CHANGELOG.md#300 )
[Compare
Source](https://redirect.github.com/algesten/ureq/compare/2.12.1...3.0.0 )
- Replace RequestBuilder Deref with explicit wrappers
([#​944](https://redirect.github.com/algesten/ureq/issues/944 ))
- Remove dependency on `url` crate
([#​943](https://redirect.github.com/algesten/ureq/issues/943 ))
- Feature `Config::save_redirect_history`
([#​939](https://redirect.github.com/algesten/ureq/issues/939 ))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "on monday" in timezone Asia/Shanghai,
Automerge - "on monday" in timezone Asia/Shanghai.
🚦 **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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Boshen <boshenc@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-27 12:56:52 +08:00
oxc-bot
2fb08b9e9c
release(crates): v0.48.1 ( #8738 )
...
## [0.48.1] - 2025-01-26
### Features
- b7f13e6 ast: Implement utf8 to utf16 span converter (#8687 ) (Boshen)
- 6589c3b mangler: Reuse variable names (#8562 ) (翠 / green)
- 29bd215 minifier: Minimize `Infinity.toString(radix)` to `'Infinity'`
(#8732 ) (Boshen)
- e0117db minifier: Replace `const` with `let` for non-exported
read-only variables (#8733 ) (sapphi-red)
- 9e32f55 minifier: Evaluate `Math.sqrt` and `Math.cbrt` (#8731 )
(sapphi-red)
- 360d49e minifier: Replace `Math.pow` with `**` (#8730 ) (sapphi-red)
- 2e9a560 minifier: `NaN.toString(radix)` is always `NaN` (#8727 )
(Boshen)
- cbe0e82 minifier: Minimize `foo(...[])` -> `foo()` (#8726 ) (Boshen)
- e9fb5fe minifier: Dce pure expressions such as `new Map()` (#8725 )
(Boshen)
### Bug Fixes
- 0944758 codegen: Remove parens from `new (import(''), function() {})`
(#8707 ) (Boshen)
- 33de70a mangler: Handle cases where a var is declared in a block scope
(#8706 ) (翠 / green)
- d982cdb minifier: `Unknown.fromCharCode` should not be treated as
`String.fromCharCode` (#8709 ) (sapphi-red)
- e7ab96c transformer/jsx: Incorrect `isStaticChildren` argument for
`Fragment` with multiple children (#8713 ) (Dunqing)
- 3e509e1 transformer/typescript: Enum merging when same name declared
in outer scope (#8691 ) (branchseer)
### Performance
- dc0b0f2 manger: Remove useless `tmp_bindings` (#8735 ) (Dunqing)
- e472ced mangler: Optimize handling of collecting lived scope ids
(#8724 ) (Dunqing)
- 8587965 minifier: Normalize `undefined` to `void 0` before everything
else (#8699 ) (Boshen)
### Refactor
- 58002e2 ecmascript: Remove the lifetime annotation on
`MayHaveSideEffects` (#8717 ) (Boshen)
- 10e5920 linter: Move finishing default diagnostic message to
`GraphicalReporter` (#8683 ) (Sysix)
- 52a37d0 mangler: Simplify initialization of `slots` (#8734 ) (Dunqing)
- 6bc906c minifier: Allow mutating arguments in methods called from
`try_fold_known_string_methods` (#8729 ) (sapphi-red)
- bf8be23 minifier: Use `Ctx` (#8716 ) (Boshen)
- 0af0267 minifier: Side effect detection needs symbols resolution
(#8715 ) (Boshen)
- 32e0e47 minifier: Clean up `Normalize` (#8700 ) (Boshen)
- c792068 semantic: Simplify `ScopeTree::iter_bindings` (#8723 )
(Dunqing)
### Testing
- 03229c5 minifier: Fix broken tests (#8722 ) (Boshen)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-26 22:20:13 +08:00
Alexander S.
bf895eb90d
test(linter): add diagnostic format test snapshots ( #8696 )
...
windows will fail, looks like the offset missmatch is because of `\r\n`
vs `\n`.
```
Snapshot file: apps\oxlint\src\snapshots\--format=json test.js@oxlint.snap
Snapshot: --format=json test.js@oxlint
Source: C:\dev\oxc:74
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 0 0 │ ##########
1 1 │ --format=json test.js
2 2 │ ----------
3 3 │ [
4 │- {"message": "`debugger` statement is not allowed","code": "eslint(no-debugger)","severity": "error","causes": [],"url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html ","help": "Delete this code.","filename": "test.js","labels": [{"span": {"offset": 38,"length": 9}}],"related": []},
4 │+ {"message": "`debugger` statement is not allowed","code": "eslint(no-debugger)","severity": "error","causes": [],"url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html ","help": "Delete this code.","filename": "test.js","labels": [{"span": {"offset": 42,"length": 9}}],"related": []},
5 5 │ {"message": "Function 'foo' is declared but never used.","code": "eslint(no-unused-vars)","severity": "warning","causes": [],"url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html ","help": "Consider removing this declaration.","filename": "test.js","labels": [{"label": "'foo' is declared here","span": {"offset": 9,"length": 3}}],"related": []},
6 6 │ {"message": "Parameter 'b' is declared but never used. Unused parameters should start with a '_'.","code": "eslint(no-unused-vars)","severity": "warning","causes": [],"url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html ","help": "Consider removing this parameter.","filename": "test.js","labels": [{"label": "'b' is declared here","span": {"offset": 16,"length": 1}}],"related": []}
7 7 │ ]
────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
thread 'output_formatter::test::test_output_formatter_diagnostic_json' panicked at C:\Users\sysix\.cargo\registry\src\index.crates.io-6f17d22bba15001f\insta-1.42.0\src\runtime.rs:679:13:
snapshot assertion for '--format=json test.js@oxlint' failed in line 74
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- output_formatter::test::test_output_formatter_diagnostic_stylish stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Snapshot file: apps\oxlint\src\snapshots\--format=stylish test.js@oxlint.snap
Snapshot: --format=stylish test.js@oxlint
Source: C:\dev\oxc:74
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 3 3 │
4 4 │ ␛[4mtest.js␛[0m␊
5 5 │ ␛[2m9:3 ␛[0m ␛[33mwarning␛[0m Function 'foo' is declared but never used. ␛[2meslint(no-unused-vars)␛[0m␊
6 6 │ ␛[2m16:1␛[0m ␛[33mwarning␛[0m Parameter 'b' is declared but never used. Unused parameters should start with a '_'. ␛[2meslint(no-unused-vars)␛[0m␊
7 │- ␛[2m38:9␛[0m ␛[31merror␛[0m `debugger` statement is not allowed ␛[2meslint(no-debugger)␛[0m␊
7 │+ ␛[2m42:9␛[0m ␛[31merror␛[0m `debugger` statement is not allowed ␛[2meslint(no-debugger)␛[0m␊
8 8 │
9 9 │ ␛[31m✖ 3 problems (1 error, 2 warnings)␛[0m
────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
thread 'output_formatter::test::test_output_formatter_diagnostic_stylish' panicked at C:\Users\sysix\.cargo\registry\src\index.crates.io-6f17d22bba15001f\insta-1.42.0\src\runtime.rs:679:13:
snapshot assertion for '--format=stylish test.js@oxlint' failed in line 74
failures:
output_formatter::test::test_output_formatter_diagnostic_json
output_formatter::test::test_output_formatter_diagnostic_stylish
test result: FAILED. 85 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
```
2025-01-25 18:51:00 +08:00
翠 / green
6589c3bbb3
feat(mangler): reuse variable names ( #8562 )
...
Changed the mangler to reuse variable names where possible.
This will reduce the code size as shorter variable names can be used in
more places. But requires global information and limits parallelism in a
single file and requires more memory.
---------
Co-authored-by: Boshen <boshenc@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-25 14:00:24 +08:00
Sysix
34d3d72b64
test(linter): add snapshot tester for cli ( #8695 )
...
Our first Snapshot 🥳
2025-01-24 17:19:31 +00:00
oxc-bot
b97767874f
release(oxlint): v0.15.8 ( #8689 )
...
## [0.15.8] - 2025-01-24
### Features
- 79ba9b5 linter: Added support to run in Node.JS legacy versions
(#8648 ) (Luiz Felipe Weber)
- dcaebe6 linter: Add "strict" option to `promise/prefer-await-to-then`
rule (#8674 ) (Neil Fisher)
- 4ae568e linter: Add DiagnosticResult to the Reporters for receiving a
sub part result (#8666 ) (Alexander S.)
- 8a0eb2a oxlint: Add stylish formatter (#8607 ) (Andrew Powell)
### Bug Fixes
- 40316af linter: Fix github `endColumn` output (#8647 ) (Alexander S.)
- dc912fa linter: Added missing $schema property to default config
(#8625 ) (Tapan Prakash)
### Refactor
- a3dc4c3 crates: Clean up snapshot files (#8680 ) (Boshen)
- e66da9f isolated_declarations, linter, minifier, prettier, semantic,
transformer: Remove unnecessary `ref` / `ref mut` syntax (#8643 )
(overlookmotel)
- 23b49a6 linter: Use `cow_to_ascii_lowercase` instead
`cow_to_lowercase` (#8678 ) (Boshen)
- b8d9a51 span: Deal only in owned `Atom`s (#8641 ) (overlookmotel)
- ac4f98e span: Derive `Copy` on `Atom` (#8596 ) (branchseer)
- 259a47b vscode: Move commands and `findBinary` to separate files
(#8605 ) (Alexander S.)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-24 18:07:14 +08:00
oxc-bot
8a72b8ecc7
release(crates): v0.48.0 ( #8686 )
...
## [0.48.0] - 2025-01-24
- 54d0fac span: [**BREAKING**] Remove `PartialEq` impl for `&Atom`
(#8642 ) (overlookmotel)
### Features
- 2a2ad53 allocator: Add `Allocator::capacity` and `used_bytes` methods
(#8621 ) (overlookmotel)
- 6801c81 allocator: Add `Allocator::new` and `with_capacity` methods
(#8620 ) (overlookmotel)
- 99607d3 codegen: Print comments in `TSTypeLiteral` (#8679 ) (Boshen)
- 4ae568e linter: Add DiagnosticResult to the Reporters for receiving a
sub part result (#8666 ) (Alexander S.)
- 343690e minifier: Replace `Number.*_SAFE_INTEGER`/`Number.EPSILON`
(#8682 ) (sapphi-red)
- 0c5bb30 minifier: Replace
`Number.POSITIVE_INFINITY`/`Number.NEGATIVE_INFINITY`/`Number.NaN`
(#8681 ) (sapphi-red)
- 835b258 minifier: Compress `typeof foo === 'object' && foo !== null`
to `typeof foo == 'object' && !!foo` (#8638 ) (sapphi-red)
- 2bcbed2 minifier: Compress `(a = b) === null || a === undefined` to
`(a = b) == null` (#8637 ) (sapphi-red)
### Bug Fixes
- 40316af linter: Fix github `endColumn` output (#8647 ) (Alexander S.)
- 883d25b minifier: Keep esm in dce (#8677 ) (Boshen)
- 878ce10 minifier: `void 0` equals to `undefined` (#8673 ) (Boshen)
- ba201a6 minifier: Remove "non esbuild optimizations" which is
incorrect (#8668 ) (Boshen)
- 8c8b5fa minifier: Avoid minifing `String(a)` into `"" + a` for symbols
(#8612 ) (翠 / green)
- 4ff6e85 minifier: Remove expression statement `void 0` (#8602 )
(Boshen)
- 93d643e minifier: Keep side effects when folding const conditional
exprs (#8591 ) (camc314)
- 178c232 parser: Parse `intrinsic` TS keyword (#8627 ) (Kevin Deng 三咲智子)
- 48717ab parser: Parse `true` as `TSLiteralType` (#8626 ) (Kevin Deng
三咲智子)
- d1c5dc4 semantic: Fix const assertions in `UnresolvedReferencesStack`
(#8653 ) (overlookmotel)
### Performance
- 787aaad allocator: Make `String` non-drop (#8617 ) (overlookmotel)
- d966e0a codegen: Do not check for comments if turned off (#8598 )
(Boshen)
- 3fa87ff lexer: Peak 2 bytes after `!` (#8662 ) (Boshen)
- 9953ac7 minifier: Add `LatePeepholeOptimizations` (#8651 ) (Boshen)
- 00dc63f minifier: Only substitute typed array constructor once (#8649 )
(Boshen)
- 3e19e4e minifier: Remove the useless empty statement removal code in
statement fusion (#8646 ) (Boshen)
- 5b3c412 minifier: Only run optimizations on local changes (#8644 )
(Boshen)
### Documentation
- c1d243b allocator: Improve docs for `Allocator` (#8623 )
(overlookmotel)
- 01a5e5d allocator: Improve docs for `HashMap` (#8616 ) (overlookmotel)
- 87568a1 allocator: Reformat docs (#8615 ) (overlookmotel)
- 3be0392 lexer: Fix doc comment (#8664 ) (overlookmotel)
- 5029547 semantic: Fix and reformat doc comments (#8652 )
(overlookmotel)
### Refactor
- ae8db53 allocator: Move `Allocator` into own module (#8656 )
(overlookmotel)
- 0f85bc6 allocator: Reduce repeat code to prevent `Drop` types in arena
(#8655 ) (overlookmotel)
- de76eb1 allocator: Reorder `Box` methods (#8654 ) (overlookmotel)
- 997859c ast: Align `#[estree(via)]` behavior (#8599 ) (sapphi-red)
- db863a3 codegen: Use `Stack` for `binary_expr_stack` (#8663 ) (Boshen)
- 8cce69a codegen: Remove `match_member_expression` (#8597 ) (Boshen)
- a3dc4c3 crates: Clean up snapshot files (#8680 ) (Boshen)
- e66da9f isolated_declarations, linter, minifier, prettier, semantic,
transformer: Remove unnecessary `ref` / `ref mut` syntax (#8643 )
(overlookmotel)
- 23b49a6 linter: Use `cow_to_ascii_lowercase` instead
`cow_to_lowercase` (#8678 ) (Boshen)
- ce2b9da minifier: Remove `wrap_to_avoid_ambiguous_else` (#8676 )
(Boshen)
- 75a579b minifier: Clean up
`has_no_side_effect_for_evaluation_same_target` (#8675 ) (Boshen)
- 1bb2539 minifier: Move more code into `minimize_conditions` local loop
(#8671 ) (Boshen)
- 13e4a45 minifier: Move conditional assignment to `minimize_conditions`
(#8669 ) (Boshen)
- ae895d8 minifier: Use `NonEmptyStack` for function stack (#8661 )
(Boshen)
- 3802d28 minifier: Clean up `try_minimize_conditional` (#8660 ) (Boshen)
- dcc1f2b minifier: Rename `ast_passes` to `peephole` (#8635 ) (Boshen)
- 52458de minifier: Remove unused code and traits (#8632 ) (Boshen)
- 6f95cd5 minifier: Remove all the unnecessary fake ast passes (#8618 )
(Boshen)
- 712cae0 minifier: Run the compressor on all test cases (#8604 )
(Boshen)
- 864b8ef parser: Shorten code (#8640 ) (overlookmotel)
- b8d9a51 span: Deal only in owned `Atom`s (#8641 ) (overlookmotel)
- 20f52b1 span: Remove unnecessary lifetimes on `Atom` impls (#8639 )
(overlookmotel)
- ac4f98e span: Derive `Copy` on `Atom` (#8596 ) (branchseer)
- a730f99 transformer: Move `create_prototype_member` to utils module
(#8657 ) (Dunqing)
- 61d96fd transformer/class-properties: Correct comments (#8636 )
(overlookmotel)
### Testing
- 39dbd2d codegen: Fix snapshot file (#8685 ) (Boshen)
- d9f5e7f minifier: Enable passed esbuild tests (Boshen)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-24 12:09:37 +08:00
Boshen
db863a35bc
refactor(codegen): use Stack for binary_expr_stack ( #8663 )
...
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-23 10:08:21 +08:00
Boshen
ae895d8c0e
refactor(minifier): use NonEmptyStack for function stack ( #8661 )
2025-01-22 16:04:36 +00:00
Boshen
5b3c412e26
perf(minifier): only run optimizations on local changes ( #8644 )
...
Previously all code are ran in a fixed point loop when ast changes.
This PR changes running code when a function changes its enclosing ast only.
2025-01-21 23:55:54 +08:00
Boshen
52458de00b
refactor(minifier): remove unused code and traits ( #8632 )
2025-01-21 05:41:11 +00:00
Boshen
c9f3c5fc2b
chore(allocator): remove default features from hashbrown ( #8619 )
2025-01-20 16:18:41 +00:00
oxc-bot
8f5be07ed6
release(crates): v0.47.1 ( #8593 )
...
## [0.47.1] - 2025-01-19
### Features
- ee8ee55 napi/parser: Add `.hasChanged()` to `MagicString` (#8586 )
(Boshen)
- 1bef911 napi/parser: Add source map API (#8584 ) (Boshen)
### Bug Fixes
- 7b219a9 minifier: Fix dce shadowed undefined (#8582 ) (Boshen)
- 7421a52 transformer/typescript: Correctly resolve references to
non-constant enum members (#8543 ) (branchseer)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-19 09:44:29 +08:00
oxc-bot
66c8720002
release(oxlint): v0.15.7 ( #8592 )
...
## [0.15.7] - 2025-01-19
### Features
- 01ac773 linter: Support `ignoreTypeOfTestName` for `jest/valid-title`
(#8589 ) (dalaoshu)
- 538b24a linter: Format the configuration documentation correctly
(#8583 ) (Tapan Prakash)
- 7ab14cc linter: Add more Vitest compatible Jest rules (#8445 ) (Anson
Heung)
- d178360 linter: Implement `eslint/prefer-promise-reject-errors`
(#8254 ) (tbashiyy)
- 4ac2e99 oxlint: Implement `--init` cli option (#8453 ) (Tapan Prakash)
### Bug Fixes
- 855c839 codegen: Shorthand assignment target identifier consider
mangled names (#8536 ) (Boshen)
- c15af02 linter: False positive in `eslint/no-lone-blocks` (#8587 )
(dalaoshu)
- 41f2070 linter: Rule `no-restricted-imports` support missing options
(#8076 ) (Alexander S.)
- 869bc73 linter: Enhance `default_param_last` rule to handle optional
parameters (#8563 ) (Tapan Prakash)
- c6260c2 linter: Support rest params for `prefer_promise_reject_errors`
(#8468 ) (Yuichiro Yamashita)
- 2be1e82 linter/no-unused-vars: False positives when variable and type
have same name (#8465 ) (Dunqing)
### Performance
- 250bbd1 linter/react-exhaustive-deps: Use stack of `AstType`s instead
of `AstKind`s (#8522 ) (overlookmotel)
### Refactor
- 40f5165 linter: Improve `eslint/no-lone-blocks` (#8588 ) (dalaoshu)
- b4c87e2 linter: Move DiagnosticsReporters to oxlint (#8454 ) (Alexander
S.)
- bf00f82 linter: Move rule `prefer-each` from vitest to jest +
remapping (#8448 ) (Alexander S.)
- 8dd0013 linter/consistent-function-scoping: Remove `Visit::enter_node`
usage (#8538 ) (overlookmotel)
- 30c0689 linter/no-map-spread: Remove `Visit::enter_node` usage (#8537 )
(overlookmotel)
- b5ed58e span: All methods take owned `Span` (#8297 ) (overlookmotel)
### Styling
- 3789d2f linter/react-exhaustive-deps: Fix indentation (#8520 )
(overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-19 09:00:00 +08:00
Boshen
ee8ee55cda
feat(napi/parser): add .hasChanged() to MagicString ( #8586 )
2025-01-18 15:29:17 +00:00
Boshen
1bef911e59
feat(napi/parser): add source map API ( #8584 )
2025-01-18 23:06:42 +08:00
oxc-bot
d3fd7a9741
release(crates): v0.47.0 ( #8580 )
...
## [0.47.0] - 2025-01-18
- fae4cd2 allocator: [**BREAKING**] Remove `Vec::into_string` (#8571 )
(overlookmotel)
- 95bc0d7 allocator: [**BREAKING**] `Allocator` do not deref to
`bumpalo::Bump` (#8569 ) (overlookmotel)
- 19d3677 ast: [**BREAKING**] Always return
`Array<ImportDeclarationSpecifier>` for `ImportDeclaration.specifiers`
(#8560 ) (sapphi-red)
- 4ce6329 semantic: [**BREAKING**] Ensure program outlives semantic
(#8455 ) (Valentinas Janeiko)
- 7066d1c ast, span, syntax, regular_expression: [**BREAKING**] Remove
`ContentHash` (#8512 ) (overlookmotel)
### Features
- bf4e5e1 allocator: Add `HashMap` (#8553 ) (overlookmotel)
- a6d71f8 ast: Add `AstKind::ty` method (#8521 ) (overlookmotel)
- 4d4e805 minifier: Collapse if stmt with empty consequent (#8577 )
(camc314)
- 991a22f minifier: Fold `Array::concat` into literal (#8442 )
(sapphi-red)
- 3dc2d8b minifier: Fold string concat chaining (#8441 ) (sapphi-red)
- a4ae450 minifier: Fold array concat chaining (#8440 ) (sapphi-red)
- 7cc81ef minifier: Fold invalid typeof comparisons (#8550 ) (camc314)
- 927f43f minifier: Improve `.charCodeAt(arg)` when arg is valid (#8534 )
(Boshen)
- 06f14d5 minifier: Remove empty class static block `class Foo { static
{} }` (#8525 ) (Boshen)
- 1860411 minifier: Remove last redundant return statement (#8523 )
(Boshen)
- c479a58 napi/parser: Expose dynamic import expressions (#8540 )
(Boshen)
- 2f0314e npm/oxc-minify: Npm package and publish script (#8579 )
(Boshen)
- f413bb5 transformer/optional-chaining: Change parent scope for
expression when it wrapped with an arrow function (#8511 ) (Dunqing)
### Bug Fixes
- e87c001 allocator: Statically prevent memory leaks in allocator
(#8570 ) (overlookmotel)
- 855c839 codegen: Shorthand assignment target identifier consider
mangled names (#8536 ) (Boshen)
- 65c596d minifer: Keep idents if not in scope when minimizing array
exprs (#8551 ) (camc314)
- f57aac2 minifier: Incorrect folding of expr in bool ctx (#8542 )
(camc314)
- 946ad76 minifier: `(-Infinity).toString()` -> `'-Infinity'` (#8535 )
(Boshen)
- b1d0186 minifier: Do not fold `!!void b` (#8533 ) (Boshen)
- 53adde5 minifier: `x['-2147483648']` -> `x[-2147483648]` (#8528 )
(Boshen)
- 405b73d minifier: Do not change `delete undefined` to `delete void 0`
(#8527 ) (Boshen)
- 92e44cb minifier: Do not remove `undefined` in `var x = undefined`
(#8526 ) (Boshen)
- 209e313 minifier: `class C { ['-1']() {} }` cannot be minifized
(#8516 ) (Boshen)
- 6585463 minifier: Always keep the last value of sequence expression
(#8490 ) (Boshen)
- b552f5c transformer: `wrap_in_arrow_function_iife` take span of input
`Expression` (#8547 ) (overlookmotel)
- 9963533 transformer/arrow-functions: Visit arguments to `super()` call
(#8494 ) (overlookmotel)
- 06ccb51 transformer/async-to-generator: Move parameters to the inner
generator function when they could throw errors (#8500 ) (Dunqing)
- 356f0c1 transformer/class-properties: Handle nested `super()` calls
(#8506 ) (overlookmotel)
- a048337 transformer/class-static-blocks: Static block converted to
IIFE use span of original block (#8549 ) (overlookmotel)
### Performance
- 76ea52b allocator: Inline `Box` methods (#8572 ) (overlookmotel)
- 93df57f allocator: `#[inline(always)]` methods of `Vec` which just
delegate to `allocator_api2` (#8567 ) (overlookmotel)
- 5a28d68 allocator: `#[inline(always)]` methods of `HashMap` which just
delegate to `hashbrown` (#8565 ) (overlookmotel)
- d17021c mangler: Optimize `base54` function (#8557 ) (overlookmotel)
- 6b52d7a mangler: Use a single allocation space for temporary vecs
(#8495 ) (Boshen)
- 30a869e semantic: Use `oxc_allocator::HashMap` in `ScopeTree` (#8554 )
(overlookmotel)
- 63eb298 span: Compare `Span`s as single `u64`s (#8300 ) (overlookmotel)
- a43560c span: Hash `Span` as a single `u64` (#8299 ) (overlookmotel)
- 3fff7d2 span: Align `Span` same as `usize` (#8298 ) (overlookmotel)
- 53ef263 transformer/arrow-functions: Bail out of visiting early when
inserting `_this = this` after `super()` (#8482 ) (overlookmotel)
### Documentation
- fa1a6d5 allocator: Update docs for `Vec` (#8555 ) (overlookmotel)
### Refactor
- ac05134 allocator: `String` type (#8568 ) (overlookmotel)
- 68fab81 allocator: Rename inner `Vec` type (#8566 ) (overlookmotel)
- fcbca32 ast: Rename `#[estree(with)]` to `#[estree(via)]` (#8564 )
(overlookmotel)
- 007e8c0 ast, regular_expression: Shorten `ContentEq` implementations
(#8519 ) (overlookmotel)
- b4c87e2 linter: Move DiagnosticsReporters to oxlint (#8454 ) (Alexander
S.)
- 8f57929 minifier: Merge `try_compress_type_of_equal_string` into
`try_minimize_binary` (#8561 ) (sapphi-red)
- 2857ae1 parser: Refactor visitor in regexp example (#8524 )
(overlookmotel)
- b5ed58e span: All methods take owned `Span` (#8297 ) (overlookmotel)
- 712633f transformer: `wrap_statements_in_arrow_function_iife` utility
function (#8548 ) (overlookmotel)
- 5206c6a transformer: Rename `wrap_in_arrow_function_iife` (#8546 )
(overlookmotel)
- 61077ca transformer: `wrap_arrow_function_iife` receive an owned
`Expression` (#8545 ) (overlookmotel)
- 6820d24 transformer: Move `wrap_arrow_function_iife` to root utils
module (#8529 ) (Dunqing)
- 52bd0b1 transformer: Move common utils functions to the root module
(#8513 ) (Dunqing)
- c30654a transformer/arrow-function: Wrapping arrow function iife by
using `wrap_arrow_function_iife` (#8530 ) (Dunqing)
- 2bc5175 transformer/arrow-functions: Rename method (#8481 )
(overlookmotel)
- 72f425f transformer/class-properties: Fix lint warning in release mode
(#8539 ) (overlookmotel)
- 7e61b23 transformer/typescript: Shorten code (#8504 ) (overlookmotel)
- 04bc259 traverse: Remove unnecessary `#[allow]` (#8518 )
(overlookmotel)
- a368726 traverse: Harden soundness of `Traverse` and document safety
invariants better (#8507 ) (overlookmotel)
### Testing
- e0f5d6c minifier: Update esbuild test (Boshen)
- 629c417 minifier: Port esbuild minification tests (#8497 ) (Boshen)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-18 14:26:20 +08:00
overlookmotel
bfd0b0da17
ci(benchmark): make lexer benchmark more realistic ( #8573 )
...
The lexer benchmarks had a problem. The lexer alone cannot make sense of regexp literals, template literals, or JSX text elements - it needs the parser "driving" it.
So lexer was producing plenty of errors on some benchmarks. This is unrealistic - when driven by the parser, the lexer produces no errors. Generating diagnostics is relatively expensive, so this was skewing the benchmarks somewhat.
Solve this by cleaning up the input source text to replace these syntaxes with string literals prior to running the benchmarks.
Unfortunately lexer benchmarks don't exercise the code paths for these syntaxes, but there isn't much we can do about that. We can judge by the parser benchmarks, which are the more important ones anyway.
2025-01-18 01:47:07 +00:00
overlookmotel
d17021c834
perf(mangler): optimize base54 function ( #8557 )
...
Optimize mangler by creating identifiers in an inline array, instead of using the more expensive `CompactString`, and optimize `base54` function.
There's an unfortunate workaround necessary because of debug mode. In "normal" mode, identifiers are maximum 11 bytes (`usize::MAX` -> `ZrN6rN6rN6r`) but in debug mode they can be up to 25 bytes (`usize::MAX` -> `slot_18446744073709551615`). So this PR splits `build_with_symbols_and_scopes` into 2 branches for "normal" and "debug" modes with a generic function parameterized by max length of the string.
This is not ideal - it will increase binary size a bit, but everything else I tried (e.g. allocating strings into arena) was much slower.
The main motivation for this change wasn't actually performance. While working on allocator, I discovered that `CompactString`s were being allocated in arena (`reserved_names: ArenaVec<CompactStr>`), and wanted to remove them.
2025-01-17 05:47:28 +00:00
overlookmotel
30a869ead2
perf(semantic): use oxc_allocator::HashMap in ScopeTree ( #8554 )
...
Use `oxc_allocator::HashMap` in `ScopeTree`, replacing `hashbrown::HashMap`. `oxc_allocator::HashMap` is non-drop, so it may reduce drop time of `ScopeTree` a little.
2025-01-16 23:29:58 +00:00
overlookmotel
bf4e5e1c18
feat(allocator): add HashMap ( #8553 )
...
Add `HashMap` type to `oxc_allocator`. `HashMap` is a thin wrapper around `hashbrown::HashMap`, which allocates in the arena. The inner map is wrapped in `ManuallyDrop`, so `HashMap` is non-`Drop` (same as `oxc_allocator::Vec`).
We use `FxHasher` for all hash maps, so I figured just make that part of the type, rather than having to specify the hasher everywhere we use `HashMap`.
2025-01-16 23:29:57 +00:00
Alexander S.
b4c87e27a1
refactor(linter): move DiagnosticsReporters to oxlint ( #8454 )
...
it was never the plan that oxc_diagnostics should be the
`std::io::stdout` writer:
8fc238ac34/crates/oxc_diagnostics/src/service.rs (L84-L85)
This PR does refactor all reporters to `oxlint` crate and make the
current implementation of `oxc_diagnostics` public for others to
consume.
I added some tests to reflect to expected output (and found some bugs^^)
For the future I think the BufWriter for `std::io::stdout` should come
from outside.
Or maybe `std::fmt::stdout`? I do not know^^"
I could not test 100% of the code, I hope I can fix this with the next
PR which will include a own Tester for oxlint (like `oxc_linter`).
Please be extra careful when reviewing it.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-16 16:11:22 +08:00
renovate
8b6d331631
chore(deps): update rust crates ( #8452 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [convert_case](https://redirect.github.com/rutrum/convert-case ) | workspace.dependencies | minor | `0.6.0` -> `0.7.0` |
| [prettyplease](https://redirect.github.com/dtolnay/prettyplease ) | workspace.dependencies | patch | `0.2.27` -> `0.2.28` |
| [proc-macro2](https://redirect.github.com/dtolnay/proc-macro2 ) | workspace.dependencies | patch | `1.0.92` -> `1.0.93` |
---
### Release Notes
<details>
<summary>dtolnay/prettyplease (prettyplease)</summary>
### [`v0.2.28`](https://redirect.github.com/dtolnay/prettyplease/releases/tag/0.2.28 )
[Compare Source](https://redirect.github.com/dtolnay/prettyplease/compare/0.2.27...0.2.28 )
- Expression precedence fixes ([#​90](https://redirect.github.com/dtolnay/prettyplease/issues/90 ), [#​92](https://redirect.github.com/dtolnay/prettyplease/issues/92 ), [#​95](https://redirect.github.com/dtolnay/prettyplease/issues/95 ), [#​96](https://redirect.github.com/dtolnay/prettyplease/issues/96 ), [#​97](https://redirect.github.com/dtolnay/prettyplease/issues/97 ), [#​98](https://redirect.github.com/dtolnay/prettyplease/issues/98 ), [#​100](https://redirect.github.com/dtolnay/prettyplease/issues/100 ))
</details>
<details>
<summary>dtolnay/proc-macro2 (proc-macro2)</summary>
### [`v1.0.93`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.93 )
[Compare Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.92...1.0.93 )
- Optimize TokenStream's Drop ([#​489](https://redirect.github.com/dtolnay/proc-macro2/issues/489 ), [#​490](https://redirect.github.com/dtolnay/proc-macro2/issues/490 ), thanks [@​WalkerKnapp](https://redirect.github.com/WalkerKnapp ))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 11am on monday" in timezone Asia/Shanghai, Automerge - "before 11am on monday" in timezone Asia/Shanghai.
🚦 **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:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-01-15 13:29:46 +00:00
oxc-bot
3e05055783
release(crates): v0.46.0 ( #8487 )
...
## [0.46.0] - 2025-01-14
- 7eb6ccd ast: [**BREAKING**] Remove unused and not useful `ContentHash`
(#8483 ) (Boshen)
### Features
- 8accfef minifier: Minify `var x; void x` -> `void 0` (#8466 ) (Boshen)
- 870a583 minifier: Fold `false['toString']` (#8447 ) (Boshen)
- 4ad695d napi/minify: Implement napi (#8478 ) (Boshen)
- 9d550aa span: Add `Atom::r#static` (#8479 ) (_Kerman)
### Bug Fixes
- 4071878 isolated-declarations: Retain `declare` declarations when they
are exported (#8477 ) (Dunqing)
- 7ee7634 isolated-declarations: Import statement disappears when import
binding is referenced in nested `typeof` (#8476 ) (Dunqing)
- 7252cb0 isolated-declarations: Unexpected error when global `Symbol`
as property key (#8475 ) (Dunqing)
- 4c6675c minifier: Do not convert while to fors in DCE (#8484 ) (Boshen)
- 1d6e84d minifier: Fix incorrect `null.toString()` and `1n.toString()`
(#8464 ) (Boshen)
- 25d4bf9 minifier: Remove usage of empty spans (#8462 ) (Boshen)
- dd64340 minifier: Keep `return undefined` in async generator function
(#8439 ) (Boshen)
- c444de8 transformer/arrow-functions: Transform `this` and `super`
incorrectly in async arrow function (#8435 ) (Dunqing)
- 270245f transformer/typescript: Correct the semantic for
TSImportEqualsDeclaration transformation (#8463 ) (Dunqing)
- 2a400d6 transformer/typescript: Retain TSImportEqualsDeclaration when
it is exported (Dunqing)
- ab694b0 transformer/typescript: Retain `TSImportEqualsDeclaration` in
`namespace` when its binding has been referenced or
`onlyRemoveTypeImports` is true (#8458 ) (Dunqing)
### Performance
- 7a8200c mangler: Allocate base54 name without heap allocation (#8472 )
(Boshen)
- 31dac22 mangler: Allocate data in arena (#8471 ) (Boshen)
- 8fc238a minifier: Merge `Normalize` and `RemoveSyntax` pass (#8467 )
(Boshen)
- 372eb09 minifier: Preallocate mangler's semantic data (#8451 ) (Boshen)
### Refactor
- 6e64eef codegen: Remove `match_expression!` (#8450 ) (Boshen)
- de5b288 span: Rename `Atom::new_const` method (#8480 ) (overlookmotel)
- c83ce5c transformer/typescript: Improve transforming namespace (#8459 )
(Dunqing)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-14 19:40:44 +08:00
Boshen
4ad695dcfb
feat(napi/minify): implement napi ( #8478 )
2025-01-14 08:55:55 +00:00
Boshen
7a8200c20e
perf(mangler): allocate base54 name without heap allocation ( #8472 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-14 10:36:21 +08:00
Boshen
31dac229aa
perf(mangler): allocate data in arena ( #8471 )
2025-01-14 10:24:51 +08:00
Boshen
dba054f529
feat(tasks/benchmark): add mangler ( #8470 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-14 10:08:13 +08:00
oxc-bot
424c770012
release(oxlint): v0.15.6 ( #8456 )
...
## [0.15.6] - 2025-01-13
### Features
- 457aa31 linter: Implement `no-lone-blocks` rule (#8145 ) (Yuichiro
Yamashita)
### Refactor
- aea9551 ast: Simplify `get_identifier_reference` of `TSType` and
`TSTypeName` (#8273 ) (Dunqing)
- 43ed3e1 linter: Add output formatter (#8436 ) (Alexander S.)
- 4e05e66 linter: Remove glob for windows (#8390 ) (Alexander S.)
- b19d809 linter: Split `unicorn/prefer-spread` and
`eslint/prefer-spread` into own rules (#8329 ) (Alexander S.)
- 3c534ae linter: Refactor `LintBuilder` to prep for nested configs
(#8034 ) (camc314)
- 2f9fab9 linter: Remove remapping for plugin name in diagnostics
(#8223 ) (Alexander S.)
### Testing
- b6c1546 linter: Use plugin name instead of category for finding rule
(#8353 ) (Alexander S.)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-13 11:08:34 +08:00
Alexander S.
43ed3e1722
refactor(linter): add output formatter ( #8436 )
...
I want to start grouping all the different Formats for action X, Y and Z
into own place.
This is the first step and probably not the best one to be honest :)
~~I prefer that the `OutputFormatter` is a part of `oxlint` and not
`oxc_linter`~~
~~but all `use create::rules::RULES` is not public from outside.~~
EDIT: I pushed a commit with this changes can easily be reverted and
move back to `oxc_linter`
Also their is a crate `oxc_diagnostics` which has already the concept
too but only for the lint part of `oxlint` and not for the other parts.
The next goal would be splitting the `DiagnosticService` with its
reporters to `oxlint`.
2025-01-12 08:22:56 +08:00
oxc-bot
01722f34ff
release(crates): v0.45.0 ( #8434 )
...
## [0.45.0] - 2025-01-11
- 7f69561 ast: [**BREAKING**] `oxc_ast` do not export `BigUint` (#8428 )
(overlookmotel)
- d8b27af ast: [**BREAKING**] No unneccesary trailing underscores on
`AstBuilder` method names (#8283 ) (overlookmotel)
- 5106088 ast: [**BREAKING**] Remove `FromIn<Expression> for Statement`
(#8280 ) (overlookmotel)
### Features
- 6c7acac allocator: Implement `IntoIterator` for `&mut Vec` (#8389 )
(overlookmotel)
- 3212bcd ast_tools: Ignore `raw` field of `NumericLiteral` and
`StringLiteral` in `ContentEq` (#8417 ) (Boshen)
- ad146bb codegen: Print real newline when `\n` is inside template
literals (#8178 ) (Boshen)
- 41ddf60 minfier: Add `CompressOptions::target` (#8179 ) (Boshen)
- d56020b minifier: Drop `0` from `new Int8Array(0)` and other
TypedArrays (#8431 ) (sapphi-red)
- f935d94 minifier: Remove `new` from NativeErrors / `AggregateError`
(#8430 ) (sapphi-red)
- dab7a51 minifier: Minimize not `!(x === undefined)` -> `x !==
undefined` (#8429 ) (Boshen)
- 0e7bab8 minifier: Remove `if(false){}` in a single pass (#8421 )
(Boshen)
- 5b5b844 minifier: Fold `ambiguous if else` (#8415 ) (Boshen)
- 438a6e7 minifier: Minimize conditions in boolean context (#8381 )
(Boshen)
- 793cb43 minifier: `a != null ? a : b` -> `a ?? b` (#8352 ) (camc314)
- 814da55 minifier: Compress `x = x || 1` to `x ||= 1` (#8368 )
(sapphi-red)
- a596821 minifier: Compress `a.b = a.b + c` to `a.b += c` (#8367 )
(sapphi-red)
- 579eb60 minifier: Compress `a.b || (a.b = c)` to `a.b ||= c` (#8366 )
(sapphi-red)
- f367a16 minifier: Port esbuild conditional expr minification (#8351 )
(camc314)
- 8d52cd0 minifier: Merge assign expression in conditional expression
(#8345 ) (sapphi-red)
- a69d15f minifier: Compress `new Array(2)` -> `[,,]` (#8344 )
(sapphi-red)
- 819c475 minifier: Compress `new Array(7n)` -> `[7n]` (#8343 )
(sapphi-red)
- e085d66 minifier: Remove empty IIFE (#8340 ) (Boshen)
- 2c2e483 minifier: Fold object spread `({ ...null })` -> `({})` (#8339 )
(Boshen)
- 6220e05 minifier: Remove empty if statment `if (test) {}` -> `test`
(#8336 ) (Boshen)
- a76dfae minifier: Remove label statement with empty body (#8333 )
(Boshen)
- e88a6bd minifier: Minimize `!0 + null !== 1` -> `!0 + null != 1`
(#8332 ) (Boshen)
- ec88c68 minifier: Compress `a || (a = b)` to `a ||= b` (#8315 )
(sapphi-red)
- e6fe84d minifier: Compress `a = a + b` to `a += b` (#8314 )
(sapphi-red)
- 9ea4e31 minifier: Remove `new` from `new Error`/`new Function`/`new
RegExp` (#8313 ) (sapphi-red)
- 051fbb6 minifier: Minimize `x["0"]` -> x[0] (#8316 ) (Boshen)
- a542013 minifier: Minimize `do{}while(true)` -> `do;while(true)`
(#8311 ) (Boshen)
- e3ff81e minifier: Minimize `(x = 1) === 1` -> `(x = 1) == 1` (#8310 )
(Boshen)
- 4b68cc0 minifier: Minimize empty `try` statement (#8309 ) (Boshen)
- 922c514 minifier: Fold `.toString()` (#8308 ) (Boshen)
- 66a2443 minifier: Minify sequence expressions (#8305 ) (camc314)
- af65c36 minifier: Minimize double negated binary expressions (#8304 )
(camc314)
- 76c778b minifier: Remove logical nots when arg is a delete expression
(#8303 ) (camc314)
- 5ed439b minifier: Minify typeof in binary expressions (#8302 )
(camc314)
- 6afc590 minifier: Compress typeof addition string (#8301 ) (camc314)
- ecc789f minifier: Fold `if(x >> y == 0){}` -> `if(!(x >> y)){}`
(#8277 ) (Boshen)
- 0e3b79a minifier: Fold `String()` -> `''`, `Number()` -> `false`
(#8274 ) (Boshen)
- c9cf593 minifier: Compress property key `{[1]: _}` -> {1: _} (#8272 )
(Boshen)
- b92b2ab minifier: Fold `BigInt(1n)` -> `1n` (#8270 ) (Boshen)
- a4df387 minifier: Compress loose equals undefined (#8268 ) (camc314)
- f000596 minifier: Minify call expressionsto `Number` (#8267 ) (camc314)
- 092aeaf minifier: Flatten spread args in call expressions (#8266 )
(camc314)
- 04ec38d minifier: Remove unused arrow function expressions (#8262 )
(camc314)
- e446c15 minifier: Improve minimizing unary not expressions (#8261 )
(camc314)
- 7f19211 minifier: Minimize unary expression statements (#8256 )
(camc314)
- cec63e2 minifier: `{}` evals to `f64::NaN` (Boshen)
- 4d8a08d minifier: Improve constant evaluation (#8252 ) (Boshen)
- e84f267 minifier: Compress more property keys (#8253 ) (Boshen)
- d1224f9 minifier: Improve minimizing conditional expressions (#8251 )
(camc314)
- 65f46f5 minifier: Constant fold `String.fromCharCode` (#8248 ) (Boshen)
- bd8d677 minifier: Minimize `~undefined`, `~null`, `~true`, `~false`
(#8247 ) (Boshen)
- f73dc9e minifier: Constant fold `'x'.toString()` and `true.toString()`
(#8246 ) (Boshen)
- fd5af73 minifier: Minimize `Number` constructor (#8245 ) (Boshen)
- 2f52f33 minifier: Minsize `!!!foo ? bar : baz` -> `foo ? baz : bar`
(#8244 ) (Boshen)
- ccdc039 minifier: Always put literals on the rhs of equal op `1==x` =>
`x==1` (#8240 ) (Boshen)
- 39353b2 minifier: Improve minimizing conditionals (#8238 ) (Cameron)
- c90fc16 minifier: Restore conditional minification and fix edge case
(#8235 ) (camc314)
- 6c8ee9f minifier: Remove last redundant `return` statement (#8234 )
(Boshen)
- 51f4792 minifier: Minimize `foo ? foo : bar` and `foo ? bar : foo`
(#8229 ) (Boshen)
- 6e2ec17 minifier: Statement fusion switch cases; improved minimize
exit poitns (#8228 ) (Boshen)
- 574a242 minifier: Minimize all variants of `typeof x == 'undefined'`
(#8227 ) (Boshen)
- 2041477 minifier: Fold `if(x)return;y` -> `if(!x)y` (#8226 ) (Boshen)
- 9c1afa4 minifier: Optional catch binding when catch param is unused
(#8221 ) (Boshen)
- 4a29845 minifier: Add `ConvertToDottedProperties` (#8212 ) (Boshen)
- 2786dea minifier: Add `RemoveUnusedCode` (#8210 ) (Boshen)
- cd274ee minifier: Minimize logical exprs (#8209 ) (Cameron)
- 4ae15df minifier: Imprve more conditional expr minification with
boolean lit (#8208 ) (camc314)
- 3202b4f minifier: Imprve conditional expr minification with boolean
lit (#8207 ) (camc314)
- 3b45011 minifier: Handle conditional expr with boolean lit (#8206 )
(camc314)
- 4c2059a minifier: Reverse negated conditional exprs (#8205 ) (camc314)
- 4804933 minifier: Add `MinimizeExitPoints` and ExploitAssigns`
boilerplate (#8203 ) (Boshen)
- bf266e1 minifier: Try collapse conditional to logical or expr (#8197 )
(Cameron)
- 06e1780 minifier: Improve `StatementFusion` (#8194 ) (Boshen)
- 42e211a minifier: Only constant fold numbers when result is smaller
(#8092 ) (Boshen)
- d0de560 minifier: Change `NaN` to `f64::NAN` (#8191 ) (Boshen)
- cef8eb8 minifier: Change `foo?.['bar']` to `foo?.bar` (#8176 ) (翠 /
green)
- 8149e34 minifier: Optional catch binding when es target >= es2019
(#8180 ) (Boshen)
- fc43ec5 minifier: Fold `string.length` / `array.length` (#8172 )
(sapphi-red)
- 29dc0dc minifier: Change `foo['bar']` -> foo.bar (#8169 ) (Boshen)
- 3c5718d minifier: Fold `typeof foo == undefined` into `foo ==
undefined` when possible (#8160 ) (翠 / green)
- f3a36e1 minifier: Fold `typeof foo != "undefined"` into `typeof foo <
"u"` (#8159 ) (翠 / green)
- 37c9959 minifier: Normalize `Infinity` into `f64::Infinity` (#8148 )
(Boshen)
- 8fb71f5 minifier: Minify string `PropertyKey` (#8147 ) (Boshen)
- 6615e1e minifier: Constant fold `instanceof` (#8142 ) (翠 / green)
- 2b2a373 minifier: Minimize `a + 'b' + 'c'` -> `a + 'bc'` (#8137 )
(Boshen)
- 213364a minifier: Minimize `if (x) if (y) z` -> `if (x && y) z`
(#8136 ) (Boshen)
- 6b51e6d minifier: Minimize `if(foo) bar else baz` -> `foo ? bar : baz`
(#8133 ) (Boshen)
- f615bfa minifier: Minimize `if (x) return; return 1` -> `return x ?
void 0 : 1` (#8130 ) (Boshen)
- f0b1ee5 minifier: Minimize `if(!x) foo()` -> `x || foo()` (#8122 )
(Boshen)
- f8200a8 minifier: Minimize `if(foo) bar` -> `foo && bar` (#8121 )
(Boshen)
- 72d9967 minifier: Add `Normalize` ast pass (#8120 ) (Boshen)
- fef0b25 minifier: Collapse `var` into for loop initializer (#8119 )
(Boshen)
- 2331ea8 minifier: `typeof foo === 'number'` => `typeof foo ==
'number'` (#8112 ) (Boshen)
- ad9a0a9 mininifier: Minimize variants of `a instanceof b == true`
(#8241 ) (Boshen)
- 2da4365 parser: Missing initializer in destructuring declaration
inside for loop head (#8222 ) (Boshen)
- 55744fd semantic: Allow getting mutable reference to symbols table
(#8189 ) (Max Stoumen)
- 0592a8b transformer/class-properties: Transform private in expression
(#8202 ) (Dunqing)
- ad77ad5 transformer/class-properties: Transform static/instance
accessor methods (#8132 ) (Dunqing)
- e405f79 transformer/class-properties: Transform static private method
invoking (#8117 ) (Dunqing)
- 3303e99 transformer/class-properties: Insert statements after
statement of class expression (#8116 ) (Dunqing)
- 0cc71cf transformer/class-properties: Transform super expressions and
identifiers that refers to class binding in private method (#8106 )
(Dunqing)
- 58ed832 transformer/class-properties: Transform private field
expression which invokes private method (#8102 ) (Dunqing)
- f14567a transformer/class-properties: Transform callee which invokes
private method (#8100 ) (Dunqing)
- 13349ef transformer/class-properties: Transform private methods
(#8099 ) (Dunqing)
### Bug Fixes
- eb25bc0 allocator: Fix lifetimes on `IntoIterator` for `Vec` (#8388 )
(overlookmotel)
- 97a7992 ast: Fix `ContentEq` and `ContentHash` impls for literal types
(#8426 ) (overlookmotel)
- a1752a0 codegen: Fix incorrect minified `return 1n` output (#8374 )
(Boshen)
- 5a648bc codegen: Fix white space issue with do statements (#8348 )
(Boshen)
- b6d16f4 codegen: Print parenthesis on negative bigint lit when
neccessary (#8258 ) (camc314)
- 8ed9766 codegen: Source map builder panicked because it attempted to
subtract with overflow in `search_original_line_and_column` (#8185 )
(Dunqing)
- ad61e70 codegen: Print if else without block with proper indentation
(#8135 ) (Boshen)
- 74572de ecmascript: Incorrect `to_int_32` value for Infinity (#8144 )
(翠 / green)
- e1f8ea4 lexer: `Source` is not `Clone` (#8294 ) (overlookmotel)
- 5c63414 mangler: Keep exported symbols for `top_level: true` (#7927 )
(翠 / green)
- 3c93549 minifier: Dce if statement should keep side effects and vars
(#8433 ) (Boshen)
- 52f88c0 minifier: Rotate associative operators to make it more
idempotent (#8424 ) (camc314)
- a80460c minifier: Correctly set `self.changed` when minimizing if
stmts (#8420 ) (camc314)
- d4ca8d4 minifier: `!!x` is not idempotent in `RemoveDeadCode` (#8419 )
(Boshen)
- 357b61d minifier: Do not minify `Object.defineProperty` in sequence
expressions (#8416 ) (Boshen)
- 0efc845 minifier: `+0n` produces `TypeError` (#8410 ) (Boshen)
- 7ce6a7c minifier: `a in b` has error throwing side effect (#8406 )
(Boshen)
- 2f3a9dc minifier: Cannot transform property key `#constructor` (#8405 )
(Boshen)
- c0a3dda minifier: `instanceof` has error throwing side effect (#8378 )
(Boshen)
- 5516f7f minifier: Do not fold object comparisons (#8375 ) (Boshen)
- cb098c7 minifier: Computed property key `prototype` cannot be changed
(#8373 ) (Boshen)
- 82ee77e minifier: Do not remove shadowned `undefined` in return
statement (#8371 ) (Boshen)
- f87da16 minifier: Do not fold literals in `-0 != +0` (#8278 ) (Boshen)
- 62a2644 minifier: Handle arrow fn expressions correctly in
`is_in_boolean_context` (#8260 ) (camc314)
- d2f8eaa minifier: Fix panic in `peephole_minimize_conditions` (#8242 )
(Boshen)
- a698def minifier: Fix incorrect return value for `(x ? true : y)`
(#8233 ) (Boshen)
- 05be1fc minifier: Remove incorrect fold
`Expression::AssignmentExpression` (#8211 ) (Boshen)
- 56b7f13 minifier: Do not constant fold `0 instanceof F` (#8199 )
(Boshen)
- 75d5f17 minifier: Minify string `PropertyKey` (#8177 ) (sapphi-red)
- f88acb3 parser: Allow line breaks between `const` and `enum` (#8193 )
(branchseer)
- 79a8fc6 semantic: Report error for super property appearing in
function body (#8376 ) (Dunqing)
- 79af100 semantic: Reference flags not correctly resolved when after an
export stmt (#8134 ) (camc314)
- 3eaff2a transformer: Ensure last expression statement in arrow
function expression is wrapped in return (#8192 ) (Dunqing)
- 3feac27 transformer/arrow-functions: Outer `super()` in nested class
(#8382 ) (Dunqing)
- 335065d transformer/arrow-functions: Do not transform super that
inside nested non-async method (#8335 ) (Dunqing)
- e4d66e4 transformer/arrow-functions: Store `super_methods` on a
`Stack` to fix nested async methods (#8331 ) (Dunqing)
- 775a289 transformer/arrow-functions: `_this = this` should be inserted
after super call expression (#8024 ) (Dunqing)
- ac72adb transformer/private-methods: Fix panic if instance private
accessor in class (#8362 ) (overlookmotel)
- f1f129b transformer/private-methods: Create brand binding `var` in
hoist scope (#8361 ) (overlookmotel)
- ab61425 transformer/private-methods: No temp var for class when unused
private methods (#8360 ) (overlookmotel)
- 9a03bd2 transformer/typescript: Remove type-only `import =` when
`only_remove_type_imports` is true (#8275 ) (Dunqing)
- 0df1866 transformer/typescript: Create `Reference` for `require`
(#8355 ) (overlookmotel)
- 78d7c97 transformer/typescript: Create `Reference` for `Infinity`
(#8354 ) (overlookmotel)
- 2e7207f transformer/typescript: Should strip import specifiers type
with `only_remove_type_imports` (#8141 ) (underfin)
### Performance
- 07edf74 transformer/arrow-function: Stop traversal at function as
super() can't appear in a nested function (#8383 ) (Dunqing)
- 62e3f7e transformer/arrow-functions: Reduce size of inlined visitor
(#8322 ) (overlookmotel)
- aebe0ea transformer/arrow-functions: Use `NonEmptyStack` instead of
`Stack` (#8318 ) (overlookmotel)
### Documentation
- c8e4843 ast: Fix doc comment (#8286 ) (overlookmotel)
- e0a09ab data_structures: Improve docs for stack types (#8356 )
(overlookmotel)
- aaa009d minifier: Clarify assumptions for compressor (#8404 ) (翠 /
green)
- 05cba5b transformer/private-methods: Amend comments (#8398 )
(overlookmotel)
### Refactor
- b29655f ast: Rearrange impls for literal types in same order as they
are defined (#8425 ) (overlookmotel)
- 0db2a22 ast: `AstBuilder` enum builder methods use `alloc_*` methods
(#8281 ) (overlookmotel)
- aea9551 ast: Simplify `get_identifier_reference` of `TSType` and
`TSTypeName` (#8273 ) (Dunqing)
- 9c1844a data_structures: Remove `NonNull` shim (#8423 ) (overlookmotel)
- 1835687 ecmascript: Remove unnecessary `use` statement (#8284 )
(overlookmotel)
- 64bfdfe lexer: Tighten safety of lexer by always including lifetime on
`SourcePosition` (#8293 ) (overlookmotel)
- 0344e98 lexer: Make `handle_byte` a method of `Lexer` (#8291 )
(overlookmotel)
- fabf116 lexer: Replace `#[allow]` with `#[expect]` (#8289 )
(overlookmotel)
- 0462edb lexer: Rename function param (#8288 ) (overlookmotel)
- fb2acd8 minifier: Change minimize conditionals into a loop (#8413 )
(Boshen)
- baaec60 minifier: Remove the buggy `??` transform (#8411 ) (Boshen)
- 1c4658d minifier: Change ast passes order, `!in_fixed_loop` happen
last (#8380 ) (Boshen)
- 09f0f48 minifier: Remove the buggy `minimize_exit_points`
implementation (#8349 ) (Boshen)
- 9a5c66a minifier: Clean up (#8346 ) (Boshen)
- 98f2b1c minifier: Clean up `peephole_substitute_alternate_syntax`
(#8327 ) (Boshen)
- fc662b7 minifier: Handle big int values later (#8324 ) (Boshen)
- d16e598 minifier: Clean up `peephole_replace_known_methods` (#8306 )
(Boshen)
- b8d26ea minifier: Move optional catch param to
peephole_substitute_alternate_syntax (#8282 ) (Boshen)
- 0845162 minifier: Clean up `ReplaceKnownMethods` (Boshen)
- 7c7f5d7 minifier: Clean up `peephole_fold_constants` (Boshen)
- bf0fbce minifier: Improve constant fold numbers (#8239 ) (Boshen)
- 62f8fba minifier: Move all conditional minification logic to
minimze_conditions (#8231 ) (camc314)
- cfb51f2 minifier: Fuse ast passes (#8184 ) (Boshen)
- bf9cafe minifier: Clean up `peephole_substitute_alternate_syntax` a
little bit (Boshen)
- 75264ed minifier: Clean up `try_optimize_block` (#8139 ) (Boshen)
- c22062b minifier: Cleanup peephole_minimize_conditions (#8114 )
(Boshen)
- e594c39 minifier: Clean up `peephole_substitute_alternate_syntax.rs`
(#8111 ) (Boshen)
- 0903501 semantic: Check super usage based on scope (#8377 ) (Dunqing)
- 109b8fc transformer: Elide lifetimes where possible (#8285 )
(overlookmotel)
- fb389f7 transformer/arrow-function: Create a new ident instead of
clone (#8338 ) (Dunqing)
- dddbd29 transformer/arrow-functions: Reorder assertions (#8386 )
(overlookmotel)
- ce6c445 transformer/arrow-functions: Add TODO comments (#8328 )
(overlookmotel)
- 73d0025 transformer/arrow-functions: Reduce repeated code (#8323 )
(overlookmotel)
- 3dd08e9 transformer/arrow-functions: Do not inline non-trivial visitor
method (#8321 ) (overlookmotel)
- ea9cefb transformer/arrow-functions: Reorder visitor methods (#8320 )
(overlookmotel)
- 37199a4 transformer/arrow-functions: Rename lifetime (#8319 )
(overlookmotel)
- 57e9dcf transformer/arrow-functions: Shorten `AstBuilder` call (#8317 )
(overlookmotel)
- a5e3528 transformer/async-to-generator: Pass `TraverseCtx` to function
not `AstBuilder` (#8279 ) (overlookmotel)
- e7c89ba transformer/class-properties: TODO comments (#8392 )
(overlookmotel)
- 6790d1d transformer/class-properties: Simplify determining if class is
declaration (#8357 ) (overlookmotel)
- c786a13 transformer/class-properties: Share
`replace_class_name_with_temp_var` in class_properties (#8105 ) (Dunqing)
- f54f48e transformer/class-properties: Remove all `*_if_super` methods
in `static_block_and_prop_init` (#8104 ) (Dunqing)
- d82fb52 transformer/class-properties: Move `supers` to
`super_converter` (#8103 ) (Dunqing)
- 3dad85e transformer/private-methods: Remove unnecessary clone (#8400 )
(overlookmotel)
- aa5e65f transformer/private-methods: Simplify finding parent statement
of class expression (#8364 ) (overlookmotel)
- c786fd1 transformer/private-methods: TODO comments (#8363 )
(overlookmotel)
### Styling
- 4d2888d lexer: Reorder imports (#8290 ) (overlookmotel)
- e81f34f span: Reformat code (#8296 ) (overlookmotel)
- 45e2402 transformer/private-methods: Move comments (#8399 )
(overlookmotel)
- 0a1ffc0 transformer/private-methods: Rename var (#8397 )
(overlookmotel)
### Testing
- 16dcdaf lexer: Assert size of `Token` in 32-bit WASM (#8292 )
(overlookmotel)
- 3149fe0 minifier: Add anonymous function test case for logical
expression to logical assignment compression (#8347 ) (sapphi-red)
- 91b42de minifier: Enable some passing tests (#8250 ) (camc314)
- 1fa5341 minifier: Port tests from ConvertToDottedPropertiesTest
(#8175 ) (sapphi-red)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-11 22:34:31 +08:00
翠 / green
5c63414c23
fix(mangler): keep exported symbols for top_level: true ( #7927 )
...
~~I'm not going to work on a fix for a while so feel free to fix it if
anyone wants to work on it.~~
Exported symbols are now not mangled.
2025-01-10 15:14:30 +08:00
Boshen
a006955fcb
build(rust): incompatible-rust-versions = "fallback" + cargo update ( #8407 )
2025-01-10 06:41:51 +00:00
Alexander S.
4e05e66d7c
refactor(linter): remove glob for windows ( #8390 )
...
The current implementations does not work. Under linux it tells me 0
files, under windows:
```
> oxc-vscode@0.15.5 lint C:\dev\oxc\editors\vscode
> npx oxlint --config=oxlint.json --tsconfig=tsconfig.json client/*.js
Finished in 5ms on 5 files with 101 rules using 24 threads.
Found 0 warnings and 0 errors.
```
I do not think this glob is needed. we are using `ignore` in our
`Walker`, which should already covering the use case.
---------
Co-authored-by: Sysix <alexander.schlegel@clicksports.de>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-10 10:03:43 +08:00
翠 / green
3ba0b5316d
chore(tasks/coverage): fix test262 cases to run on windows ( #8358 )
...
`skip_test_path` was not working on windows because the path included
`\\`.
2025-01-09 10:48:37 +08:00
Yuji Sugiura
8e3eed7562
refactor(prettier): Update tasks/prettier to correctly handle snapshots ( #8337 )
...
I refactored the code in `tasks/prettier_conformance` primarily to make
the output more readable when using `--filter`.
But I also discovered that our previous implementation did not correctly
handle Prettier's behavior of adding a blank line at the EOF.
In addition, I resolved a problem where test specs that used patterns
like `runFormatTest(_, parsers)` were unable to locate the correct
snapshot output.
As a result, compatibility has also improved slightly. 😉
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-08 17:10:30 +08:00
renovate
676886fdab
chore(deps): update rust crates ( #8255 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [compact_str](https://redirect.github.com/ParkMyCar/compact_str ) | workspace.dependencies | patch | `0.8.0` -> `0.8.1` |
| [handlebars](https://redirect.github.com/sunng87/handlebars-rust ) | workspace.dependencies | minor | `6.2.0` -> `6.3.0` |
| [insta](https://insta.rs/ ) ([source](https://redirect.github.com/mitsuhiko/insta )) | workspace.dependencies | minor | `1.41.1` -> `1.42.0` |
| [itertools](https://redirect.github.com/rust-itertools/itertools ) | workspace.dependencies | minor | `0.13.0` -> `0.14.0` |
| [petgraph](https://redirect.github.com/petgraph/petgraph ) | workspace.dependencies | minor | `0.6.5` -> `0.7.0` |
| [prettyplease](https://redirect.github.com/dtolnay/prettyplease ) | workspace.dependencies | patch | `0.2.25` -> `0.2.27` |
| [syn](https://redirect.github.com/dtolnay/syn ) | workspace.dependencies | patch | `2.0.93` -> `2.0.95` |
| [tempfile](https://stebalien.com/projects/tempfile-rs/ ) ([source](https://redirect.github.com/Stebalien/tempfile )) | workspace.dependencies | minor | `3.14.0` -> `3.15.0` |
---
### Release Notes
<details>
<summary>ParkMyCar/compact_str (compact_str)</summary>
### [`v0.8.1`](https://redirect.github.com/ParkMyCar/compact_str/compare/v0.8.0...v0.8.1 )
[Compare Source](https://redirect.github.com/ParkMyCar/compact_str/compare/v0.8.0...v0.8.1 )
</details>
<details>
<summary>sunng87/handlebars-rust (handlebars)</summary>
### [`v6.3.0`](https://redirect.github.com/sunng87/handlebars-rust/blob/HEAD/CHANGELOG.md#630---2025-01-05 )
[Compare Source](https://redirect.github.com/sunng87/handlebars-rust/compare/v6.2.0...v6.3.0 )
- \[Added] Builders for some non-exhaustive structs \[[#​688](https://redirect.github.com/sunng87/handlebars-rust/issues/688 )]
- \[Changed] `and` and `or` helper now accepts multiple parameters \[[#​687](https://redirect.github.com/sunng87/handlebars-rust/issues/687 )]
- \[Changed] MSRV is now 1.73
</details>
<details>
<summary>mitsuhiko/insta (insta)</summary>
### [`v1.42.0`](https://redirect.github.com/mitsuhiko/insta/blob/HEAD/CHANGELOG.md#1420 )
[Compare Source](https://redirect.github.com/mitsuhiko/insta/compare/1.41.1...1.42.0 )
- Text snapshots no longer contain `snapshot_type: text` in their metadata. For
context, we originally added this in the prior release (1.41.0) to support
binary snapshots, but some folks disliked the diff noise on any snapshot
changes, and the maintainers' weighted votes favored reverting. I apologize
that this will cause some additional churn for those who used `cargo test --force-update-snapshots` to update their snapshots to the 1.41 format;
running this again with 1.42 will remove those metadata entries. To confirm:
this doesn't affect whether snapshot tests pass or fail — the worst impact is
some additional diffs in metadata. [#​690](https://redirect.github.com/mitsuhiko/insta/issues/690 )
- Pending snapshots are no longer removed throughout the workspace by
`cargo-insta` before running tests. Instead, running a test will overwrite or
remove its own pending snapshot. To remove all pending snapshots, use `cargo
insta reject` or run tests with `--unreferenced=delete`. [#​651](https://redirect.github.com/mitsuhiko/insta/issues/651 )
- `insta::internals::SettingsBindDropGuard` (returned from
`Settings::bind_to_scope`) no longer implements `Send`. This was incorrect and
any tests relying on this behavior where not working properly. Fixes [#​694](https://redirect.github.com/mitsuhiko/insta/issues/694 ) in
[#​695](https://redirect.github.com/mitsuhiko/insta/issues/695 ) by [@​jalil-salame](https://redirect.github.com/jalil-salame )
</details>
<details>
<summary>rust-itertools/itertools (itertools)</summary>
### [`v0.14.0`](https://redirect.github.com/rust-itertools/itertools/blob/HEAD/CHANGELOG.md#0140 )
[Compare Source](https://redirect.github.com/rust-itertools/itertools/compare/v0.13.0...v0.14.0 )
##### Breaking
- Increased MSRV to 1.63.0 ([#​960](https://redirect.github.com/rust-itertools/itertools/issues/960 ))
- Removed generic parameter from `cons_tuples` ([#​988](https://redirect.github.com/rust-itertools/itertools/issues/988 ))
##### Added
- Added `array_combinations` ([#​991](https://redirect.github.com/rust-itertools/itertools/issues/991 ))
- Added `k_smallest_relaxed` and variants ([#​925](https://redirect.github.com/rust-itertools/itertools/issues/925 ))
- Added `next_array` and `collect_array` ([#​560](https://redirect.github.com/rust-itertools/itertools/issues/560 ))
- Implemented `DoubleEndedIterator` for `FilterOk` ([#​948](https://redirect.github.com/rust-itertools/itertools/issues/948 ))
- Implemented `DoubleEndedIterator` for `FilterMapOk` ([#​950](https://redirect.github.com/rust-itertools/itertools/issues/950 ))
##### Changed
- Allow `Q: ?Sized` in `Itertools::contains` ([#​971](https://redirect.github.com/rust-itertools/itertools/issues/971 ))
- Improved hygiene of `chain!` ([#​943](https://redirect.github.com/rust-itertools/itertools/issues/943 ))
- Improved `into_group_map_by` documentation ([#​1000](https://redirect.github.com/rust-itertools/itertools/issues/1000 ))
- Improved `tree_reduce` documentation ([#​955](https://redirect.github.com/rust-itertools/itertools/issues/955 ))
- Improved discoverability of `merge_join_by` ([#​966](https://redirect.github.com/rust-itertools/itertools/issues/966 ))
- Improved discoverability of `take_while_inclusive` ([#​972](https://redirect.github.com/rust-itertools/itertools/issues/972 ))
- Improved documentation of `find_or_last` and `find_or_first` ([#​984](https://redirect.github.com/rust-itertools/itertools/issues/984 ))
- Prevented exponentially large type sizes in `tuple_combinations` ([#​945](https://redirect.github.com/rust-itertools/itertools/issues/945 ))
- Added `track_caller` attr for `asser_equal` ([#​976](https://redirect.github.com/rust-itertools/itertools/issues/976 ))
##### Notable Internal Changes
- Fixed clippy lints ([#​956](https://redirect.github.com/rust-itertools/itertools/issues/956 ), [#​987](https://redirect.github.com/rust-itertools/itertools/issues/987 ), [#​1008](https://redirect.github.com/rust-itertools/itertools/issues/1008 ))
- Addressed warnings within doctests ([#​964](https://redirect.github.com/rust-itertools/itertools/issues/964 ))
- CI: Run most tests with miri ([#​961](https://redirect.github.com/rust-itertools/itertools/issues/961 ))
- CI: Speed up "cargo-semver-checks" action ([#​938](https://redirect.github.com/rust-itertools/itertools/issues/938 ))
- Changed an instance of `default_features` in `Cargo.toml` to `default-features` ([#​985](https://redirect.github.com/rust-itertools/itertools/issues/985 ))
</details>
<details>
<summary>petgraph/petgraph (petgraph)</summary>
### [`v0.7.0`](https://redirect.github.com/petgraph/petgraph/blob/HEAD/RELEASES.rst#Version-070-2024-12-31 )
[Compare Source](https://redirect.github.com/petgraph/petgraph/compare/petgraph@v0.6.6...petgraph@v0.7.0 )
\==========================
- Re-released version 0.6.6 with the correct version number, as it included a major update to an exposed crate (`#664`\_).
### [`v0.6.6`](https://redirect.github.com/petgraph/petgraph/blob/HEAD/RELEASES.rst#Version-066-2024-12-31---yanked )
[Compare Source](https://redirect.github.com/petgraph/petgraph/compare/petgraph@v0.6.5...petgraph@v0.6.6 )
\===================================
- Add graph6 format encoder and decoder (`#658`\_)
- Dynamic Topological Sort algorithm support (`#675`\_)
- Add `UndirectedAdaptor` (`#695`\_)
- Add `LowerHex` and `UpperHex` implementations for `Dot` (`#687`\_)
- Make `serde` support more complete (`#550`\_)
- Process multiple edges in the Floyd-Warshall implementation (`#685`\_)
- Update `fixedbitset` to 0.5.7 (`#664`\_)
- Fix `immediately_dominated_by` function called on root of graph returns root itself (`#670`\_)
- Fix adjacency matrix for `Csr` and `List` (`#648`\_)
- Fix clippy warnings (`#701`\_)
- Add performance note to the `all_simple_paths` function documentation (`#693`\_)
.. \_`#658`: [https://github.com/petgraph/petgraph/pull/658 ](https://redirect.github.com/petgraph/petgraph/pull/658 )
.. \_`#675`: [https://github.com/petgraph/petgraph/pull/675 ](https://redirect.github.com/petgraph/petgraph/pull/675 )
.. \_`#695`: [https://github.com/petgraph/petgraph/pull/695 ](https://redirect.github.com/petgraph/petgraph/pull/695 )
.. \_`#687`: [https://github.com/petgraph/petgraph/pull/687 ](https://redirect.github.com/petgraph/petgraph/pull/687 )
.. \_`#550`: [https://github.com/petgraph/petgraph/pull/550 ](https://redirect.github.com/petgraph/petgraph/pull/550 )
.. \_`#685`: [https://github.com/petgraph/petgraph/pull/685 ](https://redirect.github.com/petgraph/petgraph/pull/685 )
.. \_`#664`: [https://github.com/petgraph/petgraph/pull/664 ](https://redirect.github.com/petgraph/petgraph/pull/664 )
.. \_`#670`: [https://github.com/petgraph/petgraph/pull/670 ](https://redirect.github.com/petgraph/petgraph/pull/670 )
.. \_`#648`: [https://github.com/petgraph/petgraph/pull/648 ](https://redirect.github.com/petgraph/petgraph/pull/648 )
.. \_`#701`: [https://github.com/petgraph/petgraph/pull/701 ](https://redirect.github.com/petgraph/petgraph/pull/701 )
.. \_`#693`: [https://github.com/petgraph/petgraph/pull/693 ](https://redirect.github.com/petgraph/petgraph/pull/693 )
</details>
<details>
<summary>dtolnay/prettyplease (prettyplease)</summary>
### [`v0.2.27`](https://redirect.github.com/dtolnay/prettyplease/releases/tag/0.2.27 )
[Compare Source](https://redirect.github.com/dtolnay/prettyplease/compare/0.2.26...0.2.27 )
- Avoid trailing '.' on non-macro float literals ([#​89](https://redirect.github.com/dtolnay/prettyplease/issues/89 ))
### [`v0.2.26`](https://redirect.github.com/dtolnay/prettyplease/releases/tag/0.2.26 )
[Compare Source](https://redirect.github.com/dtolnay/prettyplease/compare/0.2.25...0.2.26 )
- Synthesize parentheses for precedence ([#​88](https://redirect.github.com/dtolnay/prettyplease/issues/88 ))
</details>
<details>
<summary>dtolnay/syn (syn)</summary>
### [`v2.0.95`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.95 )
[Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.94...2.0.95 )
- Fix parenthesization of struct literals in let-chains ([#​1832](https://redirect.github.com/dtolnay/syn/issues/1832 ))
### [`v2.0.94`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.94 )
[Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.93...2.0.94 )
- Expression precedence fixes ([#​1811](https://redirect.github.com/dtolnay/syn/issues/1811 ), [#​1812](https://redirect.github.com/dtolnay/syn/issues/1812 ), [#​1813](https://redirect.github.com/dtolnay/syn/issues/1813 ), [#​1814](https://redirect.github.com/dtolnay/syn/issues/1814 ), [#​1815](https://redirect.github.com/dtolnay/syn/issues/1815 ), [#​1816](https://redirect.github.com/dtolnay/syn/issues/1816 ), [#​1818](https://redirect.github.com/dtolnay/syn/issues/1818 ), [#​1819](https://redirect.github.com/dtolnay/syn/issues/1819 ), [#​1820](https://redirect.github.com/dtolnay/syn/issues/1820 ), [#​1825](https://redirect.github.com/dtolnay/syn/issues/1825 ), [#​1826](https://redirect.github.com/dtolnay/syn/issues/1826 ), [#​1827](https://redirect.github.com/dtolnay/syn/issues/1827 ), [#​1828](https://redirect.github.com/dtolnay/syn/issues/1828 ), [#​1829](https://redirect.github.com/dtolnay/syn/issues/1829 ), [#​1830](https://redirect.github.com/dtolnay/syn/issues/1830 ))
</details>
<details>
<summary>Stebalien/tempfile (tempfile)</summary>
### [`v3.15.0`](https://redirect.github.com/Stebalien/tempfile/blob/HEAD/CHANGELOG.md#3150 )
[Compare Source](https://redirect.github.com/Stebalien/tempfile/compare/v3.14.0...v3.15.0 )
Re-seed the per-thread RNG from system randomness when we repeatedly fail to create temporary files ([#​314](https://redirect.github.com/Stebalien/tempfile/issues/314 )). This resolves a potential DoS vector ([#​178](https://redirect.github.com/Stebalien/tempfile/issues/178 )) while avoiding `getrandom` in the common case where it's necessary. The feature is optional but enabled by default via the `getrandom` feature.
For libc-free builds, you'll either need to disable this feature or opt-in to a different [`getrandom` backend](https://redirect.github.com/rust-random/getrandom?tab=readme-ov-file#opt-in-backends ).
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 11am on monday" in timezone Asia/Shanghai, Automerge - "before 11am on monday" in timezone Asia/Shanghai.
🚦 **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:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-01-06 03:07:53 +00:00
Boshen
2786dea164
feat(minifier): add RemoveUnusedCode ( #8210 )
2025-01-02 12:50:21 +00:00
oxc-bot
d2d90b077b
release(oxlint): v0.15.5 ( #8218 )
...
## [0.15.5] - 2025-01-02
### Features
- 0e168b8 linter: Catch more cases in const-comparisons (#8215 )
(Cameron)
- bde44a3 linter: Add `statement_span` to `ModuleRecord/ImportEntry`
(#8195 ) (Alexander S.)
- ccaa9f7 linter: Implement `eslint/new-cap` (#8146 ) (Alexander S.)
### Bug Fixes
- 2b14a6f linter: Fix `ignorePattern` config for windows (#8214 )
(Alexander S.)
### Testing
- cb709c9 linter: Fix some oxlint tests on windows (#8204 ) (Cameron)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-02 18:55:31 +08:00
oxc-bot
936623ea45
release(oxlint): v0.15.4 ( #8190 )
...
## [0.15.4] - 2024-12-30
### Features
- 47cea9a linter: Implement `eslint/no-extra-label` (#8181 ) (Anson
Heung)
- ef76e28 linter: Implement `eslint/no-multi-assign` (#8158 ) (Anson
Heung)
- 384858b linter: Implement `jsx-a11y/no-noninteractive-tabindex`
(#8167 ) (Tyler Earls)
- afc21a6 linter: Implement `eslint/vars-on-top` (#8157 ) (Yuichiro
Yamashita)
- 65796c4 linter: Implement `eslint/prefer-rest-params` (#8155 )
(Yuichiro Yamashita)
- 5234d96 linter: Implement `eslint/no-nested-ternary` (#8150 ) (Yuichiro
Yamashita)
- 1c5db72 linter: Implement eslint/no-labels (#8131 ) (Anson Heung)
- 0b04288 linter: Move `import/named` to nursery (#8068 ) (Boshen)
### Bug Fixes
- 0794bee editor/vscode: Set minimum supported ver. to `^1.93.0` (#8182 )
(Pavel Smirnov)
- f3050d4 linter: Exclude svelte files from `no_unused_vars` rule
(#8170 ) (Yuichiro Yamashita)
- faf7464 linter: Disable rule `react/rules-of-hook` by file extension
(#8168 ) (Alexander S.)
- 1171e00 linter: Disable `react/rules-of-hooks` for vue and svelte
files (#8165 ) (Alexander S.)
- 1b9a5ba linter: False positiver in private member expr in
oxc/const-comparison (#8164 ) (camc314)
- 6bd9ddb linter: False positive in `typescript/ban-tslint-comment`
(#8094 ) (dalaoshu)
- 10a1fd5 linter: Rule: `no-restricted-imports` support option
`patterns` with `group` key (#8050 ) (Alexander S.)
- b3f38ae linter: Rule `no-restricted-imports`: support option
`allowImportNames` (#8002 ) (Alexander S.)
- 340cc90 linter: Rule `no-restricted-imports`: fix option "importNames"
(#7943 ) (Alexander S.)
- ec2128e linter: Fix line calculation for `eslint/max-lines` in
diagnostics (#7962 ) (Dmitry Zakharov)
- 79af100 semantic: Reference flags not correctly resolved when after an
export stmt (#8134 ) (camc314)
### Performance
- d8d2ec6 linter: Run rules which require typescript syntax only when
source type is actually typescript (#8166 ) (Alexander S.)
- 2736657 semantic: Allocate `UnresolvedReferences` in allocator (#8046 )
(Boshen)
### Refactor
- de8246b language_server: Move structs into own file (#8026 ) (Alexander
S.)
- 774babb linter: Read `exported_bindings_from_star_export` lazily
(#8062 ) (Boshen)
- 547c102 linter: Use `RwLock<FxHashMap>` instead of `FxDashMap` for
module record data (#8061 ) (Boshen)
- 952d7e4 linter: Rename `flat.rs` to `config.rs` (#8033 ) (camc314)
- 50848ed linter: Simplify `ConfigStore` to prep for nested configs
(#8032 ) (camc314)
- b2a4a78 linter: Remove unused `with_rules` and `set_rule` methods
(#8029 ) (camc314)
- 6da0b21 oxlint: Remove unused `git.rs` (#7990 ) (Boshen)
- 58e7777 oxlint: Remove extra if check in `Walkdir` (#7989 ) (Boshen)
- 02f968d semantic: Change `Bindings` to a plain `FxHashMap` (#8019 )
(Boshen)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-12-30 15:47:06 +08:00
renovate[bot]
11e598ecb1
chore(deps): update rust crates ( #8186 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [console](https://redirect.github.com/console-rs/console ) |
workspace.dependencies | patch | `0.15.8` -> `0.15.10` |
| [env_logger](https://redirect.github.com/rust-cli/env_logger ) |
workspace.dependencies | patch | `0.11.5` -> `0.11.6` |
| [fast-glob](https://redirect.github.com/shulaoda/fast-glob ) |
workspace.dependencies | patch | `0.4.0` -> `0.4.3` |
| [glob](https://redirect.github.com/rust-lang/glob ) |
workspace.dependencies | patch | `0.3.1` -> `0.3.2` |
|
[oxc-browserslist](https://redirect.github.com/oxc-project/oxc-browserslist )
| workspace.dependencies | patch | `1.1.0` -> `1.1.1` |
| [oxc_resolver](https://redirect.github.com/oxc-project/oxc-resolver ) |
workspace.dependencies | patch | `3.0.1` -> `3.0.3` |
| [oxc_sourcemap](https://redirect.github.com/oxc-project/oxc-sourcemap )
| workspace.dependencies | patch | `1.0.5` -> `1.0.6` |
| [quote](https://redirect.github.com/dtolnay/quote ) |
workspace.dependencies | patch | `1.0.37` -> `1.0.38` |
| [serde](https://serde.rs )
([source](https://redirect.github.com/serde-rs/serde )) |
workspace.dependencies | patch | `1.0.216` -> `1.0.217` |
| [serde_json](https://redirect.github.com/serde-rs/json ) |
workspace.dependencies | patch | `1.0.133` -> `1.0.134` |
| [syn](https://redirect.github.com/dtolnay/syn ) |
workspace.dependencies | patch | `2.0.90` -> `2.0.93` |
---
### Release Notes
<details>
<summary>console-rs/console (console)</summary>
###
[`v0.15.10`](https://redirect.github.com/console-rs/console/releases/tag/0.15.10 )
[Compare
Source](https://redirect.github.com/console-rs/console/compare/0.15.9...0.15.10 )
#### What's Changed
- Remove MSRV badge from README by
[@​djc](https://redirect.github.com/djc ) in
[https://github.com/console-rs/console/pull/228 ](https://redirect.github.com/console-rs/console/pull/228 )
###
[`v0.15.9`](https://redirect.github.com/console-rs/console/releases/tag/0.15.9 )
[Compare
Source](https://redirect.github.com/console-rs/console/compare/0.15.8...0.15.9 )
#### What's Changed
- Update dependencies by [@​djc](https://redirect.github.com/djc )
in
[https://github.com/console-rs/console/pull/227 ](https://redirect.github.com/console-rs/console/pull/227 )
</details>
<details>
<summary>rust-cli/env_logger (env_logger)</summary>
###
[`v0.11.6`](https://redirect.github.com/rust-cli/env_logger/blob/HEAD/CHANGELOG.md#0116---2024-12-20 )
[Compare
Source](https://redirect.github.com/rust-cli/env_logger/compare/v0.11.5...v0.11.6 )
##### Features
- Opt-in file and line rendering
</details>
<details>
<summary>rust-lang/glob (glob)</summary>
###
[`v0.3.2`](https://redirect.github.com/rust-lang/glob/blob/HEAD/CHANGELOG.md#032---2024-12-28 )
[Compare
Source](https://redirect.github.com/rust-lang/glob/compare/0.3.1...v0.3.2 )
</details>
<details>
<summary>oxc-project/oxc-browserslist (oxc-browserslist)</summary>
###
[`v1.1.1`](https://redirect.github.com/oxc-project/oxc-browserslist/blob/HEAD/CHANGELOG.md#111---2024-12-14 )
[Compare
Source](https://redirect.github.com/oxc-project/oxc-browserslist/compare/oxc-browserslist-v1.1.0...oxc-browserslist-v1.1.1 )
##### Other
- codegen
- dprint
- Update README.md
- *(deps)* update rust crates
- *(deps)* update rust crates
- *(deps)* update dependency rust to v1.83.0
([#​78](https://redirect.github.com/oxc-project/oxc-browserslist/issues/78 ))
- *(deps)* update rust crates
- *(deps)* update rust crates to v1.0.215
- *(deps)* update rust crate thiserror to v2.0.3
- *(deps)* update rust crate thiserror to v2
- *(deps)* update rust crates to v1.0.93
- `cargo autoinherit`
- *(deps)* update rust crate criterion2 to v2
</details>
<details>
<summary>oxc-project/oxc-resolver (oxc_resolver)</summary>
###
[`v3.0.3`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#303---2024-12-14 )
[Compare
Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v3.0.2...oxc_resolver-v3.0.3 )
##### <!-- 1 -->Bug Fixes
- try browsers field and alias before resolving directory in
node_modules
([#​349](https://redirect.github.com/oxc-project/oxc-resolver/issues/349 ))
###
[`v3.0.2`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#302---2024-12-13 )
[Compare
Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v3.0.1...oxc_resolver-v3.0.2 )
##### <!-- 1 -->Bug Fixes
- special case for aliasing `@/`
([#​348](https://redirect.github.com/oxc-project/oxc-resolver/issues/348 ))
- normalize resolved result on Windows for root
([#​345](https://redirect.github.com/oxc-project/oxc-resolver/issues/345 ))
##### <!-- 4 -->Refactor
- replace UnsafeCell with RefCell
([#​346](https://redirect.github.com/oxc-project/oxc-resolver/issues/346 ))
</details>
<details>
<summary>oxc-project/oxc-sourcemap (oxc_sourcemap)</summary>
###
[`v1.0.6`](https://redirect.github.com/oxc-project/oxc-sourcemap/blob/HEAD/CHANGELOG.md#106---2024-12-15 )
[Compare
Source](https://redirect.github.com/oxc-project/oxc-sourcemap/compare/v1.0.5...v1.0.6 )
##### Fixed
- handle non existing token position in visualizer
([#​14](https://redirect.github.com/oxc-project/oxc-sourcemap/issues/14 ))
</details>
<details>
<summary>dtolnay/quote (quote)</summary>
###
[`v1.0.38`](https://redirect.github.com/dtolnay/quote/releases/tag/1.0.38 )
[Compare
Source](https://redirect.github.com/dtolnay/quote/compare/1.0.37...1.0.38 )
- Support interpolating arrays inside of arrays using a repetition
([#​286](https://redirect.github.com/dtolnay/quote/issues/286 ))
</details>
<details>
<summary>serde-rs/serde (serde)</summary>
###
[`v1.0.217`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.217 )
[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.216...v1.0.217 )
- Support serializing externally tagged unit variant inside flattened
field
([#​2786](https://redirect.github.com/serde-rs/serde/issues/2786 ),
thanks [@​Mingun](https://redirect.github.com/Mingun ))
</details>
<details>
<summary>serde-rs/json (serde_json)</summary>
###
[`v1.0.134`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.134 )
[Compare
Source](https://redirect.github.com/serde-rs/json/compare/v1.0.133...v1.0.134 )
- Add `RawValue` associated constants for literal `null`, `true`,
`false`
([#​1221](https://redirect.github.com/serde-rs/json/issues/1221 ),
thanks [@​bheylin](https://redirect.github.com/bheylin ))
</details>
<details>
<summary>dtolnay/syn (syn)</summary>
###
[`v2.0.93`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.93 )
[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.92...2.0.93 )
- Fix expression parsing edge cases: `x as T <<= y`
([#​1804](https://redirect.github.com/dtolnay/syn/issues/1804 )),
`break as T`
([#​1805](https://redirect.github.com/dtolnay/syn/issues/1805 )),
`match x { _ if .. => {} }`
([#​1807](https://redirect.github.com/dtolnay/syn/issues/1807 ))
- Fix expression printing edge cases: `|| -> T 'a: {}`
([#​1806](https://redirect.github.com/dtolnay/syn/issues/1806 )),
`if break x {}`
([#​1808](https://redirect.github.com/dtolnay/syn/issues/1808 ),
[#​1810](https://redirect.github.com/dtolnay/syn/issues/1810 ))
###
[`v2.0.92`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.92 )
[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.91...2.0.92 )
- Fix parenthesization of jumps inside ranges
([#​1798](https://redirect.github.com/dtolnay/syn/issues/1798 ))
###
[`v2.0.91`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.91 )
[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.90...2.0.91 )
- Support parsing `Vec<Arm>` using `parse_quote!`
([#​1796](https://redirect.github.com/dtolnay/syn/issues/1796 ),
[#​1797](https://redirect.github.com/dtolnay/syn/issues/1797 ))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 11am on monday" in timezone
Asia/Shanghai, Automerge - "before 11am on monday" in timezone
Asia/Shanghai.
🚦 **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:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2024-12-30 15:25:17 +08:00
Boshen
41ddf60ab0
feat(minfier): add CompressOptions::target ( #8179 )
2024-12-29 12:27:32 +00:00
翠 / green
9d62284202
chore(tasks): print diff for minify idempotency assertion ( #8161 )
...
Made the assertion error output more easier to understand.
Example output:

---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-29 00:55:45 +08:00
Boshen
e594c3988d
refactor(minifier): clean up peephole_substitute_alternate_syntax.rs ( #8111 )
2024-12-25 13:54:51 +00:00
oxc-bot
5a1311e76c
release(crates): v0.44.0 ( #8110 )
...
## [0.44.0] - 2024-12-25
- ad2a620 ast: [**BREAKING**] Add missing
`AssignmentTargetProperty::computed` (#8097 ) (Boshen)
### Features
- c2daa20 ast: Add `Expression::into_inner_expression` (#8048 )
(overlookmotel)
- 618b6aa codege: Minify whitespace in object getter / setter (#8080 )
(Boshen)
- 4727667 codegen: Minify arrow expr `(x) => y` -> `x => y` (#8078 )
(Boshen)
- 0562830 codegen: Minify string with backtick when needed (#8095 )
(Boshen)
- 6237c05 codegen: Minify more whitespace (#8089 ) (Boshen)
- 6355b7c codegen: Minify `export { 's' as 's' }` -> `export { 's' }`
(#8093 ) (Boshen)
- fccfda9 codegen: Minify `class{static[computed]}` (#8088 ) (Boshen)
- f873139 codegen: Minify `for (_ of [])` -> `for(_ of[])` (#8086 )
(Boshen)
- 8b8cbcd codegen: Minify `case "foo"` -> `case"foo"` (#8085 ) (Boshen)
- 414c118 codegen: Minify `yield "s"` -> `yield"s"` (#8084 ) (Boshen)
- f8f067b codegen: Minify class method `async*fn(){}` (#8083 ) (Boshen)
- 1d5ae81 codegen: Minify `const [foo] = bar` -> `const[foo]=bar`
(#8079 ) (Boshen)
- e3f78fb codegen: `new Foo()` -> `new Foo` when minify (#8077 ) (Boshen)
- d84d60a codegen: Minify numbers with large exponents (#8074 ) (Boshen)
- 373279b codegen: Balance string quotes when minify whitespace (#8072 )
(Boshen)
- 5397fe9 minifier: Constant fold `undefined?.bar` -> `undefined`
(#8075 ) (Boshen)
- 1932f1e minifier: Fold `foo === undefined || foo === null` (#8063 ) (翠
/ green)
- 11c4bd8 span: Implement source type `{file basename}.d.{extension}.ts`
(#8109 ) (Boshen)
- be4feb4 syntax: Add `SymbolId::new` method (#8041 ) (overlookmotel)
- e632a7b transformer: Remove typescript symbols after transform (#8069 )
(Boshen)
### Bug Fixes
- bdc241d codegen: Disallow template literals in object property key
(#8108 ) (Boshen)
- 728ed20 codegen: Print `yield * ident` correctly (Boshen)
- b605baa minifier: Constant fold strings with tab char (#8096 ) (Boshen)
- de82492 parser: Report syntax errors for missing constructor
implementations (#8081 ) (camc314)
- 55d6eb9 parser: Disallow type parameters on class constructors (#8071 )
(injuly)
- be2c60d parser: Parse `import source from from 'mod'` (#8056 ) (Boshen)
- 708e9cf semantic: Report errors for missing class method impls (#8082 )
(camc314)
- 3057686 transformer/class-properties: Unwrap parenthesised expressions
(#8049 ) (overlookmotel)
- e67cd05 transformer/class-properties: Correctly resolve private fields
pointing to private accessors (#8047 ) (overlookmotel)
- 6b08c6e transformer/class-properties: Correctly resolve private fields
pointing to private methods (#8042 ) (overlookmotel)
- 274f117 transformer/nullish-coalescing: Use correct scope id for
binding (#8053 ) (camc314)
### Performance
- 78d2e83 sourcemap: Improve perf of `search_original_line_and_column`
(#7926 ) (Cameron)
### Refactor
- 7110c7b codegen: Add `print_quoted_utf16` and `print_unquoted_utf16`
methods (#8107 ) (Boshen)
- 8b54d89 minifier: Remove parens must happen on enter (#8060 ) (Boshen)
- 7cb84f3 minifier: Only minify on ast node exit (#8059 ) (Boshen)
- 77d845a minifier: Fuse DCE AST passes (#8058 ) (Boshen)
- 6123f5e minifier: Fold statements on exit (#8057 ) (Boshen)
- cbd5169 transformer/class-properties: Do not recreate private field if
not transforming it (#8044 ) (overlookmotel)
- 98e8a72 transformer/class-properties: Do not take mut ref when immut
ref will do (#8040 ) (overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-12-25 21:03:09 +08:00
Alexander S.
10a1fd57e5
fix(linter): rule: no-restricted-imports support option patterns with group key ( #8050 )
...
one/two wierd tests are not covered
> This is also an object option whose value is an array. This option
allows you to specify multiple modules to restrict using gitignore-style
patterns or regular expressions.
_https://eslint.org/docs/latest/rules/no-restricted-imports#patterns_
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-23 14:52:38 +08:00
oxc-bot
d69de3629d
release(crates): v0.43.0 ( #8054 )
...
## [0.43.0] - 2024-12-21
- de4c772 traverse: [**BREAKING**] Rename `Ancestor::is_via_*` methods
to `is_parent_of_*` (#8031 ) (overlookmotel)
- ed75e42 semantic: [**BREAKING**] Make SymbolTable fields `pub(crate)`
instead of `pub` (#7999 ) (Boshen)
### Features
- 75b775c allocator: `Vec<u8>::into_string` (#8017 ) (overlookmotel)
- 8547e02 ast: Implement `allocator_api2` for `Allocator` (#8043 )
(Boshen)
- 63a95e4 ast: Add `AstBulder::move_property_key` (#7998 )
(overlookmotel)
- 897a1a8 transformer/class-properties: Exit faster from super
replacement visitor (#8028 ) (overlookmotel)
- 3ea4109 transformer/class-properties: Transform super update
expressions within static prop initializer (#7997 ) (Dunqing)
- cc57db3 transformer/class-properties: Transform super assignment
expressions within static prop initializer (#7991 ) (Dunqing)
- 6b6444b traverse: Record current block scope (#8007 ) (overlookmotel)
### Bug Fixes
- 043252d transformer/class-properties: Replace `this` and class name in
static blocks (#8035 ) (overlookmotel)
- 273795d transformer/class-properties: Run other transforms on static
properties, static blocks, and computed keys (#7982 ) (overlookmotel)
### Performance
- c0dd3f8 ast: `move_expression` and `move_statement` produce dummy with
no span (#7995 ) (overlookmotel)
- 862838f codegen: Remove useless to_owned (#8014 ) (Dunqing)
- 2736657 semantic: Allocate `UnresolvedReferences` in allocator (#8046 )
(Boshen)
- 2e8872c semantic: Allocate child scope in allocator (#8045 ) (Boshen)
- 414e828 semantic: Allocate symbol data in Allocator (#8012 ) (Boshen)
- 7aebed0 semantic: Allocate `Bindings` in allocator (#8021 ) (Boshen)
- 0f9308f transformer/react-refresh: Reduce allocations (#8018 )
(overlookmotel)
- 0deb9e6 transformer/react-refresh: Reserve capacity in hook key string
(#8016 ) (overlookmotel)
- 7b70347 transformer/react-refresh: Avoid allocating string in each
hook call (#8013 ) (Dunqing)
### Documentation
- df5c341 ast: Improve docs for `AstBuilder::move_*` methods (#7994 )
(overlookmotel)
### Refactor
- f1adf9f semantic: `ScopeTree::rename_binding` remove old binding first
(#8020 ) (overlookmotel)
- 02f968d semantic: Change `Bindings` to a plain `FxHashMap` (#8019 )
(Boshen)
- e7476a1 semantic: Remove `serialize` (#8015 ) (Boshen)
- 1cf7b83 semantic: Simplify handling namespace stack (#7987 ) (Dunqing)
- 48cb52b semantic: Remove resetting `current_reference_flags` in visit
functions (#7986 ) (Dunqing)
- 3250a47 semantic: Remove unused current_symbol_flags (#7985 ) (Dunqing)
- efe96ec semantic: Use `Stack` for function stack node ids (#7984 )
(Dunqing)
- ac097e9 transformer/class-properties: Rename file (#8036 )
(overlookmotel)
- 059a5dd transformer/class-properties: Do not pass `ScopeId` into
`insert_instance_inits` (#8001 ) (overlookmotel)
- 0a38eea transformer/class-properties: Use `temp_var_name_base` to
generate temp var names for `super` transform (#8004 ) (overlookmotel)
- d1b7181 transformer/class-properties: Rename var (#8006 )
(overlookmotel)
- 5a23d72 transformer/class-properties: Remove outdated comment (#8000 )
(overlookmotel)
- b3a5f3e transformer/class-properties: Mark
`transform_assignment_expression_if_super_member_assignment_target` as
inline (#7993 ) (Dunqing)
### Testing
- bcb33c0 semantic: Add a test for catch parameters reference (#7988 )
(Dunqing)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-12-21 15:07:21 +08:00
Boshen
8547e02456
feat(ast): implement allocator_api2 for Allocator ( #8043 )
2024-12-20 13:26:48 +00:00
overlookmotel
75b775c055
feat(allocator): Vec<u8>::into_string ( #8017 )
...
Bumpalo has a method `String::from_utf8_unchecked` to covert a `Vec<u8>` to a `String`. But we can't use it because we use Bumpalo's `String` as our arena string type, but allocator_api2's `Vec` as our arena vec.
Provide the same functionality, that works around this incompatibility. Also use the faster `simdutf8` for checking that `Vec` contains a valid UTF-8 string.
2024-12-19 17:46:30 +00:00
Boshen
7aebed012d
perf(semantic): allocate Bindings in allocator ( #8021 )
2024-12-19 15:16:03 +00:00