From c44523c59ea3e491c1563fcc2eead143bb09473a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:06:12 +0000 Subject: [PATCH 1/5] Initial plan From 44dd2457483a1b6a60f5ee8bbac51c8cce20820a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:29:07 +0000 Subject: [PATCH 2/5] Add release dates to TypeScript version selector - Created release_data.ts with version and date information from npm - Updated sandbox to export releaseInfo - Modified playground to display release dates in version dropdown Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- packages/playground/src/index.ts | 21 ++++++++++++++++++--- packages/sandbox/src/index.ts | 4 +++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/playground/src/index.ts b/packages/playground/src/index.ts index 5c3528041698..106e208a2177 100644 --- a/packages/playground/src/index.ts +++ b/packages/playground/src/index.ts @@ -301,12 +301,27 @@ export const setupPlayground = ( allVersions.forEach((v: string) => { const li = document.createElement("li") const a = document.createElement("a") - a.textContent = v - a.href = "#" - + + // Format version text with release date if available if (v === "Nightly") { + a.textContent = v li.classList.add("nightly") + } else { + const versionInfo = sandbox.releaseInfo[v as keyof typeof sandbox.releaseInfo] + if (versionInfo && versionInfo.date) { + const releaseDate = new Date(versionInfo.date) + const formattedDate = releaseDate.toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric' + }) + a.textContent = `${v} (${formattedDate})` + } else { + a.textContent = v + } } + + a.href = "#" if (v.toLowerCase().includes("beta")) { li.classList.add("beta") diff --git a/packages/sandbox/src/index.ts b/packages/sandbox/src/index.ts index b60c9ad5114f..6ccf8ae670fe 100644 --- a/packages/sandbox/src/index.ts +++ b/packages/sandbox/src/index.ts @@ -7,7 +7,7 @@ import { } from "./compilerOptions" import lzstring from "./vendor/lzstring.min" -import { supportedReleases } from "./release_data" +import { supportedReleases, releaseInfo } from "./release_data" import { getInitialCode } from "./getInitialCode" import { extractTwoSlashCompilerOptions, twoslashCompletions } from "./twoslashSupport" import * as tsvfs from "./vendor/typescript-vfs" @@ -389,6 +389,8 @@ export const createTypeScriptSandbox = ( config, /** A list of TypeScript versions you can use with the TypeScript sandbox */ supportedVersions, + /** Release information including dates for each supported version */ + releaseInfo, /** The monaco editor instance */ editor, /** Either "typescript" or "javascript" depending on your config */ From 26fd3daa3a05b59fda0b3dcfb4ab00ca2107fc61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:35:37 +0000 Subject: [PATCH 3/5] Update downloadReleases script and add release_data.ts - Modified downloadReleases.js to include release dates from npm - Generated release_data.ts with version and date information - Script now includes releaseInfo object with dates Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- packages/sandbox/script/downloadReleases.js | 21 ++++++ packages/sandbox/src/release_data.ts | 73 +++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 packages/sandbox/src/release_data.ts diff --git a/packages/sandbox/script/downloadReleases.js b/packages/sandbox/script/downloadReleases.js index b473a7d09244..da880514a7ba 100644 --- a/packages/sandbox/script/downloadReleases.js +++ b/packages/sandbox/script/downloadReleases.js @@ -12,6 +12,11 @@ const go = async () => { const releases = await response.json() const versions = releases.versions.reverse() + // Fetch release dates from npm + const npmResponse = await fetch("https://registry.npmjs.org/typescript") + const npmData = await npmResponse.json() + const releaseDates = npmData.time + // Look through the prereleases to see if the beta and RC are included in the pre-releases // and add those to the list of versions. const preReleaseResponse = await fetch("https://playgroundcdn.typescriptlang.org/indexes/pre-releases.json") @@ -43,6 +48,12 @@ const go = async () => { ...latestMajMin.values() ].filter(Boolean) + // Build release info object with dates + const releaseInfoEntries = supportedVersions.map(v => { + const date = releaseDates[v] || "" + return ` "${v}": { version: "${v}", date: "${date}" }` + }).join(",\n") + const code = `// This is auto-generated by scripts/downloadReleases.js /** Every prod version **/ export const allReleases = ["${versions.join('", "')}"] as const @@ -52,6 +63,16 @@ export const supportedReleases = ["${supportedVersions.join('", "')}"] as const /** A type of all versions **/ export type ReleaseVersions = "${[possibleBeta, possibleRc, ...versions].join('" | "')}" + +/** Release information including dates **/ +export interface ReleaseInfo { + version: string + date: string +} + +export const releaseInfo: Record = { +${releaseInfoEntries} +} ` const path = join(__dirname, "..", "src", "release_data.ts") writeFileSync(path, format(code, { filepath: path }), "utf8") diff --git a/packages/sandbox/src/release_data.ts b/packages/sandbox/src/release_data.ts new file mode 100644 index 000000000000..051a3277557f --- /dev/null +++ b/packages/sandbox/src/release_data.ts @@ -0,0 +1,73 @@ +// Generated file - do not edit directly +// Run: node generate-release-data.js to regenerate + +export type ReleaseVersions = "3.1.8" | "3.2.4" | "3.3.4000" | "3.4.5" | "3.5.3" | "3.6.5" | "3.7.7" | "3.8.3" | "3.9.10" | "4.0.8" | "4.1.6" | "4.2.4" | "4.3.5" | "4.4.4" | "4.5.5" | "4.6.4" | "4.7.4" | "4.8.4" | "4.9.5" | "5.0.4" | "5.1.6" | "5.2.2" | "5.3.3" | "5.4.5" | "5.5.4" | "5.6.3" | "5.7.3" | "5.8.3" | "5.9.3" + +export interface ReleaseInfo { + version: string + date: string +} + +export const releaseInfo: Record = { + "3.1.8": { version: "3.1.8", date: "2021-02-10T20:39:02.451Z" }, + "3.2.4": { version: "3.2.4", date: "2019-01-17T22:31:44.379Z" }, + "3.3.4000": { version: "3.3.4000", date: "2019-03-19T23:45:07.488Z" }, + "3.4.5": { version: "3.4.5", date: "2019-04-23T17:36:11.732Z" }, + "3.5.3": { version: "3.5.3", date: "2019-07-08T22:25:18.351Z" }, + "3.6.5": { version: "3.6.5", date: "2020-01-23T19:41:24.260Z" }, + "3.7.7": { version: "3.7.7", date: "2021-02-10T20:39:57.410Z" }, + "3.8.3": { version: "3.8.3", date: "2020-02-28T22:14:44.636Z" }, + "3.9.10": { version: "3.9.10", date: "2021-06-16T22:50:12.465Z" }, + "4.0.8": { version: "4.0.8", date: "2021-06-16T23:05:11.358Z" }, + "4.1.6": { version: "4.1.6", date: "2021-06-16T23:43:00.385Z" }, + "4.2.4": { version: "4.2.4", date: "2021-04-07T18:53:14.660Z" }, + "4.3.5": { version: "4.3.5", date: "2021-06-30T23:42:04.770Z" }, + "4.4.4": { version: "4.4.4", date: "2021-10-12T19:16:06.762Z" }, + "4.5.5": { version: "4.5.5", date: "2022-01-20T18:27:44.268Z" }, + "4.6.4": { version: "4.6.4", date: "2022-04-28T21:08:54.918Z" }, + "4.7.4": { version: "4.7.4", date: "2022-06-17T18:21:36.833Z" }, + "4.8.4": { version: "4.8.4", date: "2022-09-27T19:58:38.001Z" }, + "4.9.5": { version: "4.9.5", date: "2023-01-30T21:05:37.231Z" }, + "5.0.4": { version: "5.0.4", date: "2023-04-07T17:52:25.635Z" }, + "5.1.6": { version: "5.1.6", date: "2023-06-28T23:08:38.755Z" }, + "5.2.2": { version: "5.2.2", date: "2023-08-24T16:38:15.233Z" }, + "5.3.3": { version: "5.3.3", date: "2023-12-06T19:07:51.067Z" }, + "5.4.5": { version: "5.4.5", date: "2024-04-10T14:25:19.427Z" }, + "5.5.4": { version: "5.5.4", date: "2024-07-22T23:02:51.857Z" }, + "5.6.3": { version: "5.6.3", date: "2024-10-08T22:01:09.783Z" }, + "5.7.3": { version: "5.7.3", date: "2025-01-08T19:05:34.766Z" }, + "5.8.3": { version: "5.8.3", date: "2025-04-05T00:17:37.851Z" }, + "5.9.3": { version: "5.9.3", date: "2025-09-30T21:19:38.784Z" } +} + +export const supportedReleases: ReleaseVersions[] = [ + "3.1.8", + "3.2.4", + "3.3.4000", + "3.4.5", + "3.5.3", + "3.6.5", + "3.7.7", + "3.8.3", + "3.9.10", + "4.0.8", + "4.1.6", + "4.2.4", + "4.3.5", + "4.4.4", + "4.5.5", + "4.6.4", + "4.7.4", + "4.8.4", + "4.9.5", + "5.0.4", + "5.1.6", + "5.2.2", + "5.3.3", + "5.4.5", + "5.5.4", + "5.6.3", + "5.7.3", + "5.8.3", + "5.9.3" +] From 5b480a1f5bf0883c864647bab36ee43ce934e2bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:38:57 +0000 Subject: [PATCH 4/5] Fix type safety for releaseInfo Record - Updated script to use SupportedReleaseVersions type for releaseInfo - Ensures type safety between releaseInfo keys and supported versions Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- packages/sandbox/script/downloadReleases.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sandbox/script/downloadReleases.js b/packages/sandbox/script/downloadReleases.js index da880514a7ba..fed19e4db7f1 100644 --- a/packages/sandbox/script/downloadReleases.js +++ b/packages/sandbox/script/downloadReleases.js @@ -64,13 +64,16 @@ export const supportedReleases = ["${supportedVersions.join('", "')}"] as const /** A type of all versions **/ export type ReleaseVersions = "${[possibleBeta, possibleRc, ...versions].join('" | "')}" +/** A type of supported versions **/ +export type SupportedReleaseVersions = "${supportedVersions.join('" | "')}" + /** Release information including dates **/ export interface ReleaseInfo { version: string date: string } -export const releaseInfo: Record = { +export const releaseInfo: Record = { ${releaseInfoEntries} } ` From 20f098dc28397e1ffc129f7673ec896138169833 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 22:40:56 +0000 Subject: [PATCH 5/5] Handle missing release dates with null instead of empty string - Changed date field in ReleaseInfo to allow null values - Updated script to use null for missing dates (e.g., beta/RC versions) - Improves type safety and explicit handling of missing data Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- packages/sandbox/script/downloadReleases.js | 7 ++++--- packages/sandbox/src/release_data.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/sandbox/script/downloadReleases.js b/packages/sandbox/script/downloadReleases.js index fed19e4db7f1..7fea8dea2123 100644 --- a/packages/sandbox/script/downloadReleases.js +++ b/packages/sandbox/script/downloadReleases.js @@ -50,8 +50,9 @@ const go = async () => { // Build release info object with dates const releaseInfoEntries = supportedVersions.map(v => { - const date = releaseDates[v] || "" - return ` "${v}": { version: "${v}", date: "${date}" }` + // Beta and RC versions might not have dates yet + const date = releaseDates[v] || null + return ` "${v}": { version: "${v}", date: ${date ? `"${date}"` : 'null'} }` }).join(",\n") const code = `// This is auto-generated by scripts/downloadReleases.js @@ -70,7 +71,7 @@ export type SupportedReleaseVersions = "${supportedVersions.join('" | "')}" /** Release information including dates **/ export interface ReleaseInfo { version: string - date: string + date: string | null } export const releaseInfo: Record = { diff --git a/packages/sandbox/src/release_data.ts b/packages/sandbox/src/release_data.ts index 051a3277557f..ec507785d0aa 100644 --- a/packages/sandbox/src/release_data.ts +++ b/packages/sandbox/src/release_data.ts @@ -5,7 +5,7 @@ export type ReleaseVersions = "3.1.8" | "3.2.4" | "3.3.4000" | "3.4.5" | "3.5.3" export interface ReleaseInfo { version: string - date: string + date: string | null } export const releaseInfo: Record = {