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

ast: AstBuilder methods without typescript syntax #111

Open
Boshen opened this issue Sep 10, 2024 · 1 comment
Open

ast: AstBuilder methods without typescript syntax #111

Boshen opened this issue Sep 10, 2024 · 1 comment

Comments

@Boshen
Copy link
Member

Boshen commented Sep 10, 2024

@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

@Boshen Boshen transferred this issue from oxc-project/oxc Sep 11, 2024
@overlookmotel
Copy link

overlookmotel commented Sep 12, 2024

#[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants