Predictive Web Performance

Some of the most cutting edge and effective web performance optimizations, like prefetch and preconnect, involve being proactive. We make predictions to determine where a user is likely to go next and load resources ahead of time so page load is as fast as possible. While there is somewhat of a science to making these predictions, thanks to analytics tracking and extensive user testing, they are still largely manual. Making an accurate prediction therefore becomes progressively more difficult as your site scales since there’s no sure way of knowing where a user will go next. This is where machine learning comes in handy. By training a machine learning model (maybe a markov chain?) with current analytics data, we can take the guess work our of our predictions and more accurately load resources ahead of time. There’s currently ongoing development to make techniques such as this more accessible to web developers. A project worth checking out is called GuessJS, which serves as a landing page for all libraries and tools that enable Machine Learning driven user-experiences on the web. The convergence of machine learning and web performance is still in its infancy. However, with the growing popularity of machine learning (especially among web developers), it’s only a matter of time when techniques like predictive prefetching will become more commonplace on the web.

January 3, 2019

The Myth of 'It's Just Javascript'

If you’ve spent some time in frontend land, chances are you’ve heard someone say “it’s just javascript” when referencing a framework, library or snazzy new tool. While the phrase has an element of truth in it—a framework like React compiles down to JavaScript for instance—it often betrays the full picture. For one, a frontend framework like React or Ember often involves complex-ish tooling, templating systems, and high level architectural decisions around state management, and routing. Saying something is “just JavaScript” creates a culture of shaming and heightens the (already fairly high) barrier to entry for newer developers. It also paradoxically “cheapens” the work of practising JavaScript developers by making it seem like their work is trivial. Quite like the oft-misquoted phrase “A jack of all trades is a master of none”*, let’s stop popularizing the half truth that things are “Just JavaScript”. Instead, let’s do the frontend world some justice and express our work with a more nuanced approach that takes into account the chaotic albeit robust ecosystem that we’ve worked so hard to build. Maybe this way we can start having more meaningful, and productive conversations without delving into yet another pithy argument over who or what framework/tool/library is better. ...

January 2, 2019

Components Rule Everything Around Me

Componentization is the central concept driving frontend development today. It enables us to encapsulate core logic of a user interface into smaller chunks thereby making them easier to reason about. While each of these components exist in isolation, they work in concert to build a unified interface. This relative isolation also means that components are reusable and can be easily mixed and matched to create a variety of patterns and styles. An example that best illustrates this is the screwdriver. Though there are many types of screwdrivers, like the phillips head, the flat head, the allen head and so on, these variations can be made by simply changing the head of the screw instead of having to buy multiple single use screwdrivers. By enabling a high level of isolation, components thereby promote ownership while also maintaining the right conditions to efficiently scale. ...

January 1, 2019