Backtestsvuerun-20261021-133314#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 A = our agent, Patch B = the merged fix.
Both patches change the playground's default TypeScript version from 'latest' to a concrete 6.x release by passing `typescriptVersion: ref('6.0.3')` to `useStore`, and the independent tests confirm both fix the fresh-open and shared-link-without-version scenarios. The difference is in completeness and tests. Patch B is a one-line default change: a user can still pick a 7.x version from the dropdown and hit the same broken type support with no hint, and a shared link carrying 'latest' or 7.x still lands on a broken state. Patch A addresses the issue's actual complaint ('they don't know that Vue doesn't support TS7') by centralizing the policy in a small `typescript.ts` module: a `MAX_SUPPORTED_TS_MAJOR` constant with a comment explaining why, a `DEFAULT_TS_VERSION`, an `isSupportedTsVersion` guard, and `filterTsVersions` that removes 7+ from the VersionSelect list alongside the existing dev/insiders filter. It also resets an unsupported version coming from the URL hash, which is defensible since that state is unusable anyway. The extra scope is modest, directly tied to the issue's stated concern, and easy to revert when TS 7 is supported (bump one constant). Patch A adds a real unit test file exercising the default, the guard, and the list filter, which would fail on base (no module, and the old filter passes 7.x through); Patch B adds no tests. Craft-wise, Patch A's naming and comments are clear and consistent with the surrounding code, and the assignment to `store.typescriptVersion` works with the reactive store's ref unwrapping. Patch B is correct but minimal and untested, so A is the better fix.
Four judges ruled on this ticket in parallel, and the verdict comes from counting their votes. Each saw the issue and the two patches, labelled A and B in random order (two of them saw ours as A), with issue links and version numbers removed. Where tests could check the fix, they also saw the results of tests a separate agent wrote for the issue, run on both patches. None was told which patch was ours. The reasoning above is one judge's, shown verbatim.
Solve
4m 46s
Wall-clock time in the container
Full test suite
No new failures
3 passed · 0 skipped · 3 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
69vs 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__/typescript.spec.tsnew file mode 100644index 000000000..1e7333a72@@ -0,0 +1,40 @@+import {+ DEFAULT_TS_VERSION,+ filterTsVersions,+ isSupportedTsVersion,+} from '../src/typescript'++describe('sfc-playground typescript version', () => {+ test('default version is a supported (pre-7) release', () => {+ expect(DEFAULT_TS_VERSION).not.toBe('latest')+ expect(isSupportedTsVersion(DEFAULT_TS_VERSION)).toBe(true)+ expect(parseInt(DEFAULT_TS_VERSION, 10)).toBe(6)+ })++ test('rejects TS 7+ and latest', () => {+ expect(isSupportedTsVersion('latest')).toBe(false)+ expect(isSupportedTsVersion('7.0.0')).toBe(false)+ expect(isSupportedTsVersion('7.1.0-beta')).toBe(false)+ expect(isSupportedTsVersion('v7.0.0')).toBe(false)+ expect(isSupportedTsVersion('10.0.0')).toBe(false)+ expect(isSupportedTsVersion('')).toBe(false)+ expect(isSupportedTsVersion('6.0.3')).toBe(true)+ expect(isSupportedTsVersion('5.9.3')).toBe(true)+ expect(isSupportedTsVersion('4.9.5')).toBe(true)+ })++ test('version list excludes TS 7+, dev and insiders builds', () => {+ expect(+ filterTsVersions([+ '7.1.0',+ '7.0.0',+ '7.0.0-beta',+ '6.1.0-dev.20261001',+ '6.0.3',+ '6.0.2',+ '5.9.3',+ '5.9.0-insiders.20250101',+ ]),+ ).toEqual(['6.0.3', '6.0.2', '5.9.3'])+ })+})packages-private/sfc-playground/src/App.vueindex 7020211f4..638b6303e 100644@@ -1,5 +1,6 @@ <script setup lang="ts"> import Header from './Header.vue'+import { DEFAULT_TS_VERSION, isSupportedTsVersion } from './typescript' import { Repl, useStore, SFCOptions, useVueImportMap } from '@vue/repl' import Monaco from '@vue/repl/monaco-editor' import { ref, watchEffect, onMounted, computed, watch } from 'vue'@@ -70,9 +71,14 @@ const store = useStore( builtinImportMap: importMap, vueVersion, sfcOptions,+ typescriptVersion: ref(DEFAULT_TS_VERSION), }, hash, )+// shared links may carry an unsupported TS version (e.g. 'latest' or 7.x)+if (!isSupportedTsVersion(store.typescriptVersion)) {+ store.typescriptVersion = DEFAULT_TS_VERSION+} // @ts-expect-error globalThis.store = store packages-private/sfc-playground/src/VersionSelect.vueindex 57efdb5f6..55dd949d6 100644@@ -1,6 +1,7 @@ <script setup lang="ts"> import { onMounted, ref } from 'vue' import Copy from './icons/Copy.vue'+import { filterTsVersions } from './typescript' const expanded = ref(false) const versions = ref<string[]>()@@ -47,7 +48,7 @@ async function fetchVersions(): Promise<string[]> { } return filteredVersions } else if (props.pkg === 'typescript') {- return versions.filter(v => !v.includes('dev') && !v.includes('insiders'))+ return filterTsVersions(versions) } return versions }packages-private/sfc-playground/src/typescript.tsnew file mode 100644index 000000000..b21b5b28b@@ -0,0 +1,20 @@+// TypeScript 7 (the native port) does not ship the JS API that the Vue+// language tools in the REPL rely on, so type support breaks with it.+// Default to (and only offer) versions below this major until it is supported.+export const MAX_SUPPORTED_TS_MAJOR = 6++// keep in sync with the latest supported TypeScript release+export const DEFAULT_TS_VERSION = '6.0.3'++export function isSupportedTsVersion(version: string): boolean {+ if (version === 'latest') return false+ const major = parseInt(version.replace(/^v/, ''), 10)+ return !Number.isNaN(major) && major <= MAX_SUPPORTED_TS_MAJOR+}++export function filterTsVersions(versions: string[]): string[] {+ return versions.filter(+ v =>+ !v.includes('dev') && !v.includes('insiders') && isSupportedTsVersion(v),+ )+}
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,