Commit graph

7625 commits

Author SHA1 Message Date
camc314
af65c3670f feat(minifier): minimize double negated binary expressions (#8304) 2025-01-06 23:26:20 +00:00
camc314
76c778b03f feat(minifier): remove logical nots when arg is a delete expression (#8303) 2025-01-06 23:26:20 +00:00
camc314
5ed439bcaf feat(minifier): minify typeof in binary expressions (#8302) 2025-01-06 23:26:19 +00:00
camc314
6afc590db8 feat(minifier): compress typeof addition string (#8301) 2025-01-06 23:26:18 +00:00
overlookmotel
4d2888d6fc style(lexer): reorder imports (#8290)
Re-order imports in lexer.
2025-01-06 19:57:59 +00:00
overlookmotel
fabf116f4b refactor(lexer): replace #[allow] with #[expect] (#8289)
Pure refactor. Replace `#[allow]` with `#[expect]` in lexer, and remove various `#[allow]`s which were unnecessary.
2025-01-06 18:01:16 +00:00
overlookmotel
0462edbe7e refactor(lexer): rename function param (#8288)
Pure refactor. Rename unused function param. This results in better param name hint in IDE.
2025-01-06 17:33:09 +00:00
overlookmotel
d8b27afc35 refactor(ast)!: no unneccesary trailing underscores on AstBuilder method names (#8283)
`AstBuilder` method names have an `_` added on end if method name is not a valid identifier (e.g. `super`). But no need for trailing underscore on `alloc_super`.

Currently this only applies to `super`. But future-proof by checking against all Rust's reserved words.

This is a breaking change, because `alloc_super` method was previously called `alloc_super_`. But probably no-one uses that method anyway - usually you'd use `expression_super` method to get an `Expression::Super`.
2025-01-06 15:09:05 +00:00
overlookmotel
0db2a22e48 refactor(ast): AstBuilder enum builder methods use alloc_* methods (#8281)
Pure refactor. `AstBuilder` methods can use `alloc_*` methods directly, instead of calling `alloc`. Probably this makes no difference to performance as all these methods are marked `#[inline]` anyway. But in general it's better to use methods which don't return large objects on the stack.
2025-01-06 15:09:04 +00:00
overlookmotel
5106088b88 refactor(ast)!: remove FromIn<Expression> for Statement (#8280)
All node creation is meant to go via `AstBuilder`. This is necessary to support Node IDs. Remove this method which breaks that rule. It's not used anyway.
2025-01-06 15:02:58 +00:00
overlookmotel
a5e35282ac refactor(transformer/async-to-generator): pass TraverseCtx to function not AstBuilder (#8279)
Pure refactor. Our convention in transformer is to pass `TraverseCtx` around, and not deal with `AstBuilder` directly. This will make it easier to make changes to `AstBuilder` to support Node IDs later on.
2025-01-06 14:56:54 +00:00
overlookmotel
109b8fc047 refactor(transformer): elide lifetimes where possible (#8285)
Pure refactor. Enable `clippy::needless_lifetimes` lint rule in `oxc_transformer`, and fix what the rule flags - remove unnecessary lifetimes which can be elided.

Also rename a few lifetimes `'b` and `'c` to more descriptive `'ctx`.
2025-01-06 14:52:03 +00:00
overlookmotel
e81f34f2f6 style(span): reformat code (#8296) 2025-01-06 13:57:58 +00:00
overlookmotel
cd0c2dc6f7 test(transformer): remove repeated code from fixtures updating script (#8287)
Pure refactor / tidy up. These 2 lines are repeated twice.
2025-01-06 11:55:00 +00:00
overlookmotel
c8e48434c6 docs(ast): fix doc comment (#8286)
Docs only. Fix an erroneous doc comment.
2025-01-06 11:48:56 +00:00
overlookmotel
1835687b75 refactor(ecmascript): remove unnecessary use statement (#8284)
Tiny refactor. Unnecessary `use core::f64` snuck in in #8252. Probably auto-added by IDE.
2025-01-06 11:42:26 +00:00
Boshen
b8d26eab17 refactor(minifier): move optional catch param to peephole_substitute_alternate_syntax (#8282) 2025-01-06 10:47:56 +00:00
underfin
2e7207f11c
fix(transformer/typescript): should strip import specifiers type with only_remove_type_imports (#8141)
close: https://github.com/oxc-project/oxc/issues/8140
close: https://github.com/rolldown/rolldown/issues/3244

---------

Co-authored-by: Dunqing <dengqing0821@gmail.com>
2025-01-06 18:20:16 +08:00
Boshen
f87da160df fix(minifier): do not fold literals in -0 != +0 (#8278) 2025-01-06 10:08:57 +00:00
Boshen
ecc789f163 feat(minifier): fold if(x >> y == 0){} -> if(!(x >> y)){} (#8277) 2025-01-06 09:52:28 +00:00
Boshen
0e3b79a65b feat(minifier): fold String() -> '', Number() -> false (#8274) 2025-01-06 08:56:00 +00:00
Dunqing
aea95519db refactor(ast): simplify get_identifier_reference of TSType and TSTypeName (#8273) 2025-01-06 08:23:53 +00:00
Boshen
c9cf593cd7 feat(minifier): compress property key {[1]: _} -> {1: _} (#8272) 2025-01-06 08:08:59 +00:00
Yuji Sugiura
0ae2ba4316
refactor(prettier): Refactor printing statements (#8269)
Part of #5068 

Just for verifying. 
Almost all changes are cosmetic, do not affect compatibility.

---

(Happy new year! 🎍)
2025-01-06 15:59:41 +08:00
Boshen
b92b2abc2b feat(minifier): fold BigInt(1n) -> 1n (#8270) 2025-01-06 07:40:25 +00: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 \[[#&#8203;688](https://redirect.github.com/sunng87/handlebars-rust/issues/688)]
-   \[Changed] `and` and `or` helper now accepts multiple parameters \[[#&#8203;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.  [#&#8203;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`.  [#&#8203;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 [#&#8203;694](https://redirect.github.com/mitsuhiko/insta/issues/694) in
    [#&#8203;695](https://redirect.github.com/mitsuhiko/insta/issues/695) by [@&#8203;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 ([#&#8203;960](https://redirect.github.com/rust-itertools/itertools/issues/960))
-   Removed generic parameter from `cons_tuples` ([#&#8203;988](https://redirect.github.com/rust-itertools/itertools/issues/988))

##### Added

-   Added `array_combinations` ([#&#8203;991](https://redirect.github.com/rust-itertools/itertools/issues/991))
-   Added `k_smallest_relaxed` and variants ([#&#8203;925](https://redirect.github.com/rust-itertools/itertools/issues/925))
-   Added `next_array` and `collect_array` ([#&#8203;560](https://redirect.github.com/rust-itertools/itertools/issues/560))
-   Implemented `DoubleEndedIterator` for `FilterOk` ([#&#8203;948](https://redirect.github.com/rust-itertools/itertools/issues/948))
-   Implemented `DoubleEndedIterator` for `FilterMapOk` ([#&#8203;950](https://redirect.github.com/rust-itertools/itertools/issues/950))

##### Changed

-   Allow `Q: ?Sized` in `Itertools::contains` ([#&#8203;971](https://redirect.github.com/rust-itertools/itertools/issues/971))
-   Improved hygiene of `chain!` ([#&#8203;943](https://redirect.github.com/rust-itertools/itertools/issues/943))
-   Improved `into_group_map_by` documentation ([#&#8203;1000](https://redirect.github.com/rust-itertools/itertools/issues/1000))
-   Improved `tree_reduce` documentation ([#&#8203;955](https://redirect.github.com/rust-itertools/itertools/issues/955))
-   Improved discoverability of `merge_join_by` ([#&#8203;966](https://redirect.github.com/rust-itertools/itertools/issues/966))
-   Improved discoverability of `take_while_inclusive` ([#&#8203;972](https://redirect.github.com/rust-itertools/itertools/issues/972))
-   Improved documentation of `find_or_last` and `find_or_first` ([#&#8203;984](https://redirect.github.com/rust-itertools/itertools/issues/984))
-   Prevented exponentially large type sizes in `tuple_combinations` ([#&#8203;945](https://redirect.github.com/rust-itertools/itertools/issues/945))
-   Added `track_caller` attr for `asser_equal` ([#&#8203;976](https://redirect.github.com/rust-itertools/itertools/issues/976))

##### Notable Internal Changes

-   Fixed clippy lints ([#&#8203;956](https://redirect.github.com/rust-itertools/itertools/issues/956), [#&#8203;987](https://redirect.github.com/rust-itertools/itertools/issues/987), [#&#8203;1008](https://redirect.github.com/rust-itertools/itertools/issues/1008))
-   Addressed warnings within doctests ([#&#8203;964](https://redirect.github.com/rust-itertools/itertools/issues/964))
-   CI: Run most tests with miri ([#&#8203;961](https://redirect.github.com/rust-itertools/itertools/issues/961))
-   CI: Speed up "cargo-semver-checks" action ([#&#8203;938](https://redirect.github.com/rust-itertools/itertools/issues/938))
-   Changed an instance of `default_features` in `Cargo.toml` to `default-features` ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;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 ([#&#8203;1811](https://redirect.github.com/dtolnay/syn/issues/1811), [#&#8203;1812](https://redirect.github.com/dtolnay/syn/issues/1812), [#&#8203;1813](https://redirect.github.com/dtolnay/syn/issues/1813), [#&#8203;1814](https://redirect.github.com/dtolnay/syn/issues/1814), [#&#8203;1815](https://redirect.github.com/dtolnay/syn/issues/1815), [#&#8203;1816](https://redirect.github.com/dtolnay/syn/issues/1816), [#&#8203;1818](https://redirect.github.com/dtolnay/syn/issues/1818), [#&#8203;1819](https://redirect.github.com/dtolnay/syn/issues/1819), [#&#8203;1820](https://redirect.github.com/dtolnay/syn/issues/1820), [#&#8203;1825](https://redirect.github.com/dtolnay/syn/issues/1825), [#&#8203;1826](https://redirect.github.com/dtolnay/syn/issues/1826), [#&#8203;1827](https://redirect.github.com/dtolnay/syn/issues/1827), [#&#8203;1828](https://redirect.github.com/dtolnay/syn/issues/1828), [#&#8203;1829](https://redirect.github.com/dtolnay/syn/issues/1829), [#&#8203;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 ([#&#8203;314](https://redirect.github.com/Stebalien/tempfile/issues/314)). This resolves a potential DoS vector ([#&#8203;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
camc314
a4df3874c5 feat(minifier): compress loose equals undefined (#8268) 2025-01-06 02:21:28 +00:00
camc314
f000596edf feat(minifier): minify call expressionsto Number (#8267) 2025-01-06 02:21:28 +00:00
camc314
092aeafdc0 feat(minifier): flatten spread args in call expressions (#8266) 2025-01-06 02:21:27 +00:00
camc314
04ec38dc47 feat(minifier): remove unused arrow function expressions (#8262) 2025-01-06 02:21:26 +00:00
camc314
e446c15619 feat(minifier): improve minimizing unary not expressions (#8261) 2025-01-06 02:21:26 +00:00
camc314
62a2644e07 fix(minifier): handle arrow fn expressions correctly in is_in_boolean_context (#8260)
`var k = () => !!x` was incorrectly being minified to `var k = () => x`
2025-01-06 02:21:25 +00:00
camc314
7f19211736 feat(minifier): minimize unary expression statements (#8256)
`delete` cannot be minified as it may have side effect.
2025-01-06 02:21:24 +00:00
camc314
b6d16f4d80 fix(codegen): print parenthesis on negative bigint lit when neccessary (#8258)
closes #8257

i couldn't really write a test for this, as it only happens when codegen + minifier are used together.

Regression should be prevented by the 262 suite in #8256 (failed CI run before i implemented this fix: https://github.com/oxc-project/oxc/actions/runs/12621310419/job/35168016825)
2025-01-06 02:21:24 +00:00
renovate[bot]
6a97e29c19
chore(deps): update crate-ci/typos action to v1.29.4 (#8265)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [crate-ci/typos](https://redirect.github.com/crate-ci/typos) | action
| minor | `v1.28.3` -> `v1.29.4` |

---

### Release Notes

<details>
<summary>crate-ci/typos (crate-ci/typos)</summary>

###
[`v1.29.4`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.4)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.3...v1.29.4)

#### \[1.29.4] - 2025-01-03

###
[`v1.29.3`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.3)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.2...v1.29.3)

#### \[1.29.3] - 2025-01-02

###
[`v1.29.2`](https://redirect.github.com/crate-ci/typos/compare/v1.29.1...v1.29.2)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.1...v1.29.2)

###
[`v1.29.1`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.1)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.0...v1.29.1)

#### \[1.29.1] - 2025-01-02

##### Fixes

-   Don't correct `deriver`

###
[`v1.29.0`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.0)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.28.4...v1.29.0)

#### \[1.29.0] - 2024-12-31

##### Features

- Updated the dictionary with the [December
2024](https://redirect.github.com/crate-ci/typos/issues/1156) changes

##### Performance

-   Sped up dictionary lookups

###
[`v1.28.4`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.28.4)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.28.3...v1.28.4)

#### \[1.28.4] - 2024-12-16

##### Features

-   `--format sarif` support

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
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.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2025-01-05 22:13:32 +00:00
Boshen
cec63e2119
feat(minifier): {} evals to f64::NaN 2025-01-05 23:09:57 +08:00
Boshen
4d8a08d2ac feat(minifier): improve constant evaluation (#8252) 2025-01-05 12:41:57 +00:00
Boshen
e84f267a39 feat(minifier): compress more property keys (#8253) 2025-01-05 07:20:56 +00:00
camc314
d1224f95ce feat(minifier): improve minimizing conditional expressions (#8251) 2025-01-05 04:14:02 +00:00
camc314
91b42defb5 test(minifier): enable some passing tests (#8250) 2025-01-05 04:14:01 +00:00
camc314
3c534aeb5a refactor(linter): refactor LintBuilder to prep for nested configs (#8034)
More simplification/preparations for nested configurations:

1. renames `LinterBuilder` to `ConfigStoreBuilder`
2. moves the `options` logic out of `LintBuilder`
3. make `ConfigStoreBuilder::build()` return a result (currently always returns OK, but it will return errors when nested config is implemented

The next steps to implement nested config which i hope to do in the next week are:
1. refactor the `from_oxlintrc` to accept a file path
2. introduce a new method on `ConfigStoreBuilder` (name TBC) that walks all child directories, collecting `.oxlintrc` files. these will be put into `ConfigStore` as a hash map of path > config.
2025-01-05 04:08:26 +00:00
Boshen
65f46f5409
feat(minifier): constant fold String.fromCharCode (#8248) 2025-01-04 23:22:32 +08:00
Boshen
0845162372
refactor(minifier): clean up ReplaceKnownMethods 2025-01-04 21:57:20 +08:00
Boshen
bd8d677352 feat(minifier): minimize ~undefined, ~null, ~true, ~false (#8247) 2025-01-04 13:34:53 +00:00
Boshen
f73dc9ea9b
feat(minifier): constant fold 'x'.toString() and true.toString() (#8246) 2025-01-04 21:28:26 +08:00
Boshen
fd5af73a22 feat(minifier): minimize Number constructor (#8245) 2025-01-04 09:56:03 +00:00
Boshen
2f52f333fa feat(minifier): minsize !!!foo ? bar : baz -> foo ? baz : bar (#8244) 2025-01-04 09:10:22 +00:00
Boshen
7c7f5d7af9
refactor(minifier): clean up peephole_fold_constants 2025-01-04 16:57:08 +08:00
Boshen
ce2b5a994b chore(minifier): disable RemoveUnusedCode (#8243)
A lot of edge cases fail in test262 and monitor-oxc.
2025-01-04 08:49:20 +00:00
Boshen
d2f8eaa842 fix(minifier): fix panic in peephole_minimize_conditions (#8242)
https://github.com/oxc-project/monitor-oxc caught some crashes.

Make things safer by returning falling back to true.
2025-01-04 07:56:21 +00:00