From 46508d9a4bbf85fcbb319400dd7105a8a114532a Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 23 May 2018 12:32:24 -0700 Subject: [PATCH 1/2] Minify status entry in browser.ts. Fix #94 --- build/mdn-data-importer.js | 14 +- src/data/browsers.ts | 918 +++++++++++++++++----------------- src/services/languageFacts.ts | 24 +- 3 files changed, 490 insertions(+), 466 deletions(-) diff --git a/build/mdn-data-importer.js b/build/mdn-data-importer.js index 1b8c0041..90d55229 100644 --- a/build/mdn-data-importer.js +++ b/build/mdn-data-importer.js @@ -70,11 +70,23 @@ function buildPropertiesWithMDNData(vscProperties) { */ function extractMDNProperties(mdnEntry) { return { - status: mdnEntry.status, + status: abbreviateStatus(mdnEntry.status), syntax: mdnEntry.syntax } } +/** + * Make syntax as small as possible for browser usage + */ +function abbreviateStatus(status) { + return { + standard: 's', + nonstandard: 'n', + experimental: 'e', + obsolete: 'o' + }[status]; +} + module.exports = { buildPropertiesWithMDNData } diff --git a/src/data/browsers.ts b/src/data/browsers.ts index 720d3ea1..037a7c89 100644 --- a/src/data/browsers.ts +++ b/src/data/browsers.ts @@ -772,7 +772,7 @@ export const data : any = { desc: "@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.", browsers: "FF33", restriction: "integer, string, image, identifier", - "status": "standard", + "status": "s", "syntax": "[ && ]#" }, { @@ -806,7 +806,7 @@ export const data : any = { desc: "Lines stretch to take up the remaining space." } ], - "status": "standard", + "status": "s", "syntax": "normal | | | ? " }, { @@ -836,7 +836,7 @@ export const data : any = { desc: "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." } ], - "status": "standard", + "status": "s", "syntax": "normal | stretch | | [ ? ]" }, { @@ -904,7 +904,7 @@ export const data : any = { name: "legacy" } ], - "status": "standard", + "status": "s", "syntax": "normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]" }, { @@ -969,7 +969,7 @@ export const data : any = { name: "unsave" } ], - "status": "standard", + "status": "s", "syntax": "auto | normal | stretch | | ? [ | left | right ]" }, { @@ -1003,7 +1003,7 @@ export const data : any = { desc: "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." } ], - "status": "standard", + "status": "s", "syntax": "auto | normal | stretch | | ? " }, { @@ -1012,7 +1012,7 @@ export const data : any = { browsers: "C37,FF27,O24", restriction: "enum", values: [], - "status": "standard", + "status": "s", "syntax": "initial | inherit | unset | revert" }, { @@ -1061,7 +1061,7 @@ export const data : any = { desc: "All iterations of the animation are played in the reverse direction from the way they were specified." } ], - "status": "standard", + "status": "s", "syntax": "#" }, { @@ -1069,7 +1069,7 @@ export const data : any = { desc: "Defines when the animation will start.", browsers: "E,C43,FF16,IE10,O12.1,S9", restriction: "time", - "status": "standard", + "status": "s", "syntax": "