Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☂️ transformer: ES2024 - ES2016 #4754

Open
23 of 31 tasks
Boshen opened this issue Aug 8, 2024 · 6 comments
Open
23 of 31 tasks

☂️ transformer: ES2024 - ES2016 #4754

Boshen opened this issue Aug 8, 2024 · 6 comments
Assignees
Labels
A-transformer Area - Transformer / Transpiler

Comments

@Boshen
Copy link
Member

Boshen commented Aug 8, 2024

Need to implement babel plugins equivalent of

2024 features

2023 features

  • Hashbang (syntax)

2022 features

2021 features

2020 features

2019 features

2018 features

2017 features

2016 features


Regex Features

See https://esbuild.github.io/content-types/#javascript #5387

Unsupported regular expression literals are transformed into a new RegExp() constructor call so you can bring your own polyfill library to get them to work anyway.

@Boshen Boshen added the A-transformer Area - Transformer / Transpiler label Aug 8, 2024
@Boshen Boshen added this to the Transformer Milestone 2 milestone Aug 8, 2024
@DonIsaac DonIsaac added the good first issue Experience Level - Good for newcomers label Aug 10, 2024
@Boshen Boshen removed the good first issue Experience Level - Good for newcomers label Aug 11, 2024
@Boshen
Copy link
Member Author

Boshen commented Aug 11, 2024

This is not a good first issue yet.

@DonIsaac
Copy link
Contributor

Can we add CJS to this list too? I need this for oxc-jest.

@Boshen
Copy link
Member Author

Boshen commented Aug 12, 2024

Can we add CJS to this list too? I need this for oxc-jest.

CJS is in the milestone https://github.com/oxc-project/oxc/milestone/6

@Boshen
Copy link
Member Author

Boshen commented Aug 12, 2024

The list is not that bad actually, we end up with a few groups:

  • regex features - transform to regex constructor
  • class stuff - ClassXXX
  • syntax sugars
  • Async Generator
  • Async Await

Dunqing added a commit that referenced this issue Aug 15, 2024
part of #4754

The implementation copy from the original implementation which removed in #2865.
Dunqing added a commit that referenced this issue Aug 15, 2024
part of #4754

The implementation copy from the original implementation which removed in #2865.
overlookmotel pushed a commit that referenced this issue Sep 5, 2024
)

related: #4754

The implementation port from [esbuild](https://github.com/evanw/esbuild/blob/332727499e62315cff4ecaff9fa8b86336555e46/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
@7086cmd

This comment was marked as outdated.

@overlookmotel
Copy link
Contributor

overlookmotel commented Oct 16, 2024

We had OptionalChain ticked off the list as done. But actually it's not done yet!

ObjectRestSpread was also ticked off, but we've only done half of it.

😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler
Projects
None yet
Development

No branches or pull requests

5 participants