Commit graph

25 commits

Author SHA1 Message Date
github-actions[bot]
1b3cd6c24d
Release crates v0.15.0 (#3743)
## [0.15.0] - 2024-06-18

- 0537d29 cfg: [**BREAKING**] Move control flow to its own crate.
(#3728) (rzvxa)

- 5c38a0f codegen: [**BREAKING**] New code gen API (#3740) (Boshen)

- 4bce59d semantic/cfg: [**BREAKING**] Re-export `petgraph` as
`control_flow::graph`. (#3722) (rzvxa)

- 534242a codegen: [**BREAKING**] Remove
`CodegenOptions::enable_typescript` (#3674) (Boshen)

- 0578ece ast: [**BREAKING**] Remove
`ExportDefaultDeclarationKind::TSEnumDeclaration` (#3666) (Dunqing)

### Features

- 5a99d30 codegen: Improve codegen formatting (#3735) (Boshen)
- bf9b38a codegen: Improve codegen formatting (#3731) (Boshen)
- 4a004e2 codegen: Print TSImport remaining fields (#3695) (Dunqing)
- a56cb1b codegen: Print accessibility for MethodDefinition (#3690)
(Dunqing)
- 38a75e5 coverage: Improve codegen (#3729) (Boshen)
- 750a534 coverage: Transformer idempotency test (#3691) (Boshen)
- ee627c3 isolated-declarations: Create unique name for `_default`
(#3730) (Dunqing)
- 81e9526 isolated-declarations: Inferring set accessor parameter type
from get accessor return type (#3725) (Dunqing)
- 77d5533 isolated-declarations: Report errors that are consistent with
typescript. (#3720) (Dunqing)
- 8f5655d linter: Add eslint/no-useless-constructor (#3594) (Don Isaac)
- 046ff3f linter/eslint: Add `no_unreachable` rule. (#3238) (rzvxa)
- 0b8098a napi: Isolated-declaration (#3718) (Boshen)
- 527bfc8 npm/oxc-transform: Setup npm/oxc-transform and publish
(Boshen)
- d65c652 parser: Display jsx mismatch error, e.g. `<Foo></Bar>` (#3696)
(Boshen)
- 9c31ed9 semantic/cfg: Propagate unreachable edges through subgraphs.
(#3648) (rzvxa)
- d9c5b33 semantic/cfg: Add `Condition` instruction. (#3567) (Ali
Rezvani)
- f2dfd66 semantic/cfg: Add iteration instructions. (#3566) (rzvxa)
- 910193e transformer-dts: Report error for super class (#3711)
(Dunqing)
- 413d7be transformer-dts: Transform enum support (#3710) (Dunqing)
- 35c382e transformer-dts: Remove type annotation from private field
(#3689) (Dunqing)
- 0e6d3ce transformer-dts: Report error for async function and generator
(#3688) (Dunqing)
- b22b59a transformer-dts: Transform namespace support (#3683) (Dunqing)
- 4f2db46 transformer-dts: `--isolatedDeclarations` dts transform
(#3664) (Dunqing)

### Bug Fixes

- 2158268 ast: Incorrect visit order in function (#3681) (Dunqing)
- da1e2d0 codegen: Improve typescript codegen (#3708) (Boshen)
- f1b793f isolated-declarations: Function overloads reaching unreachable
(#3739) (Dunqing)
- 0fbecdc isolated-declarations: Should be added to references, not
bindings (#3726) (Dunqing)
- 8f64d99 minifier: Respect `join_vars: false` option (#3724)
(mysteryven)
- 70fc69b semantic: Add Eq to CtxFlags (#3651) (Yuji Sugiura)
- 7a58fec semantic/cfg: Issue in unlabeled `Ctx`s. (#3678) (rzvxa)
- abd6ac8 semantic/cfg: Discrete finalization path after `NewFunction`s.
(#3671) (rzvxa)
- e148a32 semantic/cfg: Correct unreachability propagation in
try-finally. (#3667) (Ali Rezvani)
- 59666e0 transformer: Do not rename accessible identifier references
(#3623) (Dunqing)
- 90743e2 traverse: Change visit order for `Function` (#3685)
(overlookmotel)

### Performance

- 2717a1a semantic/cfg: Lower the visits in
`neighbors_filtered_by_edge_weight`. (#3676) (rzvxa)

### Refactor

- fa7a6ba codegen: Add `gen` method to ast nodes (#3687) (Boshen)
- 09b92b6 codegen: Move `gen_ts` into `gen` to make searching things
easier (#3680) (Boshen)
- 3c59735 isolated-declarations: Remove `TransformDtsCtx` (#3719)
(Boshen)
- 815260e isolated-declarations: Decouple codegen (#3715) (Boshen)
- 7ec44f8 semantic: Rename `cfg` macro to `control_flow`. (#3742)
(rzvxa)
- d8ad321 semantic: Make control flow generation optional. (#3737)
(rzvxa)
- a94a72d semantic: Expose 1 checker function instead of 2 (#3694)
(Boshen)
- bd8d115 semantic/cfg: Remove unused types. (#3677) (rzvxa)
- f702fb9 semantic/cfg: Cleanup control flow and it's builder. (#3650)
(rzvxa)
- 4f16664 transformer_dts: Create a `Program` for codegen (#3679)
(Boshen)

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-19 01:15:55 +08:00
Boshen
051ceb6539
chore: improve some format by running cargo +nightly fmt 2024-06-19 00:48:30 +08:00
github-actions[bot]
95e0571c2e
Release crates v0.14.0 (#3643)
## [0.14.0] - 2024-06-12

### Breaking

* fix(codegen)!: remove the unecessary 4th argument from `Codegen::new`
(#3640)
* feat(ast)!: make `Trivias` clonable by adding `Arc` (#3638)

### Features

- f6d9ca6 linter: Add `eslint/sort-imports` rule (#3568) (Wang Wenzhe)
- 129f91e span: Port over more methods from TextRange (#3592) (Don
Isaac)

### Bug Fixes

- f8f6d33 ast: Correct `visited_node` attr for strict mode of arrow fns
(#3635) (overlookmotel)
- e6ad3fb diagnostics: Do not print ansi color codes in non-TTYs (#3624)
(Boshen)
- d65202d span: Correct doc comments (#3608) (overlookmotel)
- 35e267b transformer: Arrow function transform use UIDs for `_this`
vars (#3634) (overlookmotel)
- 39bdebc transformer: Arrow func transform maintain scope ID (#3633)
(overlookmotel)
- 5cb7e6a transformer: Arrow func transform use correct spans (#3630)
(overlookmotel)
- 0c4ccb4 transformer: Arrow function transform alter `</this>` (#3627)
(overlookmotel)
- 8d237c4 transformer: JSX source calculate correct column when Unicode
chars (#3615) (overlookmotel)
- 9e8f4d6 transformer: Do not add `__source` for generated nodes (#3614)
(overlookmotel)
- 0fb4c35 transformer: Use UID for JSX source filename var (#3612)
(overlookmotel)

### Performance

- 3a59294 transformer: React display name transform reduce Atom
allocations (#3616) (overlookmotel)
- f4c1389 transformer: Create `Vec` with capacity (#3613)
(overlookmotel)

### Refactor

- 0f92521 ast: Replace recursion with loop (#3626) (overlookmotel)
- 08f1010 ast: Make `AstBuilder` `Copy` (#3602) (overlookmotel)
- 84304b4 linter: Add a `ctx.module_record()` method (#3637) (Boshen)
- f98f777 linter: Add rule fixer (#3589) (Don Isaac)
- e90e6a2 minifier: Make `Prepass` `Copy` (#3603) (overlookmotel)
- 7d61832 semantic: Pass `Rc` by value (#3586) (overlookmotel)
- 89bcbd5 transformer: Move `BoundIdentifier` into helpers (#3610)
(overlookmotel)
- 5793ff1 transformer: Replace `&’a Trivias` with `Rc<Trivias>` (#3580)
(Dunqing)
- 509871f transformer: Comment for unimplemented `spec` option in arrow
fns transform (#3618) (overlookmotel)
- 4b2e3a7 transformer: Fix indentation (#3617) (overlookmotel)
- 3467e3d transformer: Remove outdated comment (#3606) (overlookmotel)
- a799225 transformer: Flatten file structure for React transform
(#3604) (overlookmotel)
- 70f31a8 transformer: Reduce branching in JSX transform (#3596)
(overlookmotel)
- 3ae567d transformer: Remove dead code (#3588) (overlookmotel)
- 60cbdec traverse: `generate_uid_in_root_scope` method (#3611)
(overlookmotel)

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-12 17:52:41 +08:00
github-actions[bot]
6bdd74c476
Release crates v0.13.5 (#3584)
## [0.13.5] - 2024-06-08

### Bug Fixes

- 48bb97e traverse: Do not publish the build script (Boshen)

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-08 16:44:50 +08:00
github-actions[bot]
d215e3d906
Release crates v0.13.4 (#3582)
## [0.13.4] - 2024-06-07

### Features

- 5c8e16c coverage: Second transformer build does not print typescript
(#3561) (Dunqing)
- 646b993 coverage/transformer: Handle @jsx option (#3553) (Dunqing)
- a939ddd transformer/typescript: Remove more typescript ast nodes
(#3563) (Dunqing)
- e8a20f8 transformer/typescript: Remove typescript ast nodes (#3559)
(Dunqing)
- ee9a215 transformer/typescript: Handle namespace directive correctly
(#3532) (Dunqing)

### Bug Fixes

- affb2c8 codegen: Print indentation before directive (#3512) (Dunqing)
- f6939cb transformer: Store `react_importer` in `Bindings` in JSX
transform (#3551) (overlookmotel)
- 7982b93 transformer: Correct spans for JSX transform (#3549)
(overlookmotel)
- c00598b transformer: JSX set `reference_id` on refs to imports (#3524)
(overlookmotel)

### Performance

- 37cdc13 transformer: Faster checks if JSX plugin enabled (#3577)
(overlookmotel)
- 9f467b8 transformer: Avoid fragment update where possible (#3535)
(overlookmotel)
- ac394f0 transformer: JSX parse pragma only once (#3534)
(overlookmotel)

### Documentation

- 1d3c0d7 span: Add doc comments to `oxc_span::Span` (#3543) (Don Isaac)

### Refactor

- f2113ae transformer: Reduce cloning and referencing `Rc`s (#3576)
(overlookmotel)
- 0948124 transformer: Pass `Rc`s by value (#3550) (overlookmotel)
- e4d74ac transformer: Remove `update_fragment` from JSX transform
(#3541) (overlookmotel)
- 73b7864 transformer: Combine import and usage in JSX transform (#3540)
(overlookmotel)
- 6978269 transformer/typescript: Replace reference collector with
symbols references (#3533) (Dunqing)

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-07 17:41:11 +08:00
Boshen
1dbc23417d
chore: regenerate changelogs with commit id and author 2024-06-07 01:22:28 +08:00
Boshen
769227b7b4
chore: regenerate changelogs 2024-06-06 15:51:53 +08:00
Boshen
0674604d7a
chore: regenerate changelog 2024-06-06 01:29:38 +08:00
Boshen
dd42f279f7
chore: change website url to https://oxc.rs 2024-06-05 22:05:08 +08:00
github-actions[bot]
d48e62aca4
Publish crates v0.13.3 (#3527)
Automated Release

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-04 18:02:40 +08:00
renovate[bot]
4386eb3d68
chore(deps): lock file maintenance npm packages (#3421)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change | Age | Adoption | Passing |
Confidence |
|---|---|---|---|---|---|---|---|
|  |  | lockFileMaintenance | All locks refreshed |  |  |  |  |
| [axios](https://axios-http.com)
([source](https://togithub.com/axios/axios)) | devDependencies | patch |
[`1.7.0` ->
`1.7.2`](https://renovatebot.com/diffs/npm/axios/1.7.0/1.7.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/axios/1.7.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/axios/1.7.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/axios/1.7.0/1.7.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/axios/1.7.0/1.7.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [pnpm](https://pnpm.io) ([source](https://togithub.com/pnpm/pnpm)) |
packageManager | patch | [`9.1.1` ->
`9.1.2`](https://renovatebot.com/diffs/npm/pnpm/9.1.1/9.1.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/pnpm/9.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pnpm/9.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pnpm/9.1.1/9.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pnpm/9.1.1/9.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Release Notes

<details>
<summary>axios/axios (axios)</summary>

###
[`v1.7.2`](https://togithub.com/axios/axios/blob/HEAD/CHANGELOG.md#172-2024-05-21)

[Compare
Source](https://togithub.com/axios/axios/compare/v1.7.1...v1.7.2)

##### Bug Fixes

- **fetch:** enhance fetch API detection;
([#&#8203;6413](https://togithub.com/axios/axios/issues/6413))
([4f79aef](4f79aef81b))

##### Contributors to this release

- <img
src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [Dmitriy
Mozgovoy](https://togithub.com/DigitalBrainJS "+3/-3 (#&#8203;6413 )")

###
[`v1.7.1`](https://togithub.com/axios/axios/blob/HEAD/CHANGELOG.md#171-2024-05-20)

[Compare
Source](https://togithub.com/axios/axios/compare/v1.7.0...v1.7.1)

##### Bug Fixes

- **fetch:** fixed ReferenceError issue when TextEncoder is not
available in the environment;
([#&#8203;6410](https://togithub.com/axios/axios/issues/6410))
([733f15f](733f15fe5b))

##### Contributors to this release

- <img
src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [Dmitriy
Mozgovoy](https://togithub.com/DigitalBrainJS "+14/-9 (#&#8203;6410 )")

</details>

<details>
<summary>pnpm/pnpm (pnpm)</summary>

### [`v9.1.2`](https://togithub.com/pnpm/pnpm/releases/tag/v9.1.2)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.1.1...v9.1.2)

#### Patch Changes

- Reduced memory usage during peer dependencies resolution
[#&#8203;8084](https://togithub.com/pnpm/pnpm/pull/8084).
- Details in the `pnpm licenses` output are not misplaced anymore
[#&#8203;8071](https://togithub.com/pnpm/pnpm/pull/8071).

#### Platinum Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a href="https://bit.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank"><img src="https://pnpm.io/img/users/bit.svg"
width="80"></a>
      </td>
      <td align="center" valign="middle">
<a href="https://figma.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank"><img src="https://pnpm.io/img/users/figma.svg"
width="80"></a>
      </td>
    </tr>
  </tbody>
</table>

#### Gold Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a href="https://discord.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/discord.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/discord_light.svg" />
<img src="https://pnpm.io/img/users/discord.svg" width="220" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://prisma.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/prisma.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/prisma_light.svg" />
<img src="https://pnpm.io/img/users/prisma.svg" width="180" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://uscreen.de/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/uscreen.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/uscreen_light.svg" />
<img src="https://pnpm.io/img/users/uscreen.svg" width="180" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://www.jetbrains.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/jetbrains.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/jetbrains.svg" />
<img src="https://pnpm.io/img/users/jetbrains.svg" width="85" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/nx.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/nx_light.svg" />
            <img src="https://pnpm.io/img/users/nx.svg" width="120" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/coderabbit.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/coderabbit_light.svg" />
<img src="https://pnpm.io/img/users/coderabbit.svg" width="220" />
          </picture>
        </a>
      </td>
    </tr>
  </tbody>
</table>

#### Our Silver Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a
href="https://leniolabs.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <img src="https://pnpm.io/img/users/leniolabs.jpg" width="80">
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://vercel.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/vercel.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/vercel_light.svg" />
<img src="https://pnpm.io/img/users/vercel.svg" width="180" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://depot.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/depot.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/depot_light.svg" />
<img src="https://pnpm.io/img/users/depot.svg" width="200" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://moonrepo.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/moonrepo.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/moonrepo_light.svg" />
<img src="https://pnpm.io/img/users/moonrepo.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://devowl.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/devowlio.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/devowlio.svg" />
<img src="https://pnpm.io/img/users/devowlio.svg" width="200" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://macpaw.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/macpaw.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/macpaw_light.svg" />
<img src="https://pnpm.io/img/users/macpaw.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://cerbos.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/cerbos.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/cerbos_light.svg" />
<img src="https://pnpm.io/img/users/cerbos.svg" width="180" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://vpsserver.com/en-us/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
<img src="https://pnpm.io/img/users/vpsserver.svg" width="180" />
        </a>
      </td>
    </tr>
  </tbody>
</table>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

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

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-26 18:29:48 +00:00
Boshen
2064ae9e0a refactor(parser,diagnostic): one diagnostic struct to eliminate monomorphization of generic types (#3214)
part of #3213

We should only have one diagnostic struct instead 353 copies of them, so we don't end up choking LLVM with 50k lines of the same code due to monomorphization.

If the proposed approach is good, then I'll start writing a codemod to turn all the existing structs to plain functions.

---

Background:

Using `--timings`, we see `oxc_linter` is slow on codegen (the purple part).

![image](https://github.com/zkat/miette/assets/1430279/c1df4f7d-90ef-4c0f-9956-2ec3194db7ca)

The crate currently contains 353 miette errors. [cargo-llvm-lines](https://github.com/dtolnay/cargo-llvm-lines) displays

```
cargo llvm-lines -p oxc_linter --lib --release

  Lines                 Copies               Function name
  -----                 ------               -------------
  830350                33438                (TOTAL)
   29252 (3.5%,  3.5%)    808 (2.4%,  2.4%)  <alloc::boxed::Box<T,A> as core::ops::drop::Drop>::drop
   23298 (2.8%,  6.3%)    353 (1.1%,  3.5%)  miette::eyreish::error::object_downcast
   19062 (2.3%,  8.6%)    706 (2.1%,  5.6%)  core::error::Error::type_id
   12610 (1.5%, 10.1%)     65 (0.2%,  5.8%)  alloc::raw_vec::RawVec<T,A>::grow_amortized
   12002 (1.4%, 11.6%)    706 (2.1%,  7.9%)  miette::eyreish::ptr::Own<T>::boxed
    9215 (1.1%, 12.7%)    115 (0.3%,  8.2%)  core::iter::traits::iterator::Iterator::try_fold
    9150 (1.1%, 13.8%)      1 (0.0%,  8.2%)  oxc_linter::rules::RuleEnum::read_json
    8825 (1.1%, 14.9%)    353 (1.1%,  9.3%)  <miette::eyreish::error::ErrorImpl<E> as core::error::Error>::source
    8822 (1.1%, 15.9%)    353 (1.1%, 10.3%)  miette::eyreish::error::<impl miette::eyreish::Report>::construct
    8119 (1.0%, 16.9%)    353 (1.1%, 11.4%)  miette::eyreish::error::object_ref
    8119 (1.0%, 17.9%)    353 (1.1%, 12.5%)  miette::eyreish::error::object_ref_stderr
    7413 (0.9%, 18.8%)    353 (1.1%, 13.5%)  <miette::eyreish::error::ErrorImpl<E> as core::fmt::Display>::fmt
    7413 (0.9%, 19.7%)    353 (1.1%, 14.6%)  miette::eyreish::ptr::Own<T>::new
    6669 (0.8%, 20.5%)     39 (0.1%, 14.7%)  alloc::raw_vec::RawVec<T,A>::try_allocate_in
    6173 (0.7%, 21.2%)    353 (1.1%, 15.7%)  miette::eyreish::error::<impl miette::eyreish::Report>::from_std
    6027 (0.7%, 21.9%)     70 (0.2%, 16.0%)  <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
    6001 (0.7%, 22.7%)    353 (1.1%, 17.0%)  miette::eyreish::error::object_drop
    6001 (0.7%, 23.4%)    353 (1.1%, 18.1%)  miette::eyreish::error::object_drop_front
    5648 (0.7%, 24.1%)    353 (1.1%, 19.1%)  <miette::eyreish::error::ErrorImpl<E> as core::fmt::Debug>::fmt
```

It's totalling more than 50k llvm lines, and is putting pressure on rustc codegen (the purple part on `oxc_linter` in the image above.

---

It's pretty obvious by looking at https://github.com/zkat/miette/blob/main/src/eyreish/error.rs, the generics can expand out to lots of code.
2024-05-11 04:56:22 +00:00
Boshen
79837bd410
Release @oxc-parser/wasm v0.1.0 2024-04-08 15:47:51 +08:00
Boshen
ab26099281
Publish @oxc-parser/wasm with web and node builds (#2916)
Co-authored-by: Saeid Zareie <saeid.za98@gmail.com>
2024-04-08 15:47:02 +08:00
renovate[bot]
e76d70ffbf
chore(deps): lock file maintenance (#2880) 2024-04-01 11:43:44 +08:00
overlookmotel
75226f3b4a
chore: silence erroneous RA warnings for Tsify (#2731) 2024-03-15 12:42:12 +00:00
Boshen
945265a33e
chore: format wasm/parser/Cargo.toml 2024-03-14 17:25:53 +08:00
Boshen
697b6b70c0
feat: merge features serde and wasm to serialize (#2716)
This PR merges the previous confusing features `serde` and `wasm` into a
single `serialize` feature.

We'll eventually do serialize + type information for both wasm and napi
targets.

`oxc_macros` is removed from `oxc_ast`'s dependency because it requires
`syn` and friends, which goes against our policy ["Third-party
dependencies should be
minimal."](https://oxc-project.github.io/docs/contribute/rules.html#development-policy)
2024-03-14 17:13:12 +08:00
Boshen
d9bea520ea
Release @oxc-parser/wasm v0.0.5 2024-02-05 21:10:11 +08:00
Boshen
63dbac764f
chore(wasm): remove console_error_panic_hook
We don't really need it.
2024-02-02 17:02:01 +08:00
Boshen
bd23c3a058
Release @oxc-parser/wasm v0.0.4 2024-01-31 15:56:04 +08:00
Boshen
9c6c17b9aa
feat(wasm/parser): improve FFI (#2232) 2024-01-31 15:53:32 +08:00
Boshen
018675ceb1
Release @oxc-parser/wasm v0.0.3 2024-01-30 21:57:46 +08:00
Boshen
b2894c6a38
Release @oxc-parser/wasm v0.0.2 2024-01-30 21:43:41 +08:00
Boshen
5ac61f09a0
feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00