This week, the web team managed to get away for our second hack day. These hack days give us an opportunity to scratch our own itches and work on things we find interesting.
We wrote about our first hack day in August last year.
We began by outlining the day and reviewing ideas that had been suggested on a Google Doc throughout the previous week by everyone on the team. We each voted by marking the ideas we would be interested in working. Then we chose the most voted ones and assigned groups of 2 or 3 people to each.
The groups broke up and turned their idea into a formal project with a list of the tasks required to produce an MVP. Below is a list of the ideas and outcomes from each team.
Performance audit of the current websites
The team discovered a tool called Lighthouse by Google Chrome which analyses a web page and returns a full audit of the dependent assets and accessibility issues.
The team spent some time trying to create a service using Lighthouse to produce an API, then realised that Google Chrome team had done this work already. The service is called Moonlight. Moonlight is a SaaS to test the performance of a page.
As Moonlight takes a single webpage endpoint to test., we need a way to recursively test pages. The team created a profiling script to gather the references endpoints of a site.
Canonical web team dashboard
The goal of this project was to motivate the team to improve key areas at a glance. The metrics we wanted to capture were:
- Whether the site is up or down
- Live visitors countsMonthly unique visitors
- Monthly unique visitorsOpen issues on the project
- Open issues on the projectOpen PRs on the project
- Open PRs on the project
- Information about the last commit to the sites code base
- PageSpeed insights tests results
We gathered a set of sites we would like to collect these metrics on:
The team used MERN stack (MongoDB, expressjs, React and Nodejs) and modified its sample project to create a interface which could be displayed depending on the state of the data. For example, the up or down card would display all sites as up but once one went down the card would change to an error state and only display the information about the site that is down. By designing for emotion in this way, we can intelligently utilise the limited space available in a dashboard.
The team also used a few plugins to gather some data:
- ping-monitor to ping our sites to check if they’re up, down or broken
- node-http-ping to get response times for the same set of Canonical sites
Storing the data in MongoDB to keep historical data and using the /api endpoint to return the response time and status for each site, the team managed to produce a simplified dashboard showing the available state of our list of sites.
Ubuntu.com dev tools
As a team, we have been using gulp scripts to lint and test our code locally and in our CI environments for sometime. But we have never got around to applying these checks to our flagship website, www.ubuntu.com.
The team added Sass linting and borrowed the linting tasks from our styling framework vanilla-framework. This produced a long list of lint issues. The team tracked the lint errors and quickly fixed them to get a passing CI run.
Finally adding the new linting steps to the Travis configuration. So the linting is tested on each pull request.
Vanilla web components prototype
To enable Vanilla on a variety of platforms. This would allow people to use Vanilla in modern web apps.
The team created a base repository using Polymer’s tools and started creating web components for Vanilla.
They discovered that the styling needs tweaking to be compatible with web components. Possibly just by building a shared styles import which is included in each web component.
The team started by importing vanilla-framework from NPM, then built modular scss files containing only relevant parts from Vanilla, and finally imported the modular style file in web component.
Inside the repository there is a vanilla.html which imports all of the components. Components can individually be included as needed.
This work includes a demo system, with API documentation. The demo system displays the component and the markup used to create it. This is accessed by running `polymer serve` and accessing the site.
This work can be used to build solid web components for use in Polymer and we can also use this work to jumpstart React components.
HTTP/2 on vanillaframework.io
In the midst of all this work. Robin found time to tackle the task of hosting our styling frameworks website on HTTP/2. It’s currently a proof of concept but can now be considered as the start of work item to roll out.
Again, this was a successful hack day with everyone busy working on things that interest them. Although there were less completed outcomes this time, we did set up a number of good projects which are ready to be continued.