Page MenuHomePhabricator

Convert startup blacklist to feature test
Closed, ResolvedPublic

Description

Preable

Wikimedia wikis page views (February 2016):

TotalGrade AGrade XGrade C
100.00%86.27%9.16%4.58%
16002 M13804 M1465 M732 M
  • Grade C: Browsers we've identified as not supporting our JavaScript run time. Officially supported, as noscript. (e.g. IE 8, Opera Mini)
  • Grade A: Browsers passing the startup sniffer, get JS, and we officially support them. (e.g. Chrome, IE9+)
  • Grade X: Browsers passing the startup sniffer, get JS, but we don't officially support them (e.g. Iceweasel, UC Browser, Yandex).

There is no technical distinction made between Grade A and X. Just that we don't regularly test in Grade X browsers, nor prioritise issues specific to those. More details at https://www.mediawiki.org/wiki/Compatibility#Browsers.

We currently split between Grade C and Grade A+X by sniffing for Grade C user agent strings. This blacklist is getting rather long. Once upon a time it was just IE <= 5, but it's grown much larger since. (see startup.js#isCompatible)

Reasons

Converting to a feature test would:

  • ... shrink this critical code path (T127328).
  • ... make it more maintainable.
  • ... give the blacklist a lot more meaning. Allowing us to confidently use features without conditionals or theoretical fallbacks.
  • ... older versions of browsers that we no longer support will automatically fall in the right category.

A small set of feature tests would effectively cut Grade C the same way as our user agent sniffer. It would also make it easier to, in the future, turn off javascript for non-ES5 browsers by simply adding a one-line feature test for it.

This article about BBC web developers "cutting the mustard" reminded me of the important of feature detection:
http://responsivenews.co.uk/post/18948466399/cutting-the-mustard

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle subscribed.
Krinkle triaged this task as High priority.Jul 8 2015, 2:05 PM
Krinkle set Security to None.
Krinkle moved this task from Inbox to Accepted Enhancement on the MediaWiki-ResourceLoader board.

Change 218955 had a related patch set uploaded (by Krinkle):
[WIP] resourceloader: Use feature test instead of UA sniffing

https://gerrit.wikimedia.org/r/218955

Krinkle lowered the priority of this task from High to Medium.Sep 4 2015, 2:54 AM
Krinkle renamed this task from Convert (most) of the startup browser blacklist to feature detection to Convert (most) of the startup blacklist to feature detection.Apr 5 2016, 3:04 AM

Per T128924 and https://grafana-admin.wikimedia.org/dashboard/db/resourceloader-feature-test?from=1460491145348&to=1460923145349. Results after 7 days of 1:1000 logging on all page views:

  • Average per minute: 99.96% (lowest: 99.74%, highest: 100%)
  • Total: 126 failed / 32,159 passed.

Change 218955 merged by jenkins-bot:
resourceloader: Use feature test instead of UA sniffing

https://gerrit.wikimedia.org/r/218955

Krinkle renamed this task from Convert (most) of the startup blacklist to feature detection to Convert startup blacklist to feature test.Apr 18 2016, 9:12 PM
Krinkle closed this task as Resolved.