oxc-project / backlog

backlog for collborators only
1 stars 0 forks source link

ast: AstBuilder methods without typescript syntax #111

Open Boshen opened 2 months ago

Boshen commented 2 months ago

@RiESAEX: Could we add another set of method to AstBuilder that don’t need TSType as input? I assume they’re mostly None in the transformer.

@overlookmotel: We could put a #[ts] attr on all TS-related fields, and then oxc_ast_tools could generate "plain" methods for all types which have TS fields

overlookmotel commented 1 month ago

#[ts]-annotated fields would also be useful for speeding up getting ASTs across into JS (either via AST transfer, or with serde). Where the source is plain JS, there's no reason to create loads of fields in the JSON which are always null.

We could use oxc_ast_tools to generate Serialize impls for all AST types which skip TS fields when source type is plain JS. AST transfer can do the same too.