Repository navigation
Conversation
Deploying rstack-cli with
|
| Latest commit: |
fe5dd36
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://807aebfb.rstack-cli.pages.dev |
| Branch Preview URL: | https://refactor-official-swc-next-p.rstack-cli.pages.dev |
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
Evaluate the published
@swc-next/formatter-prettier-plugin@0.7.0as Rstack's default JS/TS formatter. Draft POC: top-level JS/TS now uses SWCFMT without automatic fallback, including templates. This improves throughput but does not preserve embedded-template formatting capability. Import-source remains unsupported.Changes
swc-next/swc-next-tsaliases. Prettier stays at the plugin's exact peer 3.9.9; the original baseline uses 3.10.1.rangeEnd), pragma and layout options throw explicitly before Prettier can skip an empty input. Unsupported syntax propagates; no retry or unchanged-output success is used.babel/typescriptselects Prettier when that capability is required. Update both documentation locales and focused behavior tests. Three existing source/test files receive only the formatting changes required by the new formatter.Four-worker CLI comparison
Fixed Rsbuild
ad8388c5befec29f5ccf765857faf126c1f05d5d, isolated archive, unchanged config/ignore/plugin set. Old adapter:d1efeb3; prior automatic-fallback POC:dbf75f4; no-fallback implementation:e3d1c22. Same Apple M5 Max (18 cores, 64 GiB), macOS 26.6.2, Node 24.20.0, pnpm 12.18.0,--check --no-cache, two warmups and seven interleaved valid samples per cell. Process startup/config/discovery/workers/formatting are included; builds/copies/audits are excluded. Source repositories were not modified.Old adapters exit 0. Official variants exit 1 only for formatting differences (no-fallback changes 17 files; prior POC changes six). All selected files are processed. These are separate complete CLI invocations, not times to add. The known
e2e/cases/wasm/wasm-source-import/src/index.jsis excluded equally; a separate no-fallback check confirms exit 2 withformatting import phase ... is not implemented. Supported is not full syntax coverage.Capability-matched control
All variants additionally run with
embeddedLanguageFormatting: 'off'. This is a separate configuration; it also disables host-language embeds. In the old fallback POC this option already selects SWCFMT for the 462 backtick files.With matched capability, the official-plugin routes are close. Most original-config gain comes from directing all JS/TS to SWCFMT, not merely removing repeated selection. The comparison with the old adapter still improves at matched embedding settings. Do not attribute all original-config savings to native formatter-core speed or use the embedding-off whole-scope number as the original-config result.
Best measured concurrency, independently confirmed
Scan 1/2/4/6/8/12/18 workers, all four variants at every count, two warmups plus seven interleaved samples. Choose the no-fallback median minimum per scope, then independently repeat that configuration with all baselines at the same worker count. Original configuration throughout.
At 12 workers, supported no-fallback and the same-version old adapter are essentially equal. These are the best configurations measured on this machine/input, not a theoretical maximum or universal ranking. The default worker policy is unchanged; no hot API timing is mixed with CLI wall time. See every variant/count/sample/range.
Output, actual parser calls and measurement integrity
@swc-next/parser@0.7.0: no diagnostics or normalized AST/comment mismatches. Normalization retains observable tagged-template raw values. No-fallback adds 11 formatting differences to the prior six; template contents are unchanged on this Rsbuild input. Focused tests demonstrate the missing GraphQL embedding capability separately. This is structural validation, not execution equivalence; no Rsbuild runtime suite was run./tmp, with every input byte checked before each timing cell. No valid slow samples were discarded. No snapshots changed.Reproduce
Build old-adapter, prior fallback and current checkouts with locked dependencies,
pnpm build, thenpnpm --filter rstack build:native.The CLI command is constructed without a shell:
[node, variant/packages/rstack/bin/rs.js, fmt, ...manifest, --check, --no-cache, --parallel-workers, count]. Fixed manifests, config/archive/bundle hashes, runtime patch, route tracing and independent AST-audit commands are in the report. Historical results are preserved rather than overwritten.Validation
Passed for the runtime change:
pnpm build, native build, fullpnpm test(457 passed, 1 skipped), focused behavior coverage,pnpm check,pnpm check:spell, fullrs fmt --check --no-cache, website build andgit diff --check. Final rebuilt formatter/worker/pool JavaScript matches the measured snapshot byte for byte; unrelated lazy app/test chunk names changed. Generated native files are unchanged. Rust source did not change.All valid timing counts/medians, JSON/script syntax, route counts, output hashes and idempotence were checked. Diff artifacts normalize empty context-marker lines for repository whitespace checks without altering output hashes. CI should be assessed at the latest head; this remains a Draft POC.