Skip to content

Commit

Permalink
Track and update all the implemented features (#390)
Browse files Browse the repository at this point in the history
After seeing https://labs.leaningtech.com/blog/branch-hinting yesterday,
I was quite surprised to read that not only is this proposal done, but
it's also implemented in all the browsers, and yet it's not even tracked
in the `features.json` file.

So I took it upon myself to make sure that all features that are in at
least phase 2  are tracked and up to date. 

With there being a lot more proposals that are being tracked now, I
thought it would also make sense to properly reflect the phases on the
website, instead of splitting them into just two sections.
  • Loading branch information
CryZe authored Aug 12, 2024
1 parent e910242 commit a729442
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 58 deletions.
31 changes: 12 additions & 19 deletions features.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
(async () => {
'use strict';

function partitionArray(arr, condition) {
const matched = [];
const unmatched = [];

for (const item of arr) {
if (condition(item)) {
matched.push(item);
} else {
unmatched.push(item);
}
}

return { matched, unmatched };
}

function h(name, props = {}, children = []) {
const node = Object.assign(document.createElement(name), props);
node.append(...children);
Expand Down Expand Up @@ -76,14 +61,18 @@
tBody
);

let featureGroups = partitionArray(
let featureGroups = Object.groupBy(
Object.entries(features).map(([name, feature]) => Object.assign(feature, { name })),
feature => feature.phase >= 4
f => f.phase,
);

featureGroups = [
{ name: 'Standardized features', features: featureGroups.matched },
{ name: 'In-progress proposals', features: featureGroups.unmatched },
{ name: 'Phase 5 - The Feature is Standardized', features: featureGroups[5] },
{ name: 'Phase 4 - Standardize the Feature', features: featureGroups[4] },
{ name: 'Phase 3 - Implementation Phase', features: featureGroups[3] },
{ name: 'Phase 2 - Proposed Spec Text Available', features: featureGroups[2] },
{ name: 'Phase 1 - Feature Proposal', features: featureGroups[1] },
{ name: 'Deprecated', features: featureGroups["deprecated"] },
];

// Collect all notes and assign an index to each unique item
Expand Down Expand Up @@ -120,6 +109,10 @@
const columnCount = 2 + Object.keys(browsers).length;

for (const { name: groupName, features } of featureGroups) {
if (!features) {
continue;
}

tBody.append(
h('tr', {}, [
h('th', {
Expand Down
Loading

0 comments on commit a729442

Please sign in to comment.