Skip to content

feat(ast_tools): introduce #[js_only] attr for struct fields and converters#11160

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters
May 19, 2025
Merged

feat(ast_tools): introduce #[js_only] attr for struct fields and converters#11160
graphite-app[bot] merged 1 commit intomainfrom
05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 19, 2025

Codegen for ESTree impls supports a #[ts] attribute on struct fields which only appear in TS-ESTree AST. Add a #[js_only] attribute which does the same thing in reverse - indicates a field only appears in the JS ESTree AST, and not in TS-ESTree.

This allows removing a custom serializer and hacky workaround for JSXOpeningFragment.

@github-actions github-actions bot added A-ast Area - AST A-ast-tools Area - AST tools C-enhancement Category - New feature or request labels May 19, 2025
Copy link
Member Author

overlookmotel commented May 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented May 19, 2025

CodSpeed Instrumentation Performance Report

Merging #11160 will not alter performance

Comparing 05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters (9e90e00) with 05-19-feat_ast_estree_add_phase_field_to_importdeclaration_in_estree_ast (1bc8d29)

Summary

✅ 34 untouched benchmarks
🆕 4 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.8 ms N/A
🆕 linter[binder.ts] N/A 146.5 ms N/A
🆕 linter[cal.com.tsx] N/A 1.3 s N/A
🆕 linter[react.development.js] N/A 53.7 ms N/A

@overlookmotel overlookmotel force-pushed the 05-19-feat_ast_estree_add_phase_field_to_importdeclaration_in_estree_ast branch from d3bd0a8 to c585a25 Compare May 19, 2025 14:12
@overlookmotel overlookmotel force-pushed the 05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters branch from f11616b to c7efda2 Compare May 19, 2025 14:12
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 19, 2025
Copy link
Member

Boshen commented May 19, 2025

Merge activity

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 19, 2025
@overlookmotel overlookmotel force-pushed the 05-19-feat_ast_estree_add_phase_field_to_importdeclaration_in_estree_ast branch from c585a25 to 5ef3893 Compare May 19, 2025 14:56
@overlookmotel overlookmotel force-pushed the 05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters branch from c7efda2 to e45841a Compare May 19, 2025 14:56
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label May 19, 2025
…nverters (#11160)

Codegen for `ESTree` impls supports a `#[ts]` attribute on struct fields which only appear in TS-ESTree AST. Add a `#[js_only]` attribute which does the same thing in reverse - indicates a field only appears in the JS ESTree AST, and not in TS-ESTree.

This allows removing a custom serializer and hacky workaround for `JSXOpeningFragment`.
@graphite-app graphite-app bot force-pushed the 05-19-feat_ast_estree_add_phase_field_to_importdeclaration_in_estree_ast branch from 5ef3893 to 1bc8d29 Compare May 19, 2025 15:13
@graphite-app graphite-app bot force-pushed the 05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters branch from e45841a to 9e90e00 Compare May 19, 2025 15:14
Base automatically changed from 05-19-feat_ast_estree_add_phase_field_to_importdeclaration_in_estree_ast to main May 19, 2025 15:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 19, 2025
@graphite-app graphite-app bot merged commit 9e90e00 into main May 19, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 05-19-feat_ast_tools_introduce_js_only_attr_for_struct_fields_and_converters branch May 19, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants