Skip to content

refactor(formatter,oxfmt): Use language as an identifier for format_embedded()#18323

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-21-refactor_oxfmt_use_language_as_an_identifier_for_embedded_format
Jan 21, 2026
Merged

refactor(formatter,oxfmt): Use language as an identifier for format_embedded()#18323
graphite-app[bot] merged 1 commit intomainfrom
01-21-refactor_oxfmt_use_language_as_an_identifier_for_embedded_format

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Jan 21, 2026

Prepare for next PR, which supports angular-(template|styles)

oxc_formatter should not know about Prettier; it should only inform oxfmt about what it finds.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 21, 2026
Copy link
Member Author


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.

@leaysgur leaysgur changed the title refactor(oxfmt): Use language as an identifier for embedded_format refactor(formatter,oxfmt): Use language as an identifier for format_embedded() Jan 21, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 21, 2026

Merging this PR will not alter performance

✅ 38 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing 01-21-refactor_oxfmt_use_language_as_an_identifier_for_embedded_format (11e215d) with main (29966eb)

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 marked this pull request as ready for review January 21, 2026 05:17
@leaysgur leaysgur requested a review from Dunqing as a code owner January 21, 2026 05:17
Copilot AI review requested due to automatic review settings January 21, 2026 05:17
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 embedded code formatting interface to use language identifiers instead of tag names, improving separation of concerns between oxc_formatter and oxfmt. This prepares the codebase for future support of Angular templates and styles.

Changes:

  • Renamed the format_embedded() parameter from tag_name to language to reflect the abstraction change
  • Introduced language identifier mappings (e.g., css tag → "tagged-css" identifier, styled-jsx → "styled-jsx")
  • Updated oxfmt to translate language identifiers to Prettier parser names, removing Prettier knowledge from oxc_formatter

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.rs Maps template tag names to language identifiers and updates the format_embedded_template() function to use the new language parameter
apps/oxfmt/src/core/external_formatter.rs Translates language identifiers to Prettier parser names and updates documentation to reflect the new abstraction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leaysgur leaysgur force-pushed the 01-21-refactor_oxfmt_use_language_as_an_identifier_for_embedded_format branch from 11e215d to 8201b30 Compare January 21, 2026 13:43
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 21, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 21, 2026

Merge activity

…embedded()` (#18323)

Prepare for next PR, which supports `angular-(template|styles)`

`oxc_formatter` should not know about Prettier; it should only inform `oxfmt` about what it finds.
@graphite-app graphite-app bot force-pushed the 01-21-refactor_oxfmt_use_language_as_an_identifier_for_embedded_format branch from 8201b30 to a88f2da Compare January 21, 2026 16:50
@graphite-app graphite-app bot merged commit a88f2da into main Jan 21, 2026
21 checks passed
@graphite-app graphite-app bot deleted the 01-21-refactor_oxfmt_use_language_as_an_identifier_for_embedded_format branch January 21, 2026 16:56
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI 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