vpx: support ECMAScript decorators after upstream Oxc support lands

未關閉
#3,292 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@fengmk2 已經在處理了。

開始於 2026年10月30日。

評估

這個 Issue 還沒有評估資料。

描述

vpx currently supports legacy decorators with "experimentalDecorators": true, including emitDecoratorMetadata. Standard ECMAScript decorators and accessor fields remain unsupported, leaving a compatibility gap for scripts moving from tsx.

Oxc’s Q4 plan includes implementing and stabilizing ECMAScript decorators. This issue tracks their adoption in the Vite+ script loader once upstream support is available.

With experimentalDecorators omitted or false, this script should run successfully:

function report(_value: Function, context: ClassDecoratorContext) {
  console.log(context.kind, context.name);
}

@report
class Example {}

Both commands should print class Example:

vpx ./decorators.ts
node --import vite-plus/register ./decorators.ts

Follow-up work:

  • Link the upstream implementation and first supported release. Update the compatible Oxc, vendored oxc-node, and @oxc-project/runtime versions.
  • Update oxc-node to enable the standard decorator transform and replace its current rejection. Verify any required class transformations and runtime helpers.
  • Preserve legacy behavior when experimentalDecorators is true, including existing metadata support. Keep standard decorators distinct from legacy emitDecoratorMetadata, as described in the TypeScript documentation.
  • Verify decorated and undecorated auto-accessors explicitly. Track any remaining upstream limitation before claiming full support.
  • Add snapshots with visible runtime output for local/global vpx and vite-plus/register, covering ESM/CommonJS, both loader hook modes, decorator initialization order, and helper resolution. Replace the existing unsupported-decorator failure case and retain legacy regression coverage.
  • Add a real tsx → vpx migration snapshot that compares decorator behavior before and after migration.
  • Update the supported-syntax documentation, experimentalDecorators defaults, migration notes, and RFC compatibility table.

Keep this issue open until support is integrated, tested, and released in Vite+. Completion of the upstream roadmap item alone does not complete this follow-up.

Related: #1556 — Auto-accessor syntax is not transpiled, which concerns the browser development pipeline.

主要語言
Rust
星號
6.5k
分支
297
平均合併
23 小時 42 分鐘
30 天內合併 PR
233

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

voidzero-dev/vite-plus 的其他 Issue

查看 voidzero-dev/vite-plus 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。