From f8789753e98bfc285b67cf2f0d950fed763b451b Mon Sep 17 00:00:00 2001 From: Bashamega Date: Sat, 1 Nov 2025 08:32:32 +0200 Subject: [PATCH] Migrate deprecated json file to KDL --- inputfiles/deprecatedMessage.json | 7 ------- inputfiles/patches/deprecated.kdl | 4 ++++ src/build.ts | 20 -------------------- 3 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 inputfiles/deprecatedMessage.json create mode 100644 inputfiles/patches/deprecated.kdl diff --git a/inputfiles/deprecatedMessage.json b/inputfiles/deprecatedMessage.json deleted file mode 100644 index 96b2c7b21..000000000 --- a/inputfiles/deprecatedMessage.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "MutationEvent": "DOM4 [DOM] provides a new mechanism using a MutationObserver interface which addresses the use cases that mutation events solve, but in a more performant manner. Thus, this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of the MutationEvent interface.", - "PerformanceTiming": "This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.", - "PerformanceNavigation": "This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.", - "AudioProcessingEvent": "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.", - "ScriptProcessorNode": "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)." -} diff --git a/inputfiles/patches/deprecated.kdl b/inputfiles/patches/deprecated.kdl new file mode 100644 index 000000000..e553c9a03 --- /dev/null +++ b/inputfiles/patches/deprecated.kdl @@ -0,0 +1,4 @@ +interface PerformanceTiming deprecated="This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead." +interface PerformanceNavigation deprecated="This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead." +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." +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)." diff --git a/src/build.ts b/src/build.ts index f22b8fe82..900963a82 100644 --- a/src/build.ts +++ b/src/build.ts @@ -96,7 +96,6 @@ async function emitDom() { const addedItems = await readInputJSON("addedTypes.jsonc"); const patches = await readPatches(); const comments = await readInputJSON("comments.json"); - const deprecatedInfo = await readInputJSON("deprecatedMessage.json"); const documentationFromMDN = await generateDescriptions(); const removedItems = await readInputJSON("removedTypes.jsonc"); @@ -152,24 +151,6 @@ async function emitDom() { return idl; } - function mergeDeprecatedMessage( - idl: Browser.WebIdl, - descriptions: Record, - ) { - const namespaces = arrayToMap( - idl.namespaces!, - (i) => i.name, - (i) => i, - ); - for (const [key, value] of Object.entries(descriptions)) { - const target = idl.interfaces!.interface[key] || namespaces[key]; - if (target) { - target.deprecated = value; - } - } - return idl; - } - /// Load the input file let webidl: Browser.WebIdl = { events: await getInterfaceToEventMap(), @@ -242,7 +223,6 @@ async function emitDom() { webidl = merge(webidl, overriddenItems); webidl = merge(webidl, patches); webidl = merge(webidl, comments); - webidl = mergeDeprecatedMessage(webidl, deprecatedInfo); for (const name in webidl.interfaces!.interface) { const i = webidl.interfaces!.interface[name]; if (i.overrideExposed) {