Minify JS/CSS comments; faster removal of boolean attr values; sorted generated JSON objects

This commit is contained in:
Wilson Lin 2020-01-08 11:40:06 +11:00
commit a9bb4c924f
7 changed files with 84 additions and 74 deletions

View file

@ -1,4 +1,13 @@
{
"allowfullscreen": [
"iframe"
],
"allowtransparency": [
"iframe"
],
"async": [
"script"
],
"autofocus": [
"button",
"input",
@ -6,6 +15,21 @@
"select",
"textarea"
],
"autoplay": [
"media"
],
"checked": [
"input"
],
"controls": [
"media"
],
"default": [
"track"
],
"defer": [
"script"
],
"disabled": [
"button",
"fieldset",
@ -16,32 +40,36 @@
"select",
"textarea"
],
"disablepictureinpicture": [
"video"
],
"formnovalidate": [
"button",
"input"
],
"loop": [
"media"
],
"multiple": [
"input",
"select"
],
"muted": [
"media"
],
"nomodule": [
"script"
],
"novalidate": [
"form"
],
"open": [
"details",
"dialog"
],
"novalidate": [
"form"
],
"allowfullscreen": [
"iframe"
],
"allowtransparency": [
"iframe"
],
"seamless": [
"iframe"
],
"checked": [
"input"
],
"multiple": [
"input",
"select"
"playsinline": [
"media",
"video"
],
"readonly": [
"input",
@ -52,44 +80,16 @@
"select",
"textarea"
],
"autoplay": [
"media"
],
"controls": [
"media"
],
"loop": [
"media"
],
"muted": [
"media"
],
"playsinline": [
"media",
"video"
],
"reversed": [
"ol"
],
"selected": [
"option"
],
"async": [
"script"
],
"defer": [
"script"
],
"nomodule": [
"script"
],
"scoped": [
"style"
],
"default": [
"track"
"seamless": [
"iframe"
],
"disablepictureinpicture": [
"video"
"selected": [
"option"
]
}

View file

@ -63,8 +63,9 @@ const processReactTypeDeclarations = async (source) => {
node.forEachChild(c => void unvisited.push(c));
}
// Sort output JSON object by property so diffs are clearer.
await fs.writeFile(BOOLEAN_ATTRS_PATH, JSON.stringify(
Object.fromEntries(booleanAttributes.entries()),
Object.fromEntries([...booleanAttributes.entries()].sort((a, b) => a[0].localeCompare(b[0]))),
null,
2,
));