Backtestsvuerun-20261001-022054#15217
The Playground's TS version is set to 7 by default.
Our patch was judged better than the merged fix.
In this judgment, Patch B = our agent, Patch A = the merged fix.
Both patches make the same functional fix: they pass `typescriptVersion: ref('6.0.3')` to `useStore`, overriding @vue/repl's default of 'latest'. That addresses the reported problem directly; neither is more correct, and both still let users pick another version from the dropdown. Patch A is the more minimal change: it adds a local constant in App.vue, but with no comment explaining why TS is pinned. Patch B moves the constant into a small `typescriptVersion.ts` module with a comment saying Vue's language tools don't support TS 7 yet. For a pin that is explicitly temporary, recording the reason is useful, because it tells future maintainers when the pin can be lifted. Patch B also adds a spec asserting the default is an exact 6.x version and not 'latest'. The test is close to tautological, since it checks a constant, and it is unclear whether the repo's vitest config picks up tests under packages-private. It still acts as a small regression guard against someone reverting to 'latest' or bumping to 7 by accident. The extra file adds slight indirection but no real risk. With correctness equal, B wins narrowly on its documented rationale and its modest regression test.
The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.
Solve
3m 18s15 turns
Wall-clock time in the container
Full test suite
No new failures
3,675 passed · 6 skipped · 3,681 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
18vs 3 merged
Changed lines, ours vs merged
The issue
View on GitHubVue version
commit(d2c458b)
Link to minimal reproduction
Steps to reproduce
- open Playground: https://play.vuejs.org/
- TS version has been set latest and it's over 7.
What is expected?
It's not friendly for someone new to Vue and they don't know that Vue doesn't support TS7 at this time.
I think this is temporary issue, but until Vue supports TS7, It is helpful to tell that.
Or rather, the TS version should default to TS6, not the latest.
What is actually happening?
Broken type support if TS version is not changed.
<img width="470" height="265" alt="Image" src="https://github.com/user-attachments/assets/a5f13371-1180-4c6f-8714-06f32f7c11c8" />
System Info
Any additional comments?
_No response_
The two patches
packages-private/sfc-playground/__tests__/typescriptVersion.spec.tsnew file mode 100644index 000000000..0bd2612c1@@ -0,0 +1,13 @@+import { DEFAULT_TYPESCRIPT_VERSION } from '../src/typescriptVersion'++// Vue's language tools used by the playground do not support TypeScript 7+,+// so the playground must pin an exact TypeScript 6 version instead of using+// @vue/repl's default of "latest".+describe('sfc-playground typescript version', () => {+ test('DEFAULT_TYPESCRIPT_VERSION is an exact TypeScript 6 version', () => {+ expect(DEFAULT_TYPESCRIPT_VERSION).not.toBe('latest')+ const match = DEFAULT_TYPESCRIPT_VERSION.match(/^(\d+)\.(\d+)\.(\d+)$/)+ expect(match).not.toBeNull()+ expect(Number(match![1])).toBe(6)+ })+})packages-private/sfc-playground/src/App.vueindex 7020211f4..bf6a2221d 100644@@ -3,6 +3,7 @@ import Header from './Header.vue' import { Repl, useStore, SFCOptions, useVueImportMap } from '@vue/repl' import Monaco from '@vue/repl/monaco-editor' import { ref, watchEffect, onMounted, computed, watch } from 'vue'+import { DEFAULT_TYPESCRIPT_VERSION } from './typescriptVersion' const replRef = ref<InstanceType<typeof Repl>>() @@ -70,6 +71,7 @@ const store = useStore( builtinImportMap: importMap, vueVersion, sfcOptions,+ typescriptVersion: ref(DEFAULT_TYPESCRIPT_VERSION), }, hash, )packages-private/sfc-playground/src/typescriptVersion.tsnew file mode 100644index 000000000..d81addfbc@@ -0,0 +1,3 @@+// Vue's language tools don't support TypeScript 7 yet, so default to TS 6+// instead of @vue/repl's "latest".+export const DEFAULT_TYPESCRIPT_VERSION = '6.0.3'
packages-private/sfc-playground/src/App.vueindex 7020211f4..5a87a1d1d 100644@@ -14,6 +14,8 @@ setVH() const useSSRMode = ref(false) +const DEFAULT_TYPESCRIPT_VERSION = '6.0.3'+ const AUTO_SAVE_STORAGE_KEY = 'vue-sfc-playground-auto-save' const initAutoSave: boolean = JSON.parse( localStorage.getItem(AUTO_SAVE_STORAGE_KEY) ?? 'true',@@ -69,6 +71,7 @@ const store = useStore( { builtinImportMap: importMap, vueVersion,+ typescriptVersion: ref(DEFAULT_TYPESCRIPT_VERSION), sfcOptions, }, hash,
What the agent reported
I fixed it: the playground now starts on TypeScript 6.0.3 instead of "latest" (which is now TS 7). The new test passes, but it only checks the pinned version number, not the running playground.
What was wrong: The playground creates its editor state with useStore from @vue/repl and didn't say which TypeScript version to use. @vue/repl then defaults to "latest", which now means TypeScript 7. Vue's language tools don't support TS 7 yet, so type support breaks unless the user changes the version by hand.
What I changed:
- New file
packages-private/sfc-playground/src/typescriptVersion.ts: exportsDEFAULT_TYPESCRIPT_VERSION = '6.0.3', with a comment saying why. That's the version the repo's ownpackage.jsonuses (~6.0.3), and it's installed innode_modules, so it is a published release. packages-private/sfc-playground/src/App.vue: passestypescriptVersion: ref(DEFAULT_TYPESCRIPT_VERSION)touseStore. If a shared link names a TypeScript version, that version still wins. Old links that don't name one now open with 6.0.3.- Side effect: because the default is no longer "latest", every playground link created from now on records
6.0.3. Those links will stay on TS 6 even after Vue supports TS 7 and this default is changed.
Test evidence:
- New test
packages-private/sfc-playground/__tests__/typescriptVersion.spec.ts: checks that the default is an exact version with major version 6, not "latest". - Before the fix it failed (the module didn't exist).
- With the value set to
'latest'it failed on the assertion, so it does catch the bug. - After the fix,
./bt-test packages-private/sfc-playground/__tests__/typescriptVersion.spec.tspasses (1 test). - Limit of the test: I wanted a stronger test that builds the store and checks it uses TS 6, but
@vue/repl/corecan't be loaded under this repo's vitest setup without changing the sharedvitest.config.ts, so I left that out. - No type-check: there's no tsconfig for the playground, so
vue-tsccouldn't be run on it. - Not run in a browser: I haven't confirmed the editor actually downloads TS 6.0.3 at runtime. The reviewer traced the version through
@vue/repl's code and found no problems, and nothing else in the diff changed.
Requirements:
| Ask | Outcome |
|---|---|
| The playground should default to TS 6, not latest | Done, see above. |
| Alternatively, tell users that Vue doesn't support TS 7 yet | Not done. The report offered this as an either/or, and with TS 6 as the default new users no longer hit the problem. Someone who picks TS 7 from the dropdown still gets no warning; that would be a separate UI change. |
| Type support shouldn't break when the version is left alone | Fixed by the TS 6 default. |
All changes are uncommitted in the working tree, with no scratch files left behind.