Skip to content

Commit 3218678

Browse files
committed
refactor(fmt): simplify SWC Next cache version
1 parent 8b23703 commit 3218678

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/rstack/SWC_NEXT_POC.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This branch replaces the default Yuku parser in `rs fmt` with SWC Next 0.2.2 whi
66

77
Inferred JavaScript, JSX, TypeScript, TSX, and embedded script formatting use SWC Next. Explicit `babel` and `typescript` options still select Prettier's own parsers, and project plugins retain precedence. The experimental explicit parser names are `swc-next` and `swc-next-ts`, replacing `yuku` and `yuku-ts`.
88

9-
The cache namespace includes the parser version and integration route so switching between the original formatter and either PoC cannot reuse stale formatting results. The decoder and Rust serializer must be upgraded together; all SWC Next packages in this PoC are locked to 0.2.2.
9+
The cache namespace includes the installed parser version so parser upgrades invalidate existing formatting results. The decoder and Rust serializer must be upgraded together; all SWC Next packages in this PoC are locked to 0.2.2.
1010

1111
## Try it
1212

‎packages/rstack/src/fmt/cacheIdentity.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const cacheNamespace: string = JSON.stringify([
2222
fmtCacheVersion,
2323
RSTACK_VERSION,
2424
PRETTIER_VERSION,
25-
`swc-next@${SWC_NEXT_VERSION}:npm`,
25+
SWC_NEXT_VERSION,
2626
]);
2727

2828
/** Creates project-relative POSIX cache keys without repeating path setup. */

‎packages/rstack/tests/fmt/cacheIdentity.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test('includes formatter implementation versions in the namespace', () => {
9494
fmtCacheVersion,
9595
pkgJson.version,
9696
prettierPkgJson.version,
97-
`swc-next@${swcNextPkgJson.version}:npm`,
97+
swcNextPkgJson.version,
9898
]);
9999
});
100100

0 commit comments

Comments
 (0)