Skip to content

feat(ast_tools): support inlining custom deserialized fields with #[estree(raw_deser_inline)]#21133

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_
Apr 7, 2026
Merged

feat(ast_tools): support inlining custom deserialized fields with #[estree(raw_deser_inline)]#21133
graphite-app[bot] merged 1 commit intomainfrom
om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 7, 2026

Add an #[estree(raw_deser_inline)] attribute which can be used on custom deserializers. Like automatically-generated deserializers, where the value does not require parent, it can be set as an object property inline, rather than assigned after constructing the AST node object.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 7, 2026


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 changes, fast-track this PR to the front of the merge queue

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in ast_tools for inlining custom raw-transfer deserializer fields by introducing a new #[estree(raw_deser_inline)] meta attribute and updating the raw-transfer code generator to place converter preambles either before object literals (inline) or before post-construction assignments.

Changes:

  • Extend ESTreeMeta with a raw_deser_inline flag and parse it from #[estree(raw_deser_inline)].
  • Update raw-transfer struct deserializer generation to track two preamble phases (inline vs assignment) and propagate an “inline-capable” flag from custom converters.
  • Adjust converter application API to return both the value expression and whether it can be inlined.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tasks/ast_tools/src/schema/extensions/estree.rs Adds raw_deser_inline metadata flag on ESTree meta converters.
tasks/ast_tools/src/generators/raw_transfer.rs Splits generator preamble into inline vs assignment phases; threads “inline-capable” through converter application and field generation.
tasks/ast_tools/src/derives/estree.rs Parses #[estree(raw_deser_inline)] and sets the meta flag accordingly.

Comment thread tasks/ast_tools/src/schema/extensions/estree.rs Outdated
@overlookmotel overlookmotel self-assigned this Apr 7, 2026
@overlookmotel overlookmotel force-pushed the om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_ branch from 34ca616 to 68caa55 Compare April 7, 2026 16:27
@overlookmotel overlookmotel force-pushed the om/04-07-perf_napi_parser_linter_plugins_use_int32array_in_raw_transfer_deserializer branch 2 times, most recently from 3c40fb4 to 56d49d6 Compare April 7, 2026 16:39
@overlookmotel overlookmotel force-pushed the om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_ branch from 68caa55 to 0626c79 Compare April 7, 2026 16:39
@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label Apr 7, 2026
@graphite-app graphite-app Bot force-pushed the om/04-07-perf_napi_parser_linter_plugins_use_int32array_in_raw_transfer_deserializer branch from 56d49d6 to f5552d3 Compare April 7, 2026 17:17
@graphite-app graphite-app Bot requested a review from camc314 as a code owner April 7, 2026 17:17
@graphite-app graphite-app Bot force-pushed the om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_ branch from 0626c79 to 25ba749 Compare April 7, 2026 17:18
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 7, 2026

Merge activity

…estree(raw_deser_inline)]` (#21133)

Add an `#[estree(raw_deser_inline)]` attribute which can be used on custom deserializers. Like automatically-generated deserializers, where the value does not require `parent`, it can be set as an object property inline, rather than assigned after constructing the AST node object.
@graphite-app graphite-app Bot force-pushed the om/04-07-perf_napi_parser_linter_plugins_use_int32array_in_raw_transfer_deserializer branch from f5552d3 to c0278ab Compare April 7, 2026 17:26
@graphite-app graphite-app Bot force-pushed the om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_ branch from 25ba749 to 7b3d5a9 Compare April 7, 2026 17:27
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Apr 7, 2026
Base automatically changed from om/04-07-perf_napi_parser_linter_plugins_use_int32array_in_raw_transfer_deserializer to main April 7, 2026 17:32
@graphite-app graphite-app Bot merged commit 7b3d5a9 into main Apr 7, 2026
24 of 25 checks passed
@graphite-app graphite-app Bot deleted the om/04-07-feat_ast_tools_support_inlining_custom_deserialized_fields_with_estree_raw_deser_inline_ branch April 7, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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