Editor’s note: A changelog is “a log or record of all notable changes made to a project. [It] usually includes records of changes such as bug fixes, new features, etc.” Publishing a changelog is kind of a tradition in open source, and a long-time practice on the web. We thought readers of Hacks and folks who use and contribute to MDN Web Docs would be interested in learning more about the work of the MDN engineering team, and the impact they have in a given month. We’ll also introduce code contribution opportunities, interesting projects, and new ways to participate.
Here’s what happened in July to the code, data, and tools that support MDN Web Docs:
- Experimented with the CDN
- Decommissioned zones
- Converted compatibility data
- Shipped tweaks and fixes by merging 307 pull requests, including 58 pull requests from 43 new contributors.
Here’s the plan for August:
Done in July
Experimented with longer CDN expirations
We moved MDN Web Docs to a CDN in April 2018, and saw a 16% improvement in page load times. We shipped with 5 minute expiration times for MDN pages, so that the CDN will request a fresh copy after a short time. MDN is a wiki, and we can’t predict when a page will change. 300 seconds was a compromise between some caching for our most popular pages, and how long an author would need to wait for a changed page to be published to all visitors. 80% of visitors are getting an uncached page.
Longer cache expirations would require cache invalidation, one of the two hard things in computer science. Before committing to the work, we wanted to estimate the expected performance benefits. From July 9 to 15, Ryan Johnson bumped the timeout from 5 minutes to 48 hours (PR 4876), and we gathered the performance data.
Average page load time decreased 3% over the previous week, a small and not significant improvement. The results for different countries was mixed, some slightly improved, and some slightly worse. The outlier was China, where average page load time increased 22%, a significant decrease in performance.
The page load time varied on weekdays versus weekends as well (positive percents are shorter page load times, better for users):
|Country||Page Load Decrease,
|Page Load Decrease,
This is a successful experiment. We got an unexpected result, with minimal work to get those results. At the same time, we’re curious why the longer CDN expiration had little effect for most users, and a negative effect for China. We have some theories.
CloudFront is Amazon’s CDN, and uses the same data centers and networks as MDN’s servers. MDN is optimized for quickly serving wiki pages, so a cache miss adds only 50-100 milliseconds to a request. The primary benefit of the CDN is reducing server load, and we did see a 25% – 50% reduction in requests made to the servers, especially during peak hours.
We’re currently directing CloudFront to cache pages, but telling downstream proxies and browsers not to cache the pages. A wiki page can change after someone edits it, and we wanted to avoid several layers of caches holding on to stale copies. Downstream caches may have a bigger impact than we expect on page load, and we can try allowing caching in the next experiment.
China has country-wide policies to monitor and control internet traffic. We don’t know the details, but longer caching times result in slower processing. We saw an improvement in China moving developer.mozilla.org to CloudFront, lowering the average page load time by 30%. It is possible that most of the benefit was due to removing a second domain lookup for assets. A future experiment may skip CloudFront for traffic from China.
There’s a significant difference between weekday and weekend traffic in some countries, like China and Japan. Our guess is that weekday traffic is dominated by developers using MDN for work, weekend traffic by developers using MDN for hobbies and learning. We also suspect there are differences between the capabilities of work week devices and home devices.
Finally, the results may be a limitation of CloudFront, and we would see different results with a different CDN provider.
Ryan Johnson removed zones on July 24, merging PR 4853. From a user’s perspective, there are a few changes.
Custom zone URLs, like https://developer.mozilla.org/en-US/Firefox/Releases/61, are now at standard wiki URLs under
/docs/, like https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/61. There are redirects to the new URLs, so old links should continue working.
Custom zone styling is removed, and zone pages now look like other wiki pages. This is subtle on most pages, such as removing an icon next to the title. Other pages required a re-write, such as The History of MDN.
Zone sidebars were converted to KumaScript sidebars, and added to each page in the zone, through the heroic efforts of wbamberg (PR 711 and a few others).
About 2600 lines of code were removed, about 10% of the codebase. The wiki code is now simpler, less error prone, and safer to update.
Converted compatibility data
In July of last year, the Browser Compatibility Data (BCD) project hit the milestone of over 1000 MDN pages using the new compatibility data, with about 4900 to convert. This month, there are less than 850 pages left to convert, and over 5000 MDN pages are using the new data. The steady work of the BCD team has made a huge impact on MDN and the community.
Visual Studio Code improved the accuracy of their data by adopting the BCD project in the June 2018 release. This was proposed by Pine in vscode-css-languageservice issue #102 and implemented in PR #105, with feedback from BCD and mdn/data contributor Connor Shea.
After a long discussion, the BCD project has updated the policy for Node.js versions numbers (PR 2196, PR 2294, and others). At first, browser-style version numbers were used, such as
“8”, but the Node.js community requested
“8.0.0”, to reflect how they think of release numbers. This affected lots of files and unstuck several Node.js pull requests.
Florian Scholz went on vacation, and Daniel D. Beck took the lead on project maintenance, including shipping the npm package, now documented via PR 2480. Most of the PRs from the Paris Hack on MDN event are now merged or closed, and the project is down to 120 open PRs, representing about half of the remaining conversion work.
Shipped Tweaks and Fixes
There were 307 PRs merged in July:
- 197 mdn/browser-compat-data PRs
- 48 mdn/interactive-examples PRs
- 26 mozilla/kuma PRs
- 13 mdn/kumascript PRs
- 6 mdn/bob PRs
- 5 mdn/infra PRs
- 4 mdn/learning-area PRs
- 1 mdn/learning-area-pt-br PR
- 1 mdn/dom-examples PR
- 1 mdn/voice-change-o-matic PR
- 1 mdn/web-components-examples PR
- 1 mdn/webextensions-examples PR
- 1 mdn/doc-linter-webextension PR
- 1 mdn/data PR
- 1 mdn/web-speech-api PR
58 of these were from first-time contributors:
- Correct node support for spread (
...) in object literals (BCD PR 2189), from Tobias.
- Add NodeJS versions for some features (BCD PR 2196), from Solant.
...) for Node.js (PR 2262), Update Node.js versions (PR 2294), and 9 more PRs to BCD from Christopher Sahnwaldt.
- Add browser compatibility table for
<input type="checkbox">(PR 2383), Add browser compatibility table for
<input type="button">(PR 2384), and Add browser compatibility table for
<input type="search">(PR 2385), to BCD from varun singh.
- Add missing entity ampersands in description. (BCD PR 2397), from epistemex.
DOMStringMap(BCD PR 2401), from Ayush Poddar.
- Add Edge support for
overflow-wrap(BCD PR 2406), from Quentin Calvez.
- Add missing
browserSettingspermission (BCD PR 2407), from Juraj Mäsiar.
- Add data on
window.scrollfor MS Edge (BCD PR 2433), from David Wheatley.
- Update data on
<input type="color">for Edge (BCD PR 2434), from Thomas Prochazka.
- Add IDEA (IntelliJ, WebStorm, etc.) to
backdrop-filter(BCD PR 2438), from Philip Goto.
<string>value (BCD PR 2442), from Jakob Krigovsky.
search.searchAPI data (BCD PR 2444), from Geoffrey De Belie.
- Add compatibility for
window.scrollTo(BCD PR 2445), from Mauro Mandracchia.
- Add support for CSS selector
:defined(BCD PR 2454), from Estelle Weyl.
- Add support for
window.scrollfunctions in Safari (BCD PR 2462), from Raz Goldin.
- Mark properties defined in ECMA-262 Annex B as deprecated (BCD PR 2469), from TSlivede.
- Add support for
MediaDevicesAPI (BCD PR 2472), from Gaurav Mahto.
- Update Safari support for CSS property
overscroll-behaviorfrom unknown to unsupported (BCD PR 2490), from Peter Fernandes.
- Update Safari support for
Navigator.registerProtocolHandlerAPI from unknown to unsupported (BCD PR 2499), from Lioman.
- Move Firefox support for
Server-Timingheader from 59 to 61 (BCD PR 2504), from Charles Vazac.
- Fix JS
RegExplookbehind assertion description (BCD PR 2521), from Nate Weaver.
- Update IE’s support of CSS property
text-align-last(BCD PR 2525), from Refael Iliaguyev.
- Add Node.js 10 support for
promise.finally(BCD PR 2529), from NKN1396.
- Add Chrome support for
-webkit-optimize-contrast(BCD PR 2531), from Eugene Pankov.
- Fix CSP term
navigation-to) (BCD PR 2532), from Malvoz.
<input type=password>example (Interactive Examples PR 1024), from Timo Tijhof.
<select>examples to use “placeholder label option” pattern (Interactive Examples PR 1025), from Taylor Hunt.
- Add a new line for markdown bullet list (Interactive Examples PR 1028), from Enguerran.
column-fillexample (Interactive Examples PR 1039), from Estelle Weyl.
idas reference for
<label for=>attribute (Interactive Examples PR 1045), from Jon Borglund.
- Make “Publish and Keep Editing” height the same as others (Kuma PR 4900), from Mihir Karbelkar.
- Update the URL of Web Speech API (KumaScript PR 731), from Kagami Sascha Rosylight.
- Updating Learn sidebar to add new Layout guides (PR 736), from Rachel Andrew (first contribution to KumaScript).
- Move Writing Modes Level 4 to Candidate Recommendation (CR) (KumaScript PR 744), from Estelle Weyl.
- Reference correct video source video file (learning-area PR 84), from Rohit Arondekar.
- Fix “farenheit” typo (learning-area PR 85), from arda152.
- Fix comparison operator (
!==) in Event Listener (learning-area PR 86), from Mourad El garma.
- Add folder
- Change convolver to disconnect and reconnect to the audio path (voice-change-o-matic PR 15), from LUCAS GARIBALDI ALVES.
- Use ES2015+ syntax (web-components-examples PR 8), from Kevin Nagurski.
EventRefto the list of allowed macros (PR 70), from Eric Shepherd (first contribution to Doc Linter WebExtension).
- Maintain case consistency (web-speech-api PR 26), from utkarsh-raj.
Other significant PRs:
- Check bugzil.la link format (BCD PR 2511), one of 32 Pull Requests from Claas Augner.
- Open interactive example links in a new tab (Interactive Examples PR 1009), from Stephan Max.
- Update node 8, dependencies (Kuma PR 4852), from me.
Planned for August
In August, we’ll continue working on new and improved interactive examples, converting compatibility data (aiming for less than 50 open PRs), switching to Python 3, improving performance, and other long-term projects.
Upgrade to Elasticsearch 5.6
Elasticsearch powers our little-loved site search, and we’re using version 2.4 in production. This version went out of support in February 2018, but our provider gave us until August to update. We used that grace period to update from Django 1.8 to 1.11. In August, we’ll update our client libraries and code so we can update to Elasticsearch 5.6, the next major release. We don’t expect many user-visible changes with the new server, but we also don’t plan to lose site search due to missing the deadline.
About John Whitlock
John is a web developer working on the engine of MDN Web Docs