oxc/crates
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
..
oxc Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_allocator Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_ast fix(ast, codegen, linter): panics in fixers. (#5431) 2024-09-05 05:59:22 +00:00
oxc_ast_macros refactor(ast): simplify ContentEq trait definition. (#5468) 2024-09-05 05:36:51 +00:00
oxc_cfg Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_codegen fix(ast, codegen, linter): panics in fixers. (#5431) 2024-09-05 05:59:22 +00:00
oxc_diagnostics feat(oxc_diagnostic): impl DerefMut for OxcDiagnostic (#5474) 2024-09-05 08:55:52 +00:00
oxc_index feat(index): impl rayon related to trait for IndexVec (#5421) 2024-09-03 12:01:57 +00:00
oxc_isolated_declarations Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_language_server refactor(parser)!: remove builder pattern from Parser struct (#5000) 2024-08-20 07:40:25 +00:00
oxc_linter fix(ast, codegen, linter): panics in fixers. (#5431) 2024-09-05 05:59:22 +00:00
oxc_macros chore(linter): update docs for declare_oxc_lint! (#4825) 2024-08-11 15:27:54 +00:00
oxc_mangler Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_minifier feat(minifier): remove parenthesized expression for dce (#5439) 2024-09-04 12:58:39 +00:00
oxc_module_lexer Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_parser feat(ast)!: add ThisExpression variants to JSXElementName and JSXMemberExpressionObject (#5466) 2024-09-05 02:06:20 +00:00
oxc_prettier fix(ast, codegen, linter): panics in fixers. (#5431) 2024-09-05 05:59:22 +00:00
oxc_regular_expression fix(regex): panic on displaying surrogated UnicodeEscape characters. (#5469) 2024-09-05 06:18:11 +00:00
oxc_semantic refactor(semantic): change the reference flag to ReferenceFlags::Type if it is used within a TSTypeQuery (#5444) 2024-09-05 01:50:20 +00:00
oxc_sourcemap Release crates v0.26.0 (#5418) 2024-09-03 10:36:02 +08:00
oxc_span refactor(ast): simplify ContentEq trait definition. (#5468) 2024-09-05 05:36:51 +00:00
oxc_syntax refactor(ast, ast_tools): use full method path for generated derives trait calls. (#5462) 2024-09-05 05:36:50 +00:00
oxc_transformer feat(transformer): support all /regex/ to new RegExp transforms (#5387) 2024-09-05 11:04:45 +00:00
oxc_traverse feat(ast)!: add ThisExpression variants to JSXElementName and JSXMemberExpressionObject (#5466) 2024-09-05 02:06:20 +00:00
oxc_wasm feat(wasm): turn on all transform options 2024-09-01 00:24:10 +08:00