-
Notifications
You must be signed in to change notification settings - Fork 440
Create deprecatedjson from mdn web #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
13b6f3a
be34ece
ef60cfd
48b4411
a21833a
0240e4c
a394ee1
8043c5f
e70931f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Current TS File", | ||
"type": "node", | ||
"request": "launch", | ||
"args": [ | ||
"${relativeFile}" | ||
], | ||
"runtimeArgs": [ | ||
"--nolazy", | ||
"-r", | ||
"ts-node/register" | ||
], | ||
"sourceMaps": true, | ||
"cwd": "${workspaceRoot}", | ||
"protocol": "inspector", | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"env": { | ||
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json" | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any automatic generator for this file. Is this file handcrafted? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it is created by a script. It is why I change the .gitignore file ---- I did add the template file, for running the script by vscode quickly. |
||
"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.", | ||
"SVGAltGlyphItemElement": "This interface was removed in the SVG 2 specification.\n", | ||
"PerformanceTiming": "This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.\n", | ||
"MouseScrollEvent": "Do not use this interface for wheel events.Like MouseWheelEvent, this interface is non-standard and deprecated. It was used in Gecko-based browsers only. Instead use the standard WheelEvent.\n", | ||
"SVGAltGlyphDefElement": "This interface was removed in the SVG 2 specification.\n", | ||
"SVGExternalResourcesRequired": "This interface was removed in the SVG 2 specification.\n", | ||
"SVGMatrix": "SVG 2 replaced the SVGMatrix interface by the more general DOMMatrix and DOMMatrixReadOnly interfaces.\n", | ||
"RTCSessionDescriptionCallback": "Because this function type is part of the legacy WebRTC API, you should avoid using it (and the callback-based forms of createOffer() and createAnswer() that make use of it).\n", | ||
"ServiceWorkerMessageEvent": "In modern browsers, this interface has been deprecated. Service worker messages will now use the MessageEvent interface, for consistency with other web messaging features.\n", | ||
"SVGRenderingIntent": "This interface was removed in the SVG 2 specification.\n", | ||
"PerformanceNavigation": "This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.\n", | ||
"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.\n", | ||
"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).\n", | ||
"SVGGlyphElement": "This interface was removed in the SVG 2 specification.\n", | ||
"MouseWheelEvent": "Do not use this interface for wheel events.Like MouseScrollEvent, this interface is non-standard and deprecated. It was used in non-Gecko browsers only. Instead use the standard WheelEvent.\n", | ||
"IDBDatabaseException": "This interface was removed from the specification and was replaced by usage of DOMException.\n", | ||
"NameList": "Although this interface was previously implemented in Gecko, there was no way to actually create one. NameList has been removed, effective with Gecko 10.0\n", | ||
"IDBDatabaseSync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"IDBEnvironment": "The indexedDB property that was previously defined in this mixin is instead now WindowOrWorkerGlobalScope.indexedDB (that is, defined as a member of the WindowOrWorkerGlobalScope mixin).\n", | ||
"IDBFactorySync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"IDBVersionChangeRequest": "The latest specification does not include this interface anymore as the IDBDatabase.setVersion() method has been removed. See the compatibility table for version details.The new way to do it is to use the IDBOpenDBRequest interface which has now the onblocked handler and the newly needed onupgradeneeded one.\n", | ||
"IDBIndexSync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"IDBTransactionSync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"IDBEnvironmentSync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"DOMLocator": "This is not implemented in Mozilla\n", | ||
"LocalMediaStream": "This interface is no longer available in any mainstream browser. Do not use LocalMediaStream; you need to update any code that does use it as soon as possible or your content or application will stop working. See Stopping a video stream in MediaStreamTrack to learn how. All other functionality is found in MediaStream.\n", | ||
"IDBObjectStoreSync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"BlobBuilder": "The BlobBuilder interface has been deprecated in favor of the newly introduced Blob constructor.\n", | ||
"IDBCursorSync": "The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.\n", | ||
"DOMConfiguration": "This interface has never been supported in Gecko, and has been removed from the DOM specification.\n", | ||
"FileError": "This interface is obsolete per the latest specification. Use the new DOM4 DOMError interface instead.\n" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# READ ME! | ||
All files in this folder aimes to be used by USER rather than CODE. | ||
ShuiRuTian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Users could have a quick view of some data. | ||
|
||
mdnDeprecatedApis.ts -- all api names marked as deprecated in `https://developer.mozilla.org/en-US/docs/Web/API` | ||
idlSourceAppearDeprecateText.ts -- check web pages in `inputfiles/idlSources.json`, to see whether there is text "deprecate" in the whole page. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import * as fs from "fs"; | ||
import * as path from "path"; | ||
import fetch from "node-fetch"; | ||
// import { JSDOM } from "jsdom"; | ||
|
||
interface IDLSource { | ||
url: string; | ||
title: string; | ||
deprecated?: boolean; | ||
local?: boolean; | ||
} | ||
|
||
async function fetchIDLs() { | ||
const idlSources = (require("../inputfiles/idlSources.json") as IDLSource[]); | ||
await Promise.all(idlSources.map(async source => { | ||
if (source.local) { | ||
return; | ||
} | ||
await fetchIDL(source); | ||
})).then( | ||
() => { | ||
fs.writeFileSync(path.join(__dirname, 'idlSourcePossiable.json'), JSON.stringify(Array.from(deprecatedSet))); | ||
} | ||
); | ||
} | ||
// ['https://www.w3.org/TR/css-color-3/', 'https://www.w3.org/TR/credential-management-1/', 'https://www.w3.org/TR/css-text-decor-3/', 'https://w3c.github.io/media-playback-quality/', 'https://www.w3.org/TR/css-text-3/', 'https://drafts.csswg.org/css-images-3/', 'https://www.w3.org/TR/secure-contexts/', 'https://www.w3.org/TR/SVG2/types.html', 'https://html.spec.whatwg.org/multipage/obsolete.html', 'https://notifications.spec.whatwg.org/', 'https://www.w3.org/TR/SVG2/text.html', 'https://fetch.spec.whatwg.org/', 'https://html.spec.whatwg.org/multipage/webappapis.html', 'https://dom.spec.whatwg.org/', 'https://drafts.fxtf.org/css-masking-1/', 'https://www.w3.org/TR/filter-effects-1/', 'https://drafts.csswg.org/cssom/', 'https://w3c.github.io/webrtc-pc/', 'https://webaudio.github.io/web-audio-api/', 'https://heycam.github.io/webidl/', 'https://www.w3.org/TR/SVG2/pservers.html', 'https://www.w3.org/TR/uievents/'] | ||
|
||
const tmpLocalFolder = path.join(__dirname, "localIdlSource"); | ||
const deprecatedSet = new Set<string>(); | ||
|
||
async function fetchIDL(source: IDLSource) { | ||
|
||
if (!fs.existsSync(tmpLocalFolder)) { | ||
fs.mkdirSync(tmpLocalFolder); | ||
} | ||
|
||
if (source.url.endsWith(".idl")) { | ||
return; | ||
} | ||
|
||
const localFile = path.join(tmpLocalFolder, source.title); | ||
let webPageContent: string; | ||
if (fs.existsSync(localFile)) { | ||
webPageContent = fs.readFileSync(localFile, { encoding: "utf-8" }); | ||
} | ||
else { | ||
const response = await fetch(source.url); | ||
webPageContent = await response.text(); | ||
fs.writeFileSync(localFile, webPageContent); | ||
} | ||
if (webPageContent.toLowerCase().includes("deprecated")) { | ||
deprecatedSet.add(source.url); | ||
} | ||
// const dom = JSDOM.fragment( | ||
// ""// webPageContent | ||
// ); | ||
|
||
} | ||
|
||
fetchIDLs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this does anything here 👀