Skip to content

Commit 10c3b8a

Browse files
authored
feat(update-browser-releases): use new Edge release note urls (#26481)
* fix(update-browser-releases): avoid iterating false Running `npm run update-browser-releases -- --edge` was failing. * fix(update-browser-releases): ensure engine_version is set as string * feat(update-browser-releases): use new Edge release note urls * Update Edge 133-136 release notes
1 parent f793113 commit 10c3b8a

File tree

4 files changed

+47
-134
lines changed

4 files changed

+47
-134
lines changed

browsers/edge.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,26 +430,28 @@
430430
},
431431
"133": {
432432
"release_date": "2025-02-06",
433-
"release_notes": "https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-stable-channel#version-1330306551-february-6-2025",
433+
"release_notes": "https://learn.microsoft.com/en-us/microsoft-edge/web-platform/release-notes/133",
434434
"status": "retired",
435435
"engine": "Blink",
436436
"engine_version": "133"
437437
},
438438
"134": {
439439
"release_date": "2025-03-06",
440-
"release_notes": "https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-stable-channel#version-1340312451-march-6-2025",
440+
"release_notes": "https://learn.microsoft.com/en-us/microsoft-edge/web-platform/release-notes/134",
441441
"status": "retired",
442442
"engine": "Blink",
443443
"engine_version": "134"
444444
},
445445
"135": {
446446
"release_date": "2025-04-04",
447+
"release_notes": "https://learn.microsoft.com/en-us/microsoft-edge/web-platform/release-notes/135",
447448
"status": "current",
448449
"engine": "Blink",
449450
"engine_version": "135"
450451
},
451452
"136": {
452453
"release_date": "2025-05-01",
454+
"release_notes": "https://learn.microsoft.com/en-us/microsoft-edge/web-platform/release-notes/136",
453455
"status": "nightly",
454456
"engine": "Blink",
455457
"engine_version": "136"

scripts/update-browser-releases/edge.ts

Lines changed: 16 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,6 @@ import stringify from '../lib/stringify-and-order-properties.js';
99

1010
import { newBrowserEntry, updateBrowserEntry } from './utils.js';
1111

12-
//
13-
// Content of the two release note files
14-
//
15-
let releaseNotesText;
16-
let archivedReleaseNotesText;
17-
18-
/**
19-
* initReleaseNoteFiles - Fetch both release notes file and store them
20-
* @returns Logs (error messages)
21-
*/
22-
const initReleaseNoteFiles = async () => {
23-
let result = '';
24-
25-
// Fetch the regular page1
26-
const releaseNote = await fetch(
27-
'https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-stable-channel',
28-
);
29-
30-
// Check that it exists, if not exit.
31-
if (releaseNote.status != 200) {
32-
// File not found -> log a warning
33-
result = chalk`{red \nRelease note files not found for Edge (${releaseNote.status}).`;
34-
} else {
35-
releaseNotesText = await releaseNote.text();
36-
}
37-
38-
// Fetch the archived page
39-
const archivedReleaseNotes = await fetch(
40-
'https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-archive-stable-channel',
41-
);
42-
if (archivedReleaseNotes.status != 200) {
43-
// File not found -> log a warning
44-
result += chalk`{red \nArchive release note files not found for Edge (${archivedReleaseNotes.status}).`;
45-
} else {
46-
archivedReleaseNotesText = await archivedReleaseNotes.text();
47-
}
48-
49-
return result;
50-
};
51-
52-
/**
53-
* updateReleaseNotesIfArchived - Return the new release notes URL to use
54-
* @param originalURL The URL that is currently used
55-
* @returns The new URL to use (eventually the same)
56-
*/
57-
const updateReleaseNotesIfArchived = (originalURL) => {
58-
const id = originalURL.split('#')[1];
59-
60-
// Test if the original URL still works
61-
// If the files doesn't exist or the id not found in the archive
62-
// Keep the original file
63-
if (
64-
!id ||
65-
!releaseNotesText ||
66-
releaseNotesText.indexOf(`<h2 id="${id}">`) != -1 ||
67-
!archivedReleaseNotesText ||
68-
archivedReleaseNotesText.indexOf(`<h2 id="${id}">`) == -1
69-
) {
70-
return originalURL; // We keep the original URL
71-
}
72-
// Return the archived entry.
73-
return `https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-archive-stable-channel#${id}`;
74-
};
75-
7612
/**
7713
* getFutureReleaseDate - Read the future release date
7814
* @param release The release number of the version
@@ -126,47 +62,24 @@ const getFutureReleaseDate = async (release, releaseScheduleURL) => {
12662
/**
12763
* getReleaseNotesURL - Guess the URL of the release notes
12864
* @param status The status of the release
129-
* @param fullRelease The release of the release
130-
* @param date The date of the release
65+
* @param version The major version of the release
13166
* @returns The URL of the release notes or the empty string if not found
132-
* Throws a string in case of error
67+
* @throws a string in case of error
13368
*/
134-
const getReleaseNotesURL = async (status, fullRelease, date) => {
135-
// If the status isn't stable, do not give back any release notes.
136-
if (status !== 'Stable') {
137-
return '';
138-
}
69+
const getReleaseNotesURL = async (status, version) => {
70+
const url = `https://learn.microsoft.com/en-us/microsoft-edge/web-platform/release-notes/${version}`;
13971

140-
// Calculate the URL
141-
const releaseStr = fullRelease.replace(/\./g, '');
142-
const month = [
143-
'january',
144-
'february',
145-
'march',
146-
'april',
147-
'may',
148-
'june',
149-
'july',
150-
'august',
151-
'september',
152-
'october',
153-
'november',
154-
'december',
155-
];
156-
const dateObj = new Date(date);
157-
const dateStr = `${
158-
month[dateObj.getMonth()]
159-
}-${dateObj.getDate()}-${dateObj.getFullYear()}`;
160-
161-
// Check if the id exists
162-
if (
163-
releaseNotesText.indexOf(`<h2 id="version-${releaseStr}-${dateStr}">`) == -1
164-
) {
165-
// Section not found -> log a warning
166-
throw chalk`{red \nSection not found in official release notes for Edge ${fullRelease}}`;
72+
const releaseNote = await fetch(url);
73+
74+
if (releaseNote.status != 200) {
75+
if (status !== 'Stable') {
76+
return '';
77+
}
78+
79+
throw chalk`{red \nFailed to fetch Edge ${version} release notes at ${url}!}`;
16780
}
16881

169-
return `https://learn.microsoft.com/en-us/deployedge/microsoft-edge-relnote-stable-channel#version-${releaseStr}-${dateStr}`;
82+
return url;
17083
};
17184

17285
/**
@@ -175,10 +88,7 @@ const getReleaseNotesURL = async (status, fullRelease, date) => {
17588
* @returns The log of what has been generated (empty if nothing)
17689
*/
17790
export const updateEdgeReleases = async (options) => {
178-
//
179-
// Read the release note files
180-
//
181-
let result = await initReleaseNoteFiles();
91+
let result = '';
18292

18393
//
18494
// Get the JSON with the versions from edge releases
@@ -270,11 +180,7 @@ export const updateEdgeReleases = async (options) => {
270180
// Get the release notes
271181
let releaseNotesURL = '';
272182
try {
273-
releaseNotesURL = await getReleaseNotesURL(
274-
value,
275-
data[value].fullVersion,
276-
data[value].versionDate,
277-
);
183+
releaseNotesURL = await getReleaseNotesURL(value, data[value].version);
278184
} catch (s) {
279185
result += s;
280186
}
@@ -325,10 +231,7 @@ export const updateEdgeReleases = async (options) => {
325231
edgeBCD.browsers[options.bcdBrowserName].releases[i.toString()]
326232
.release_date,
327233
'retired',
328-
updateReleaseNotesIfArchived(
329-
edgeBCD.browsers[options.bcdBrowserName].releases[i.toString()]
330-
.release_notes,
331-
),
234+
'',
332235
'',
333236
);
334237
} else {

scripts/update-browser-releases/index.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -220,27 +220,35 @@ const options = {
220220
};
221221

222222
const results = await Promise.all([
223-
...(updateChrome && [
224-
updateDesktop && updateChromiumReleases(options.chrome_desktop),
225-
updateMobile && updateChromiumReleases(options.chrome_android),
226-
]),
223+
...(updateChrome
224+
? [
225+
updateDesktop && updateChromiumReleases(options.chrome_desktop),
226+
updateMobile && updateChromiumReleases(options.chrome_android),
227+
]
228+
: []),
227229
updateWebview &&
228230
updateMobile &&
229231
updateChromiumReleases(options.webview_android),
230232
updateEdge && updateDesktop && updateEdgeReleases(options.edge_desktop),
231-
...(updateFirefox && [
232-
updateDesktop && updateFirefoxReleases(options.firefox_desktop),
233-
updateMobile && updateFirefoxReleases(options.firefox_android),
234-
]),
235-
...(updateOpera && [
236-
updateDesktop && updateOperaReleases(options.opera_desktop),
237-
updateMobile && updateOperaReleases(options.opera_android),
238-
]),
239-
...(updateSafari && [
240-
updateDesktop && updateSafariReleases(options.safari_desktop),
241-
updateMobile && updateSafariReleases(options.safari_ios),
242-
updateMobile && updateSafariReleases(options.webview_ios),
243-
]),
233+
...(updateFirefox
234+
? [
235+
updateDesktop && updateFirefoxReleases(options.firefox_desktop),
236+
updateMobile && updateFirefoxReleases(options.firefox_android),
237+
]
238+
: []),
239+
...(updateOpera
240+
? [
241+
updateDesktop && updateOperaReleases(options.opera_desktop),
242+
updateMobile && updateOperaReleases(options.opera_android),
243+
]
244+
: []),
245+
...(updateSafari
246+
? [
247+
updateDesktop && updateSafariReleases(options.safari_desktop),
248+
updateMobile && updateSafariReleases(options.safari_ios),
249+
updateMobile && updateSafariReleases(options.webview_ios),
250+
]
251+
: []),
244252
]);
245253

246254
const result = results.filter(Boolean).join('\n\n');

scripts/update-browser-releases/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const newBrowserEntry = (
4646
release['status'] = status;
4747
release['engine'] = engine;
4848
if (engineVersion) {
49-
release['engine_version'] = engineVersion;
49+
release['engine_version'] = engineVersion.toString();
5050
}
5151
return chalk`{yellow \n- New release detected for {bold ${browser}}: Version {bold ${version}} as a {bold ${status}} release.}`;
5252
};
@@ -88,7 +88,7 @@ export const updateBrowserEntry = (
8888

8989
if (engineVersion && entry['engine_version'] != engineVersion) {
9090
result += chalk`{cyan \n- New engine version for {bold ${browser} ${version}}: {bold ${engineVersion}}, previously ${entry['engine_version']}.}`;
91-
entry['engine_version'] = engineVersion;
91+
entry['engine_version'] = engineVersion.toString();
9292
}
9393

9494
return result;

0 commit comments

Comments
 (0)