Skip to content

refactor(formatter): Split print/embed file#19699

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-25-refactor_formatter_split_print_embed_logic
Feb 26, 2026
Merged

refactor(formatter): Split print/embed file#19699
graphite-app[bot] merged 1 commit intomainfrom
02-25-refactor_formatter_split_print_embed_logic

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Feb 25, 2026

Simply extracted a portion of the file.

Copilot AI review requested due to automatic review settings February 25, 2026 05:40
@leaysgur leaysgur requested a review from Dunqing as a code owner February 25, 2026 05:40
Copy link
Member Author

leaysgur commented Feb 25, 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 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 A-formatter Area - Formatter label Feb 25, 2026
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Feb 25, 2026
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 template formatting code by extracting embedded language formatting logic into a dedicated submodule. The change improves code organization by separating concerns: the main template/mod.rs handles general template formatting, while template/embed/mod.rs specializes in formatting embedded languages (CSS, GraphQL, HTML, Markdown, Angular templates) within template literals.

Changes:

  • Extracted 8 functions related to embedded language formatting from template/mod.rs to a new template/embed/mod.rs module
  • Updated function calls in template/mod.rs to use the embed:: module prefix
  • Cleaned up imports by removing dependencies only needed by the embedded formatting logic

Reviewed changes

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

File Description
crates/oxc_formatter/src/print/template/mod.rs Removed embedded formatting functions, added embed submodule declaration, updated function calls to use embed:: prefix, cleaned up unused imports
crates/oxc_formatter/src/print/template/embed/mod.rs New module containing all embedded language formatting logic (8 functions moved from parent module)

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 25, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing 02-25-refactor_formatter_split_print_embed_logic (fdbbab7) with main (ec88f6a)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@leaysgur leaysgur changed the title refactor(formatter): Split print/embed logic refactor(formatter): Split print/embed file Feb 25, 2026
@leaysgur leaysgur force-pushed the 02-25-refactor_formatter_split_print_embed_logic branch from 1dad873 to fdbbab7 Compare February 26, 2026 03:39
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 26, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 26, 2026

Merge activity

Simply extracted a portion of the file.
@graphite-app graphite-app bot force-pushed the 02-25-refactor_formatter_split_print_embed_logic branch from fdbbab7 to 06983a4 Compare February 26, 2026 05:19
@graphite-app graphite-app bot merged commit 06983a4 into main Feb 26, 2026
21 checks passed
@graphite-app graphite-app bot deleted the 02-25-refactor_formatter_split_print_embed_logic branch February 26, 2026 05:25
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter 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.

3 participants