Backtestsvuerun-20261003-231210#15217

Issue #15217 Merged fix PR #15219 Run 3 Oct 2026 · run-20261003-231210 vuejs/core

The Playground's TS version is set to 7 by default.

Better

Our patch was judged better than the merged fix.

In this judgment, Patch B = our agent, Patch A = the merged fix.

Both patches fix the root cause the same way. They pass a non-`latest` `typescriptVersion` ref into `useStore`, so the playground stops defaulting to TS 7.

Patch A hardcodes `'6.0.3'`. That works, but it freezes the default at one patch release, so later 6.x fixes are missed until someone edits the constant. It also carries no explanation of why TS 7 is avoided.

Patch B defaults to `'6'`, a major-version range the CDN resolves to the newest stable 6.x. This tracks patch releases automatically and states the intent in a comment. B also sees a consequence A's approach would avoid but B's introduces: the selected value `'6'` no longer exactly matches any entry in the version list. Without a fix, the version dropdown would highlight nothing. B handles this with `isActiveVersion`, which maps a major range to the newest stable release of that major, and it applies the helper in `VersionSelect.vue`.

B adds tests:
- The default-is-not-TS7 check is somewhat tautological.
- The `isActiveVersion` tests are meaningful: they cover a major range skipping prereleases, `latest`, and an exact version.

There is a modest risk that some @vue/repl path, such as filesystem listing, expects an exact version rather than a range. On balance, B is the more durable and better-tested fix, and its extra code directly supports its choice of default rather than being unrelated churn. A is simpler and certainly correct, but less maintainable.

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

5m 19s

Wall-clock time in the container

Full test suite

No new failures

3,678 passed · 6 skipped · 3,684 total

Contamination audit

Clean

No sign the agent saw the real fix

Patch size

61vs 3 merged

Changed lines, ours vs merged

Vue version

commit(d2c458b)

Link to minimal reproduction

https://play.vuejs.org/

Steps to reproduce

  1. open Playground: https://play.vuejs.org/
  2. 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

Our patch+57 −4
packages-private/sfc-playground/__tests__/versions.spec.tsnew file mode 100644index 000000000..f1f92f495@@ -0,0 +1,27 @@+import { DEFAULT_TYPESCRIPT_VERSION, isActiveVersion } from '../src/versions'++describe('sfc-playground versions', () => {+  test('default TypeScript version is not TS 7+', () => {+    expect(DEFAULT_TYPESCRIPT_VERSION).not.toBe('latest')+    expect(parseInt(DEFAULT_TYPESCRIPT_VERSION, 10)).toBeLessThan(7)+  })++  const versions = ['7.0.1', '7.0.0', '6.1.0-beta', '6.0.3', '6.0.2', '5.9.3']++  test('major range highlights newest stable release of that major', () => {+    expect(versions.filter(v => isActiveVersion(v, '6', versions))).toEqual([+      '6.0.3',+    ])+  })++  test('latest highlights the first version', () => {+    const active = versions.filter(v => isActiveVersion(v, 'latest', versions))+    expect(active).toEqual(['7.0.1'])+  })++  test('exact version highlights only itself', () => {+    expect(versions.filter(v => isActiveVersion(v, '6.0.2', versions))).toEqual(+      ['6.0.2'],+    )+  })+})packages-private/sfc-playground/src/App.vueindex 7020211f4..e9a139636 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 './versions'  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/VersionSelect.vueindex 57efdb5f6..87eaddfcc 100644@@ -1,6 +1,7 @@ <script setup lang="ts"> import { onMounted, ref } from 'vue' import Copy from './icons/Copy.vue'+import { isActiveVersion } from './versions'  const expanded = ref(false) const versions = ref<string[]>()@@ -87,11 +88,9 @@ onMounted(() => {     <ul class="versions" :class="{ expanded }">       <li v-if="!versions"><a>loading versions...</a></li>       <li-        v-for="(ver, index) of versions"+        v-for="ver of versions"         class="versions-item"-        :class="{-          active: ver === version || (version === 'latest' && index === 0),-        }"+        :class="{ active: isActiveVersion(ver, version, versions!) }"       >         <a @click="setVersion(ver)">v{{ ver }}</a>         <buttonpackages-private/sfc-playground/src/versions.tsnew file mode 100644index 000000000..05ecd247b@@ -0,0 +1,25 @@+// Vue's type support (vue-tsc / language tools) does not work with+// TypeScript 7 yet, so the playground defaults to the latest TypeScript 6+// release instead of `latest`. The value is resolved as a semver range by+// the CDN, so it always picks up the newest 6.x patch.+export const DEFAULT_TYPESCRIPT_VERSION = '6'++/**+ * Whether `ver` (a concrete version from the version list) should be shown+ * as the active one for the selected `selected` value, which may be a+ * concrete version, `latest`, or a major version range like `6`.+ * `versions` is expected to be sorted newest first.+ */+export function isActiveVersion(+  ver: string,+  selected: unknown,+  versions: string[],+): boolean {+  if (ver === selected) return true+  if (selected === 'latest') return versions[0] === ver+  if (typeof selected === 'string' && /^\d+$/.test(selected)) {+    const prefix = `${selected}.`+    return versions.find(v => v.startsWith(prefix) && !v.includes('-')) === ver+  }+  return false+} 
Merged fix · PR #15219+3 −0
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,