Skip to content

Commit 1e15d5c

Browse files
authored
Migrate deprecated json file to KDL (microsoft#2214)
1 parent e507064 commit 1e15d5c

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

inputfiles/deprecatedMessage.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

inputfiles/patches/deprecated.kdl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface PerformanceTiming deprecated="This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead."
2+
interface PerformanceNavigation deprecated="This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead."
3+
interface AudioProcessingEvent deprecated="As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet."
4+
interface ScriptProcessorNode deprecated="As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and was replaced by AudioWorklet (see AudioWorkletNode)."

src/build.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ async function emitDom() {
9696
const addedItems = await readInputJSON("addedTypes.jsonc");
9797
const patches = await readPatches();
9898
const comments = await readInputJSON("comments.json");
99-
const deprecatedInfo = await readInputJSON("deprecatedMessage.json");
10099
const documentationFromMDN = await generateDescriptions();
101100
const removedItems = await readInputJSON("removedTypes.jsonc");
102101

@@ -143,24 +142,6 @@ async function emitDom() {
143142
return idl;
144143
}
145144

146-
function mergeDeprecatedMessage(
147-
idl: Browser.WebIdl,
148-
descriptions: Record<string, string>,
149-
) {
150-
const namespaces = arrayToMap(
151-
idl.namespaces!,
152-
(i) => i.name,
153-
(i) => i,
154-
);
155-
for (const [key, value] of Object.entries(descriptions)) {
156-
const target = idl.interfaces!.interface[key] || namespaces[key];
157-
if (target) {
158-
target.deprecated = value;
159-
}
160-
}
161-
return idl;
162-
}
163-
164145
/// Load the input file
165146
let webidl: Browser.WebIdl = {
166147
events: await getInterfaceToEventMap(),
@@ -233,7 +214,6 @@ async function emitDom() {
233214
webidl = merge(webidl, overriddenItems);
234215
webidl = merge(webidl, patches);
235216
webidl = merge(webidl, comments);
236-
webidl = mergeDeprecatedMessage(webidl, deprecatedInfo);
237217
for (const name in webidl.interfaces!.interface) {
238218
const i = webidl.interfaces!.interface[name];
239219
if (i.overrideExposed) {

0 commit comments

Comments
 (0)