feat(fmt): prototype SWC Next 0.2.0 via npm - #464
Conversation
Deploying rstack-cli with
|
| Latest commit: |
0016242
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://49182fbd.rstack-cli.pages.dev |
| Branch Preview URL: | https://codex-poc-fmt-swc-next-npm.rstack-cli.pages.dev |
|
Known compatibility difference in swc-next 0.2.0, found by the existing export function value() { return 1; }This is valid in a normal The previous Yuku adapter reported this with Upstream draft fix: https://github.com/swc-project/swc-next/pull/631. It proposes extending the existing ambient-implementation diagnostic to inherited ambient contexts, with regression tests and four additional passing conformance cases. This PoC remains pinned to 0.2.0, and its tests explicitly record the current acceptance difference. The draft fix is not included in that published version; the rejection expectation can be restored after upgrading to a release containing it. |
Summary
This draft evaluates replacing Yuku in
rs fmtwith@swc-next/parser@0.2.0, using its published native binding and the existing Prettier ESTree adapter. Inferred parsers use SWC Next; explicit Prettier parsers and project plugin precedence remain available, while the experimental aliases becomeswc-nextandswc-next-ts.The cache namespace isolates this PoC from Yuku and the crate alternative. SWC Next 0.2.0 accepts function implementations in declaration files that Yuku rejected; the tests explicitly record that upstream diagnostic gap rather than adding a fallback.
On macOS arm64, builds,
pnpm check, spelling, and the complete test suite pass (378 passed, one existing skipped test). Seepackages/rstack/SWC_NEXT_POC.mdfor reproduction and limits; no performance or cross-platform parity is claimed.Related Links