The Web Platform is Getting Better and it is Here to Stay
The CERN laboratory, located in Geneva, was created to understand the physical secrets of our world. Particle physics research at the institute would eventually change the way we perceive the universe and its most atomic particle, the Higgs bosons, but the incidents of December of 1990 would change the world we live in, forever.
Tim Berners Lee as a kid was fascinated by a technique called the “The Portal of Information”. It was a way to develop a mind map of things which would connect and make sense of related data. As a consultant at CERN, Tim proposed and implemented an information network for scientists to share papers and research. He came up with a protocol of his own that employed existing technologies. A document would be connected to another document through a literal link, “Hyperlink” and thus was born the Web. The web changed everything. The way we do business, consume entertainment, travel, eat, and heck even the way we fall in love.
Today we are at a phase where the planned and currently implemented specifications outnumber all the features of the last 25 years! Honestly I am as excited as a kid at a huge toy store, the possibilities are infinite. Excitement is contagious, so in the coming few paragraphs I will attempt to infect my excitement about the newest features and future feature plans for the biggest and the most open platform of the world.
WebGL and Web Audio:
The Web is on a journey to become the biggest, cross platform, and only open application delivery platform. Currently it is at a stage where it supports rich media, but a true application delivery platform requires it to be able to deliver true multimedia. The Web needs some burning cars and sound effects if you pardon the metaphor. The HTML5 features of canvas and SVG are a welcome step towards it and have done a great deal to push the web forward, but we need 3D and WebGL. It’s a 3D engine based on the OpenGL model which lets you create graphics for the Web with some breathtaking results, and did I tell you it will work across all devices and OS? Well, almost.
Web Audio is an API which lets the browser manipulate and produce sound. It is still a nascent feature and the community is still starting to adopt it, but there are a few cool things which have been popping up.
When Tim Berners Lee created the World Wide Web, he used HTML as a document definition language. The idea was to let users be producers of content and let them put it out to the world. The static document had features for tables, paragraphs, and headings among other things. With a more dynamic Web, tags for rich media like canvas, video, and audio came to existence. Now it is time for the web to go beyond that and shift from its roots. The answer is Web Components. To understand Web Components, we need to get into the inner recess of the web and learn about something called the shadow DOM. With a little configuration, we can see the shadow DOM in our browsers and, as an example, let’s take the Video tag. We see that it actually encapsulates basic elements to create a parent element, i.e., the video tag. Take the concept of shadow DOM and provide the developer the ability to create his own custom tags and we have arrived at a powerful feature, Web Components. Imagine a web page made of customized complex UI widgets, aka tags, isolated and encapsulated from the web page, but coming up with a standard is easier said than done and has several roads blocks for now. Yet the Google Polymer project aiming to act as a polyfill for Web Components is a welcome step.
Earlier, when I mentioned the Web as an information network, I was wrong. Yes, it’s centered on sharing information, but with the evolution of the Web, it’s used as a platform for communication. The Web dictates how you communicate with the love of your life or your parents or your friends. Communication on the web is laced with proprietary standards and formats. In short, it isn’t open. Until, enter WebRTC. A real-time communication protocol, open and implemented as the standard by W3C.
Imagine every device communicating to each other through its browser powered by a P2P protocol with no control by a corporate entity. WebRTC is already here and most browsers support it and will soon have widespread usage (Demos).
At its core, the Web works on a client server model. This introduces an annoying problem of a web app working only when network exists. Especially on mobile devices where signal strength decides the Internet connectivity, having a slow connection means a painful experience. Web apps which serve data saved in cache or by pre-fetching some data, is the domain of ‘offline first’ Web apps. Already a solution existing for this. It’s called ‘App cache’, which is a browser feature that lets the developer make part of the Web apps cached. Serving from the cache makes the app an offline app when the Internet is not available, but it is only a configuration mechanism and lacks the feature of a programmable cache. As a replacement, we have Service Workers. Service workers are currently supported in the latest releases of browsers and let the developer manage network requests and cache programmatically. It also provides a mechanism for pre-fetching data and providing a push mechanism. Service Works will make Web apps deliver an experience as close as possible to native mobile apps.