The reason I’m excited about this is obviously because of Protoship. We have two tools that work intimately with Sketch: Teleport can convert websites into Sketch designs, and UIPad can convert Sketch designs into HTML, CSS, and React.

We implemented Teleport by writing a massive Sketch plugin that creates layers and adds texts and inserts pictures, all using Sketch’s internal API. Yes, if you’re a developer, you read it right — Sketch’s Internal API. Here’s a rough glimpse of that code:

function createArtboard() {

var artboard = MSArtboardGroup.alloc().init();

artboard.setName(layerTree.originalName);

var fill = layer.style().addStylePartOfType(0);

fill.color = rgbaToMSColor(backgroundColor);

var frame = layer.frame();

frame.setX(node.rulerX);

frame.setY(node.rulerY);

frame.setConstrainProportions(false);

frame.setWidth(node.width);

frame.setHeight(node.height);

layer.setName(node.originalName);

}

This is an approximation of the code that we use in Teleport for creating a new Artboard in Sketch. The functions and objects we use (MSArtboardGroup for example) are the exact same stuff that Bohemian Coding themselves use to build Sketch. This is the essence of their plugin architecture: they let the plugins execute from within the same process space as that of Sketch — there is no explicit API nor any kind of sandboxing from the parent process. Plugin developers have almost the same power that Bohemian’s programmers themselves have because the plugins have access to Sketch’s internal code!

This freedom is what made the thriving third-party plugin ecosystem for Sketch possible. And it is already one of the major differentiators of Sketch compared to its competitors. To see the breadth and depth of this ecosystem, take a look at the official Sketch Plugin directory. If Bohemian Coding doesn’t have the inclination or the resources to build a feature, the community just makes it.

This is no accident — Bohemian has supported the third-party ecosystem over the years in many ways. They hired the exceedingly helpful Ale Munoz as a sort of Developer Evangelist a few years back, and has setup an actively-supported forum for Plugin developers.

And Sketch itself comes with an in-built REPL where anyone can whip up a plugin in no time, and just hit Save to package it into a distributable plugin. There is nothing extra to do — it is all in the app. This makes it very easy for users of Sketch to get started with plugin development, and they happily take the bait!

But I shouldn’t be waxing this eloquent about the plugin ecosystem. It is not all honeys and roses and doughnuts.

The whole thing is practically undocumented! Doing anything non-trivial is painful. First you have to rummage through the mailing list hoping someone has already asked your same question, then go scavenging for code from other plugins that does similar stuff, and finally give up and ask it on the forum. Not to mention some good ole-fashioned API whack-a-mole. While building Teleport and UIPad, Sherin and I spent weeks staring at Sketch’s classdump trying to reverse-engineer the API calls we needed.

But I wanted to make a point with all this: even though plugin development is undocumented and painful, developers still build crazy useful things on top of it. And it is not like there is much choice anyway! Sketch is a design programming platform with a large user base and zero substitutes. Developers (who are often power-users themselves) are willing to endure anything to get a chance to program the tools they use.