oxc-project / oxc

⚓ A collection of JavaScript tools written in Rust.

Home Page:https://oxc.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

☂️ Transpiler / Transformer

Boshen opened this issue · comments

Contribution Instructions

The implementation is in crates/oxc_transformer.

To get started, take a look at the previous implementations.

The integrations tests are located in tasks/transform_conformance/src/lib.rs,
Run it with just watch 'run -p oxc_transform_conformance' or with a filter just watch "run -p oxc_transform_conformance -- --filter type-arguments".


Tasks

  • #979
  • #1001
  • #999
  • Fix transformer benchmark because it is transforming the already transformed AST #998

Third Party Plugins

Feature list

Legend:

  • [Syntax] means this is a syntax plugin, no code is required because it is supported by the parser.
  • [Regex] means this is a regex transform, which is not supported.
  • [Codegen] means the code generator is responsible for the feature.

@babel/preset-react

  • @babel/plugin-transform-react-jsx

@babel/preset-typescript

  • @babel/plugin-transform-typescript

@babel/preset-env

ES2024

  • [Regex] unicode-sets-regex

ES2023

Does not have any features.

ES2022

  • class-properties
  • class-static-block #962
  • private-methods
  • private-property-in-object
  • [Syntax] syntax-top-level-await

ES2021

  • logical-assignment-operators #923
  • [Syntax] numeric-separator

ES2020

  • dynamic-import
  • export-namespace-from
  • nullish-coalescing-operator #1004
  • optional-chaining
  • [Syntax] syntax-bigint
  • [Syntax] syntax-dynamic-import
  • [Syntax] syntax-import-meta

ES2019

  • optional-catch-binding
  • [Codegen] json-strings

ES2018

  • async-generator-functions
  • object-rest-spread
  • [Regex] unicode-property-regex
  • [Regex] dotall-regex
  • [Regex] named-capturing-groups-regex

ES2017

  • async-to-generator

ES2016

  • exponentiation-operator #996

ES2015

  • arrow-functions
  • block-scoping
  • classes
  • computed-properties
  • destructuring
  • duplicate-keys
  • for-of
  • function-name
  • instanceof
  • literals
  • new-target
  • object-super
  • parameters
  • shorthand-properties #960
  • spread
  • sticky-regex #968
  • template-literals
  • typeof-symbol
  • [Regex] unicode-escapes
  • [Regex] unicode-regex

I'm going to start with https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-nullish-coalescing-operator/src/index.ts, which is simple but requires adding new variables to the scope.

@Boshen Is there any reason why some of these parts aren't checked while having an implementation in the transformer? If it is simply outdated let me know to take over it and keep it in sync with our progress.

Closing in favor of the redo in #2859