Commit 413dd66
authored
Feature table redesign (#498)
### Preview
Online: https://wasm-website-preview.pages.dev/features/
### Motivation
1. As discussed in #495, the feature table is continuously growing (more
runtimes & tools). Some kind of redesign was needed to keep the column
count reasonable.
1. The old implementation (mostly written by me) is plain JS that builds
the DOM in an ad-hoc way. It has a lot of moving parts tangled together
(feature detection, async loading, tooltip logic w/ timers, footnote
mappings, etc). It's becoming frustrating to extend, and it's designed
to "generate once" which fits poorly for dynamic behavior. A small
templating solution would greatly improve maintainability.
1. The current UI relies on Wikipedia-style tooltips for notes, which I
now think are a poor fit:.
- Every cell has a tooltip that appears on hover and tends to "capture"
the cursor when moving between cells.
- Having a giant list of every note after the table is unwieldy and
unnecessary. It reads like a bibliography, and it's growing in length.
- Semantically speaking, the cells and their notes should be strongly
associated, contrary to a "reference" relationship.
- Keyboard navigation: only cells with footnotes are tabbable, which
feels a bit inconsistent. Not sure if this is actually a problem for
Assistive Technology users though.
### Design decisions
- **Filtering** (addressing motivation 1): this PR uses checkboxes to
toggle column categories (`Web Browsers`, `Standalone Runtimes`,
`Tools`). While this does the job for now, I'm not super in love with
this design and would welcome ideas.
- Categories are hard to balance: `Standalone Runtimes` currently
dominate while the others are sparse. This would worsen as more runtimes
are added.
- It's tricky to make the categories balanced. Right now, `Standalone
Runtimes` have too many columns and the other two too few. We would
still run into the columns problem in the future, when there're more
server runtimes added.
- Multiple stacked tables isn't great, the page is already very long
vertically.
- Multiple pages would hurt discoverability and prevent cross-category
comparison. And it doesn't address the unbalanced problem.
- **Visual style** (addressing motivation 3): heavily "inspired" by
MDN's browser compatibility table
([example](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#browser_compatibility)).
Their design works really well here. I emulated the look & feel without
looking at their code, so I think it should avoid license issues?
Otherwise, since their site uses MPL, a file-based copyleft license, we
can make the relevant files MPL to be extra safe.
- **JS framework** (addressing motivation 2): I used
[Alpine.js](https://alpinejs.dev/) as a minimal framework, because it is
the only option AFAIK that doesn't require a (JS-based) build step. Our
current build process is Ruby-based and hasn't been touched in 8+ years,
so I didn't dare to make changes. Let me know if we'd like to explore
alternative approaches.
### Current status
~~I'd appreciate early feedback on whether the overall direction looks
reasonable. I know large changes can be difficult to review with the
project's limited bandwidth. If an incremental path would be preferable,
I'm happy to take that route instead. I just don't have a clear idea to
do this cleanly under the constraint of the existing code, so
suggestions are very welcome.~~ Thanks everyone for the input!
This is ready for review.
Since `feature.js` is a wholesale rewrite, it's recommended to look at
the new file rather than the messy diff.1 parent bc8ba2d commit 413dd66
File tree
15 files changed
+1328
-740
lines changed- _includes
- css
- images
- js
15 files changed
+1328
-740
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
0 commit comments