MDN Changelog for January 2018
Here’s what happened in January to the code, data, and tools that support MDN Web Docs:
- Completed CSS compatibility data migration and more
- Shipped a new method for declaring language preference
- Increased availability of MDN
- Shipped tweaks and fixes by merging 326 pull requests, including 67 pull requests from 27 new contributors.
Here’s the plan for February:
Done in January
Completed CSS Compatibility Data Migration and More
Thanks to Daniel D. Beck and his 83 Pull Requests, the CSS compatibility data is migrated to the browser-compat-data repository. This finishes Daniel’s current contract, and we hope to get his help again soon.
The newly announced MDN Product Advisory Board supports the Browser Compatibility Data project, and members are working to migrate more data. In January, we saw an increase in contributions, many from first-time contributors. The migration work jumped from 39% to 43% complete in January. See the contribution guide to learn how to help.
On January 23, we turned on the new browser compatability tables for all users. The new presentation provides a good overview of feature support across desktop and mobile browsers, as well as JavaScript run-time environments like Node.js, while still letting implementors dive into the details.
Florian Scholz promoted the project with a blog post, and highlighted the compat-report addon by Eduardo Bouças that uses the data to highlight compatibility issues in a developer tools tab. Florian also gave a talk about the project on February 3 at FOSDEM 18. We’re excited to tell people about this new resource, and see what people will do with this data.
Shipped a New Method for Declaring Language Preference
If you use the language switcher on MDN, you’ll now be asked if you want to always view the site in that language. This was added by Safwan Rahman in PR 4321.
This preference goes into effect for our “locale-less” URLs. If you access
https://developer.mozilla.org/docs/Web/HTML, MDN uses your browser’s
preferred language, as set by the
Accept-Language
header. If it is set to Accept-Language: en-US,en;q=0.5
, then you’ll get
the English page at
https://developer.mozilla.org/en-US/docs/Web/HTML, while
Accept-Language: de-CH
will send you to the German page at
https://developer.mozilla.org/de/docs/Web/HTML.
If you’ve set a preference with this new dialog box, the
Accept-Language
header will be ignored and you’ll get your preferred
language for MDN.
This is useful for MDN visitors who like to browse the web in their native language, but read MDN in English, but it doesn’t fix the issue entirely. If a search engine thinks you prefer German, for instance, it will pick the German translations of MDN pages, and send you to https://developer.mozilla.org/de/docs/Web/HTML. MDN respects the link and shows the German page, and the new language preference is not used.
We hope this makes MDN a little easier to use, but more will be needed to satisfy those who get the “wrong” page. I’m not convinced there is a solution that will work for everyone. I’ve suggested a web extension in bug 1432826, to allow configurable redirects, but it is unclear if this is the right solution. We’ll keep thinking about translations, and adjusting to visitors’ preferences.
Increased Availability of MDN
MDN easily serves millions of visitors a month, but struggles under some traffic patterns, such as a single visitor requesting every page on the site. We continue to make MDN more reliable despite these traffic spikes, using several different strategies.
The most direct method is to limit the number of requests. We’ve updated our rate limiting to return the HTTP 429 “Too Many Requests” code (PR 4614), to more clearly communicate when a client hits these limits. Dave Parfitt automated bans for users making thousands of requests a minute, which is much more than legitimate scrapers.
Another strategy is to reduce the database load for each request, so that high traffic doesn’t slow down the database and all the page views. We’re reducing database usage by changing how async processes store state (PR 4615) and using long-lasting database connections to reduce time spent establishing per-request connections (PR 4644).
Safwan Rahman took a close look at the database usage for wiki pages, and made several changes to reduce both the number of queries and the size of the data transmitted from the database (PR 4630). This last change has significantly reduced the network traffic to the database.
All of these add up to a 10% to 15% improvement in server response time from December’s performance.
Ryan Johnson continued work on the long-term solution, to serve MDN content from a CDN. This requires getting our caching headers just right (PR 4638). We hope to start shipping this in February. At that point, a high-traffic user may still slow down the servers, but most people will quickly get their content from the CDN instead.
Shipped Tweaks and Fixes
There were 326 PRs merged in January:
- 156 mdn/browser-compat-data PRs
- 75 mdn/interactive-examples PRs
- 44 mozilla/kuma PRs
- 27 mdn/kumascript PRs
- 19 mozmeao/infra PRs
- 5 mdn/data PRs
67 of these were from first-time contributors:
- Update JS grammar compat data for Chrome (trailing commas for functions) (BCD PR 732), from Olivier Dony.
- Add classes compatibility with respect to Node.js (BCD PR 746), from Marc-Aurèle DARCHE.
- Add compat data for CanvasCaptureMediaStream (PR 829), CanvasGradient (PR 830), CanvasPattern (PR 832), CanvasRenderingContext2D (PR 851), HTMLCanvasElement (PR 880), ImageBitmap (PR 883), ImageBitmapRenderingContext (PR 885), ImageData (PR 891), Path2D (PR 893), and TextMetrics (PR 894), from Mark Boas (first contributions to BCD).
- Fix “RGB” typo to “RGBA” for the hex RGBA spec (BCD PR 835), from Yuval Greenfield.
- Update text-decoration-skip.json (BCD PR 836), from Paul Irish.
- Add data for Samsung Internet to font-face.json (BCD PR 840), from Ada Rose Cannon.
- Fix a typo in css.properties.justify-content (BCD PR 844), from Simon Chan.
- Edge doesn’t currently support requestBody for webRequest (BCD PR 860), from Neil Durbin.
- IE11 doesn’t support Map(iterable) constructor (BCD PR 874), from Jeff-Mott-OR.
- Update break-word (BCD PR 882, Data PR 164, and Interactive Examples PR 440), from CShepartd.
- nodejs ES module support flag info (BCD PR 903), from slikts.
- Fix parameter ordering Math.atan2 example (Interactive Examples PR 385), from Rhys Howell.
- Fixed the demo titles (Interactive Examples PR 401), from Ayush Gupta.
- Allow an empty commit for travis deploy (PR 410), from me (first contribution to Interactive Examples).
- Add demo for text-decoration-skip-ink (Interactive Examples PR 411), from Paul Irish.
- Typo fix
(PR 424),
Fix URL and missing comma
(PR 446),
Fix clipboard target ids
(PR 447),
Add
border-width
example (PR 448), Addborder-color
example (PR 465), Addoverflow-wrap
example (PR 472), Add<angle>
example (PR 473), Updateborder-style
example (PR 474), Addtext-transform
example (PR 475), Addborder-*-width
examples (PR 499), Addborder-*-color
examples (PR 501), Addborder-*-style
examples (PR 504), Addborder
examples (PR 511), Addoverflow-*
examples (PR 513), Add/updatebackground-position-*
examples (PR 514), and Addtext-decoration-color
example (PR 516), from mfluehr (first contributions to Interactive Examples). - Add demo for Array.toString() and Array.unshift(), Fixes #421 and #422 (PR 427), Add demo for Array.prototypes Fixes #420, #419 (PR 435), and Add demo for Array.prototypes Fixes #417 and #416 (PR 439), to Interactive Examples from Dhruv Jain.
- console.log support for multiple arguments (Interactive Examples PR 433), from Ivan Ng.
- Indents the break statements (Interactive Examples PR 437), from Mike Lissner.
- Enhance formatObject to support formatting actual object (PR 451), Add few examples (PR 458), Add .shorter css class for shorter JS examples (PR 462), and Reorganize live-examples folder (PR 500), to Interactive Examples from Kenrick.
- Add interactive demo for Array.forEach(). Fixes #413 (PR 452), and Add UTC set examples for Minutes,Milliseconds and Seconds (PR 459), to Interactive Examples from Raymond Lochner.
- Added examples for Array.prototype.reverse and Array.prototype.keys (Interactive Examples PR 460), from Anton Boyko.
- Add line-height CSS example
(PR 485),
Add text-decoration-line CSS example
(PR 487),
Fixed some (all?)
data-clipboard-target
for CSS examples (PR 488), Add text-decoration-style CSS example (PR 490), Dynamically get clipboard button targets (PR 491), and Remove data-clipboard-target attribute (PR 508), to Interactive Examples from Daniel Hickman. - Fixed l10n-aware link to New_Compatibility_Tables_Beta (PR 4609), and Fixed l10n-aware link to Troubleshooting article (PR 4613), from Віталій Крутько (first contributions to Kuma).
- Update LearnSidebar.ejs with French Translation (KumaScript PR 550), from Kevin “Ilphrin” Pellet.
- Fix typo in French translation for Spec2 macro (KumaScript PR 556), from Victor Viale.
- Merge specification status, names and urls into a single source (PR 557), and Update statuses and URLs of a number of W3C specs (PR 565), to KumaScript from Dominique Hazael-Massieux.
- Remove legacy
autocomplete
andautocompleteerror
events (PR 569), from Matt N. (first contribution to KumaScript).
Other significant PRs:
- Fix issue 546: Allow multiple flags (rename flag to flags) (BCD PR 701 and KumaScript PR 438), from Florian Scholz.
- SharedArrayBuffer now unsupported to mitigate Spectre attack (BCD PR 789), from Florian Scholz.
- Add safari_ios validation (BCD PR 831), from Florian Scholz.
- Refactor browser data (BCD PR 834), from Florian Scholz.
- Further restrict identifiers (BCD PR 915), from Florian Scholz.
- Adds config for welcome bot (Interactive Examples PR 407), from Schalk Neethling.
- Disables interactive examples for the currently disabled SharedArrayBuffer (Interactive Examples PR 430), from Schalk Neethling.
- Bug 1308322: Upgrade to selenium 3.x (Kuma PR 4195), from me.
- Add icons in case of support ranges (KumaScript PR 548), from Florian Scholz.
Planned for February
Continue Development Projects
In February, we’ll continue working on our January projects. Our plans include:
- Converting more compatibility data
- Serving developer.mozilla.org from a CDN
- Updating third-party libraries for compatibility with Django 1.11
- Designing interactive examples for more complex scenarios
- Preparing for a team meeting and “Hack on MDN” event in March
See the December report for more information on these projects.