Repository navigation
Conversation
Deploying rstack-cli with
|
| Latest commit: |
da57827
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://37ae13ff.rstack-cli.pages.dev |
| Branch Preview URL: | https://refactor-official-swc-next-p.rstack-cli.pages.dev |
Member
Author
Member
Author
Remaining differences from the parser-only integrationCompared the parser-only integration on
Formatting twice can change the output. The parser-only path is stable on the first pass for these examples; the SWCFMT path is not:
Layout-only differences in Rsbuild. Seven TypeScript files differ; their normalized ASTs and comments match, and both outputs are stable:
|
SoonIter
force-pushed
the
refactor-official-swc-next-prettier-plugin
branch
from
December 1, 2026 06:35
fc75027 to
da57827
Compare
Member
Author
|
Follow-up to the 0.9.1 behavior comparison, excluding the template embedding issue:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Move JavaScript and TypeScript AST-to-document formatting into Rust while keeping Prettier's document renderer, configuration, and plugin integration. This replaces the local SWC Next parser adapter and Prettier ESTree printer with the official SWC Next v0.9.1 Prettier plugin.
Changes
/javascriptentry for standalone JS, JSX, TS and TSX and their Markdown/MDX code fences. Prettier still formats the Markdown/MDX host, including MDX import/export and JSX nodes. The upstream/markdownentry is not used.swc-nextandswc-next-tsparser aliases, explicit Prettier parsers, and project parser-plugin precedence. Disabled embedded formatting still leaves fences untouched; Prettier preserves rejected snippets. Vue and Svelte keep their existing paths.Rsbuild results
Compared the parser-only v0.9.1 baseline with the official v0.9.1 formatter plugin at
da57827. Both use Prettier 3.10.1. Input: Rsbuildad8388c, with its own configuration andheading-caseplugin.Medians from nine alternating-order runs per scope after two warmups per version. Each run launches
rs fmt --check --no-cachewith eight workers on the same file list and unchanged inputs (Apple M5 Max, macOS 26.6.2, Node 24.20.0). These are end-to-end formatting times, not isolated formatter or Rsbuild build times. The Markdown/MDX gain is smaller and the measured ranges overlap. The previously excluded source-phase import fixture is included this time; there is no new oxfmt measurement.Behavior and validation
import sourcenow formats on both paths, including the full Rsbuild fixture. Ambient module import attributes still error on the parser-only path and format without dropping attributes with the official plugin.parser: 'babel'orparser: 'typescript'for Prettier's embedded-language support and those options.pnpm check, the website build, and the full Rstack test suite passed (467 passed, 1 skipped). The Rsbuild runtime test suite was not run.