Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Oct 6, 2025

Pure refactor.

Codegen for raw transfer contains logic for generating multiple deserializer variants from a single base implementation, using feature flags to gate certain code, and minifier to shake out dead code in each (#14312).

Abstract this functionality into a VariantGenerator trait, and move it into the output module. This allows reusing the same functionality for other generators.

@github-actions github-actions bot added the A-ast-tools Area - AST tools label Oct 6, 2025
Copy link
Member Author

overlookmotel commented Oct 6, 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.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Oct 6, 2025
@overlookmotel overlookmotel force-pushed the 10-05-refactor_ast_tools_move_variants_generator_into_output_module branch from 12ef84a to 2fa6607 Compare October 6, 2025 10:40
@overlookmotel overlookmotel marked this pull request as ready for review October 6, 2025 10:41
Copilot AI review requested due to automatic review settings October 6, 2025 10:41
@overlookmotel overlookmotel self-assigned this Oct 6, 2025
Copy link
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

This PR refactors the variant generation functionality from the raw transfer generator into a reusable VariantGenerator trait in the output module. The purpose is to extract and generalize the logic for generating multiple JavaScript deserializer variants using feature flags and dead code elimination.

Key changes:

  • Created a new VariantGenerator trait in the JavaScript output module for generating code variants with feature flags
  • Moved minification and AST processing utilities from the raw transfer generator to the output module
  • Refactored the raw transfer generator to use the new trait instead of inline variant generation logic

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tasks/ast_tools/src/output/mod.rs Made javascript module public to expose the new VariantGenerator trait
tasks/ast_tools/src/output/javascript.rs Added VariantGenerator trait and supporting utilities for generating code variants with feature flags
tasks/ast_tools/src/generators/raw_transfer.rs Refactored to use the new VariantGenerator trait, removing duplicate code and simplifying variant generation logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 6, 2025

Merge activity

…4372)

Pure refactor.

Codegen for raw transfer contains logic for generating multiple deserializer variants from a single base implementation, using feature flags to gate certain code, and minifier to shake out dead code in each (#14312).

Abstract this functionality into a `VariantGenerator` trait, and move it into the `output` module. This allows reusing the same functionality for other generators.
@graphite-app graphite-app bot force-pushed the 10-05-refactor_ast_tools_move_variants_generator_into_output_module branch from 2fa6607 to 515e08a Compare October 6, 2025 12:08
@graphite-app graphite-app bot merged commit 515e08a into main Oct 6, 2025
17 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 6, 2025
@graphite-app graphite-app bot deleted the 10-05-refactor_ast_tools_move_variants_generator_into_output_module branch October 6, 2025 12:13
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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants