Skip to content

Commit

Permalink
Add spec version to roadmap
Browse files Browse the repository at this point in the history
  • Loading branch information
andylizi committed May 11, 2023
1 parent e6fc462 commit 835ca06
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
30 changes: 20 additions & 10 deletions features.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"description": "JS BigInt to Wasm i64 integration",
"url": "https://github.com/WebAssembly/JS-BigInt-integration",
"phase": 5,
"stdznDate": "2020-06-09"
"stdznDate": "2020-06-09",
"specVersion": "2.0"
},
"bulkMemory": {
"description": "Bulk memory operations",
"url": "https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md",
"phase": 5,
"stdznDate": "2021-02-10"
"stdznDate": "2021-02-10",
"specVersion": "2.0"
},
"exceptions": {
"description": "Exception handling",
Expand All @@ -22,7 +24,8 @@
"description": "Extended constant expressions",
"url": "https://github.com/WebAssembly/extended-const/blob/master/proposals/extended-const/Overview.md",
"phase": 4,
"stdznDate": "2023-01-31"
"stdznDate": "2023-01-31",
"specVersion": "2.0"
},
"gc": {
"description": "Garbage collection",
Expand All @@ -43,19 +46,22 @@
"description": "Multi-value",
"url": "https://github.com/WebAssembly/spec/blob/master/proposals/multi-value/Overview.md",
"phase": 4,
"stdznDate": "2020-03-11"
"stdznDate": "2020-03-11",
"specVersion": "2.0"
},
"mutableGlobals": {
"description": "Mutable globals",
"url": "https://github.com/WebAssembly/mutable-global/blob/master/proposals/mutable-global/Overview.md",
"phase": 5,
"stdznDate": "2018-06-06"
"stdznDate": "2018-06-06",
"specVersion": "1.0"
},
"referenceTypes": {
"description": "Reference types",
"url": "https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md",
"phase": 5,
"stdznDate": "2021-02-10"
"stdznDate": "2021-02-10",
"specVersion": "2.0"
},
"relaxedSimd": {
"description": "Relaxed SIMD",
Expand All @@ -66,25 +72,29 @@
"description": "Non-trapping float-to-int conversions",
"url": "https://github.com/WebAssembly/spec/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md",
"phase": 5,
"stdznDate": "2020-03-11"
"stdznDate": "2020-03-11",
"specVersion": "2.0"
},
"signExtensions": {
"description": "Sign-extension operations",
"url": "https://github.com/WebAssembly/spec/blob/master/proposals/sign-extension-ops/Overview.md",
"phase": 5,
"stdznDate": "2020-03-11"
"stdznDate": "2020-03-11",
"specVersion": "2.0"
},
"simd": {
"description": "Fixed-width SIMD",
"url": "https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md",
"phase": 5,
"stdznDate": "2021-07-14"
"stdznDate": "2021-07-14",
"specVersion": "2.0"
},
"tailCall": {
"description": "Tail calls",
"url": "https://github.com/WebAssembly/tail-call/blob/master/proposals/tail-call/Overview.md",
"phase": 4,
"stdznDate": "2023-01-17"
"stdznDate": "2023-01-17",
"specVersion": "2.0"
},
"threads": {
"description": "Threads and atomics",
Expand Down
9 changes: 5 additions & 4 deletions features.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"feature-info": {
"type": "object",
"properties": {
"description": { "type": "string" },
"description": { "type": "string", "minLength": 1 },
"url": { "type": "string", "format": "uri-reference" },
"phase": { "enum": [1, 2, 3] }
},
Expand All @@ -17,13 +17,14 @@
"feature-info-standardized": {
"type": "object",
"properties": {
"description": { "type": "string" },
"description": { "type": "string", "minLength": 1 },
"url": { "type": "string", "format": "uri-reference" },
"phase": { "enum": [4, 5] },
"stdznDate": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" }
"stdznDate": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
"specVersion": { "type": "string", "minLength": 1 }
},
"additionalProperties": false,
"required": ["description", "url", "phase", "stdznDate"]
"required": ["description", "url", "phase", "stdznDate", "specVersion"]
},
"browser-features": {
"type": "object",
Expand Down
29 changes: 15 additions & 14 deletions roadmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ const __feature_table_error_handler = (e) => {
}, [groupName])
])
);
for (const { name: featName, description, url, phase, stdznDate } of features) {
for (const feat of features) {
// Feature detection for "Your browser"
const detectResult = h('td', {
headers: [idMap['table-col']('Your browser'), idMap['table-row'](featName)].join(' ')
headers: [idMap['table-col']('Your browser'), idMap['table-row'](feat.name)].join(' ')
}, [buildCellInner('loading')]);

detectWasmFeature(featName).then(supported => {
detectWasmFeature(feat.name).then(supported => {
detectResult.textContent = '';
detectResult.appendChild(buildCellInner(supported ? 'yes' : 'no'));
return addTooltip(detectResult, supported ? '✓ Supported' : '✗ Not supported', [tBody, scrollbox]);
Expand All @@ -163,13 +163,13 @@ const __feature_table_error_handler = (e) => {
});

// Feature name and it's tooltip
const featureLink = h('a', { href: url, target: '_blank' }, [description]);
const featureLink = h('a', { href: feat.url, target: '_blank' }, [feat.description]);
const featureHeader = h('th', {
scope: 'row',
id: idMap['table-row'](featName),
id: idMap['table-row'](feat.name),
headers: idMap['table-group'](groupName)
}, [featureLink]);
addTooltip(featureLink, buildFeatureTooltip(phase, stdznDate), [scrollbox], featureHeader);
addTooltip(featureLink, buildFeatureTooltip(feat), [scrollbox], featureHeader);

tBody.append(
h('tr', {}, [
Expand All @@ -186,7 +186,7 @@ const __feature_table_error_handler = (e) => {
// ...and any combination thereof

/** @type {null|boolean|string|[boolean|string,string]} */
let support = features[featName];
let support = features[feat.name];
let box, note;

// First extract the footnote part if it's an array
Expand Down Expand Up @@ -226,7 +226,7 @@ const __feature_table_error_handler = (e) => {
}

const cell = h('td', {
headers: [idMap['table-col'](browserName), idMap['table-row'](featName)].join(' ')
headers: [idMap['table-col'](browserName), idMap['table-row'](feat.name)].join(' ')
}, [box]);

// Give the cell itself an `aria-lebel` to avoid screen readers calling it "empty cell".
Expand Down Expand Up @@ -257,7 +257,7 @@ const __feature_table_error_handler = (e) => {
})
])
);
tBody.lastElementChild.setAttribute('aria-describedby', idMap['table-row'](featName));
tBody.lastElementChild.setAttribute('aria-describedby', idMap['table-row'](feat.name));
}
}

Expand All @@ -266,14 +266,15 @@ const __feature_table_error_handler = (e) => {
return h('div', { className: `feature-cell icon-${type}` }, [content]);
}

function buildFeatureTooltip(phase, date) {
if (date) {
function buildFeatureTooltip(feat) {
if (feat.stdznDate) {
const fragment = document.createDocumentFragment();
fragment.append(`Phase ${phase} proposal, standardized on `);
fragment.append(h('time', { dateTime: date }, [date]));
fragment.append(`Phase ${feat.phase} proposal, standardized on `);
fragment.append(h('time', { dateTime: feat.stdznDate }, [feat.stdznDate]));
fragment.append(` as part of WebAssembly ${feat.specVersion}`);
return fragment;
} else {
return `Phase ${phase} proposal`
return `Phase ${feat.phase} proposal`
}
}

Expand Down

0 comments on commit 835ca06

Please sign in to comment.