-
-
Notifications
You must be signed in to change notification settings - Fork 458
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 Milestone 1 #2859
Comments
What happened? What is the present workflow and any obstacles faced? |
Since we currently have no way to access/mutate the ancestor node, this makes it very difficult for us to implement some complex cases. Some cases rely on scopes, and with the current implementation, we don't have access to the scope corresponding to the current AST. Furthermore, any mutations we currently do are not sync semantic. That is, even if we somehow did get access to the scope, its data would be incorrect. Here we are discussing and solving the problems we are facing #2704 |
There wasn't a clear scope and milestone, so we ended up trying everything all at once, which was exhausting. |
Will it be possible to serialize transformed code back to the TypeScript? It would be very helpful for the new version of my TypeScript runtime reflection I'm building. To support as much build/bundle tools as possible I have to do TS to TS transforms so I don't have to implement whole system for each of them. Performance is critical so I'd like to use OXC bcs you do good job guys. 👍 |
@Hookyns Please could you open a separate issue for this? If we are able to support such a feature, it won't be part of this milestone - the content of which is listed above. |
Milestone 1 is done. Will brainstorm for milestone 2 when we have gathered the requirements. |
@Hookyns I don't know if you did open another issue in the end, but just to let you know, |
Call for help
This is a call for help; we need assistance from experts who are proficient in Babel and Rust to help us achieve the fastest and most feature-complete JavaScript transformer. The contributor need to adhere to the project rules outlined at https://oxc-project.github.io/docs/contribute/rules.html.
Background
When I prototyped and created the current transformer (https://github.com/oxc-project/oxc/tree/main/crates/oxc_transformer), I was working alone and porting Babel without planning ahead. The result was a dead end - @Dunqing and I became stuck and burned out.
Fortunately, @milesj and @rzvxa showed up and offered help. After some consideration and discussion, we (@Boshen, @Dunqing, @milesj, and @rzvxa) formed a working group to tackle the transformer together.
Restart from scratch
Although we have a significant amount of code in https://github.com/oxc-project/oxc/tree/main/crates/oxc_transformer, with 320 out of 1415 tests passing (as indicated in https://github.com/oxc-project/oxc/blob/main/tasks/transform_conformance/babel.snap.md), let's proceed as if none of this code exists. This will allow us to restart with shared knowledge within the working group.
Milestone 1
The first milestone is to complete
@babel/preset-react
and@babel/preset-typescript
so that tools can transform.jsx
and.ts(x)
files to the latest ECMAScript version.Here's the plan:
The text was updated successfully, but these errors were encountered: