oxc/tasks/transform_conformance
Dunqing c59d8b3c9b feat(transformer): support all /regex/ to new RegExp transforms (#5387)
related: #4754

The implementation port from [esbuild](332727499e/internal/js_parser/js_parser.go (L12820-L12840)). And cover all babel's regexp plugins

---

## The following description was generated by `Graphite` 😋

### TL;DR

Added support for transforming various RegExp features to ensure compatibility with older JavaScript environments.

### What changed?

- Implemented a new `RegExp` transformer to handle unsupported RegExp literal features
- Added options to control different RegExp transformations (e.g., sticky flag, unicode flag, dot-all flag, etc.)
- Updated the transformer to convert unsupported RegExp literals into `new RegExp()` constructor calls
- Added test cases for different RegExp transformations
- Integrated the new RegExp transformer into the existing transformation pipeline

### How to test?

1. Run the existing test suite to ensure no regressions
2. Execute the new RegExp-specific tests in the `tasks/transform_conformance/tests/esbuild-tests/test/fixtures/regexp/` directory
3. Try transforming code with various RegExp features using different target environments to verify correct transformations
2024-09-05 11:04:45 +00:00
..
src feat(transformer): support all /regex/ to new RegExp transforms (#5387) 2024-09-05 11:04:45 +00:00
tests feat(transformer): support all /regex/ to new RegExp transforms (#5387) 2024-09-05 11:04:45 +00:00
babel.snap.md feat(ast)!: add ThisExpression variants to JSXElementName and JSXMemberExpressionObject (#5466) 2024-09-05 02:06:20 +00:00
babel_exec.snap.md chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
Cargo.toml refactor(transform_conformance): add driver (#4969) 2024-08-19 07:27:39 +00:00
oxc.snap.md feat(transformer): support all /regex/ to new RegExp transforms (#5387) 2024-09-05 11:04:45 +00:00
oxc_exec.snap.md chore: update test262 / babel / typescript submodules (#5369) 2024-08-31 12:28:25 +00:00
README.md
typescript.snap.md chore: remove trailing whitespaces for all files; add .editorconfig (#3639) 2024-06-12 15:47:26 +08:00

Transformation Conformance Test Runner

Execution

This test runner uses the transformation plugin test suite from the babel repository.

The failing test cases are listed in ./babel.snap.md

To get started, run

cargo run -p oxc_transform_conformance

or watch for changes

just watch 'run -p oxc_transform_conformance'

Options

--filter

To filter for a specific test case, apply the --filter path option, e.g.

cargo run -p oxc_transform_conformance -- --filter react/arrow-functions

--exec

The babel test suite contains many exec.js files, they need to be executed by a runtime.

Bun is the preferred way to execute these tests, which you may install them via https://bun.sh/docs/installation.

Once bun is installed, apply the --exec flag:

cargo run -p oxc_transform_conformance -- --exec

The failing test cases are listed in ./babel_exec.snap.md.