Script Tag

Since Skate exports a UMD definition, you can then access it via the global:

const { skate } = window;

Dependencies

Skate doesn't require you provide any external dependencies, but recommends you provide some web component polyfills depending on what browsers you require support for. Skate requires both Custom Elements and Shadow DOM v1.

To get up and running quickly with our recommended configuration, we've created a single package called skatejs-web-components where all you have to do is load it before your definitions.

If you want finer grained control about which polyfills you use, you'll have to BYO Custom Element and Shadow DOM polyfills.

Transpilation and native custom element gotchas

If you’re using Babel or some other tool to transpile your ES2015 code to ES5, simply import skatejs and skatejs-web-components (or selectively include the polyfills) as needed and ignore the following.

Native custom element support requires that you load a shim if you're not delivering native ES2015 classes to the browser. If you're transpiling to ES5, you must - at the very least - load the native shim:

When you load Skate by module name (import { ... } from 'skatejs'; or require('skatejs');), you'll be getting the transpiled source. Thus even if you author your components in ES2015, you'll still be getting ES5 base-classes and the native custom elements implementation will complain. If you want to deliever native classes you have to point to the non-transpiled Skate source: import { ... } from 'skatejs/src';. Currently this is not supported by our API versioning but we have an issue to work around this.