-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Labels
C-enhancementCategory - New feature or requestCategory - New feature or request
Description
Background
For keeping compilation speed down for ourselves and our downstream crate users, I have avoided using macros to generate boilerplate code at all cost.
All performance issues (runtime and compilation speed) are considered as bugs in this project.
But due to the amount of AST related supporting code has expanded over the last few months, and our desire to experiment with different ideas with the AST, our current approach of manually updating everything is no longer functional.
The goal of this task is to provide code generation for all AST node related code.
Requirements
- no build.rs published to the user
- all generated code are checked into git
- no nightly
- Rust code residing in
crates/oxc_astshould be the source of truth
Workflow
- a user changes the oxc_ast crate
- a watch change picks it up
- parse all
#[visited_node] - saves them into a model, e.g.
struct ASTModel { name: String, attributes: Vec<Attributes> } - generate code and save file
Code to generate
-
ASTKind(Milestone 1) -
GetSpan(Milestone 2) -
Hash,PartialEqimplementations (Milestone 3) -
ASTBuilder(Milestone 4) -
Visit(Milestone 5) -
VisitMut(Milestone 5) -
Traverse, remove current js code (Milestone 6)
typescript definition for napi and wasmmoving the scope to AST transfer.
Every milestone should be a stack of PRs, since they will involve changing other files as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementCategory - New feature or requestCategory - New feature or request
Type
Fields
Give feedbackPriority
None yet