The web developer communnity and it’s love/hate relationship with Webkit.

Reading through Reddit I noticed that someone posted a link to an article talking about how Apple is undermining web based technologies (link), I wouldn’t characterise what Apple is doing as ‘trying to kill web technology’ as the article is entitled but one is rather concerned at the steps Apple is taking. I have to prefix this by saying, I am no fan of electron but it is important that it is in response to a genuine problem rather than simply there being a cabal of ‘lazy programmers not wanting to write native code’.

It appears that far too much of the replies focused on his complaint regarding the banning of electron because of its use of private APIs rather than focusing on why it is necessary to bundle the Chromium runtime in the first place – if Webkit was up to the job then why bundle Chromium? Here lies the problem, Apple has failed to implement all the technologies required to support PWA natively on Webkit so the end result is that, rather as in the case of Chrome where you can click on the three dots then go ‘install [insert name here] or click on the plus button in the address bar to install a PWA, developers are forced to go down the route of bundling Chromium with their application because Webkit is missing those key PWA technologies.

A bit of background to the iPhone, iOS and web based technologies. When the iPhone was first launched there was no SDK available for the platform because the original intention wasn’t a platform of native applications but rather than web based applications were going to be the future. When the iPhone was shown off there was a lot of focus on the browser performance, specifically, the performance of javascript since those immersive web applications were going to leverage javascript heavily to achieve an app like experience.

The iPhone was announced July 2007 but in October 2007 the first jail break was released thus giving enthusiasts the ability to write applications for the platform and given how similar iOS was to macOS a lot of knowledge was transferable between the two platforms. I can’t help but get the feeling that Apple never had intended to have a store (although the hardcore Apple aficionados insist that Apple always had some ‘master plan’ right from the start) but when they saw the enthusiast community start to create applications and enhancements they realised that they could create an ecosystem around it.

Now, at that stage I don’t think they ever thought of the AppStore as anything more than a means by which to sell more hardware, “here is our hardware and we have an AppStore to make life easier”, rather than a case of it being a business in its own right. I can’t help but get the feeling that over time the AppStore changed from merely being a conduit to provide a great customer experience into something that could be sustainable business in its own right. I’d say that started to kick in the moment when they required that all subscriptions had to also be sold through the store (announcement in 15 February 2011) which is the moment that they realised that they could turn the AppStore into something more than service provided as a means of convenience to sell more hardware.

The claim that many have made is there is conflict of interest between growing their AppStore while trying to also deliver a solid browser experience and as a result some have concluded that Apple is deliberately dragging of their feet every step from that moment on – the moment that they realised they could turn the AppStore into a low risk money spinner the incentive to keep investing into Webkit (to bring about full PWA compatibility). The side effect however has been that PWA developers that wish to submit their applications to the store are pretty much forced to rely on electron because of the lack of comprehensive PWA support natively, If Webkit was as feature complete Chromium then it would be possible to pull out the components (minus Chromium embedded) and simply run it on top of the Webkit that comes with iOS or macOS instead which would also gain the benefit of having a highly optimised browser engine at their core of their application.

As much as such explanations may make certain people happy the reality is that Webkit is continuously being updated on a regular basis but it is also kept in check by a policy (instituted by the project team) to ensure that any additions to Webkit don’t end up reducing its performance. He net result? Rather than the ‘lets fling code against the wall then come back to clean it up later’ which Google seems to have adopted with Chrome (which is based on Blink – a fork of Webkit) might have given them an edge when it comes to getting those features but it comes at a price. It is the same reason why Chrome was able to get to a multi-process model quicker because what they effectively did was spawn the same stack of processes over and over again for each tab that is opened bu the end result however is a browser that is considerably heavier than how Webkit developers went about delivering their multi-process model.

There is also reasons beyond performance concerns to concerns about the standards themselves for example if you have a look through the Webkit platform status (link) one can see a number of technologies that they’re not considering for a variety of reasons. One example of that would be HTML imports where the reasoning is as follows: “Multile browser vendors have raised concerns about how the HTML imports currently works. For example when it comes to HTML imports the Webkit developers have noted that “its dependency model is not fully compatible with ES6 Modules. We are exploring other ways to package web components by integrating into ES6 Modules with other browser vendors”. Then there are just some cases where the standard is so niche that one begs to question whether it is worth expending resources implementing something where there is no demand for it such as WebUSB or Web Bluetooth.

What I’d hope to see is Apple dedicate more man power to getting Webkit to a point where there can be an electron fork where, rather than using Chromium, Webkit is used instead by utilising the Webkit bundled with the operating system which would drastically reduce the size of the download as well. With that being said I have to admit, I’m old school, I like my native applications and I’m happy to pay for it. I do hope that as catalyst matures that we’ll see more software vendors will bring their applications from iPad to macOS.