MCPcopy
hub / github.com/skatejs/skatejs

github.com/skatejs/skatejs @skatejs-5.2.4 sqlite

repository ↗ · DeepWiki ↗ · release skatejs-5.2.4 ↗
700 symbols 1,467 edges 143 files 0 documented · 0%
README

Skate

NPM version Build Status Downloads per month OpenCollective OpenCollective Join the chat at https://gitter.im/skatejs/skatejs Follow @skate_js on Twitter

Skate is a functional abstraction over the web component standards that:

  • Produces cross-framework compatible components.
  • Abstracts away common attribute / property semantics via props or native types, such as attribute reflection and coercion.
  • Adds several lifecycle callbacks for responding to prop updates, rendering and updating, as well as a way to manage internal component state.
  • Provides a base set of mixins that hook into renderers such as @skatejs/renderer-preact.

Installing

Skate is on NPM:

npm install skatejs

The core principle of Skate is to provide abstractions for writing custom elements based on best-practices; things that aren't controversial. However, templating can be highly contentious. For this reason, Skate provides a hook to inject renderers for any view library. For example, if you wanted to write your custom elements with Preact, you'd install it like so:

npm install skatejs @skatejs/renderer-preact preact

There are renderers for many popular view libraries:

Usage

This is how you might write a web component using Skate and Preact:

// @jsx h

import { props, withComponent } from 'skatejs';
import withPreact from '@skatejs/renderer-preact';
import { h } from 'preact';

class WithPreact extends withComponent(withPreact()) {
  static get props() {
    return {
      name: props.string // String could be used also to define the prop type
    };
  }
  render({ name }) {
    return <span>Hello, {name}!</span>;
  }
}

customElements.define('with-preact', WithPreact);

Getting started

To get up and running with Skate, head over to the getting started guide.

Polyfills

Skate builds upon the Custom Elements and the Shadow DOM standards. Skate is capable of operating without the Shadow DOM — it just means you don't get any encapsulation of your component's HTML or styles. It also means that it's up to you to provide a way to project content (i.e. <slot>). It's highly recommended you use Shadow DOM whenever possible.

Though most modern browsers support these standards, some still need polyfills to implement missing or inconsistent behaviours for them.

For more information on the polyfills, see the web components polyfill documentation.

Browser Support

Skate supports all evergreens and IE11, and is subject to the browser support matrix of the polyfills.

Backers

Support us with a monthly donation and help us continue our activities. Become a backer!

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. Become a sponsor!

Extension points exported contracts — how you extend this code

CustomElementEventOptions (Interface)
(no doc)
packages/skatejs/src/types.js

Core symbols most depended-on inside this repo

afterMutations
called by 51
packages/skatejs/test/lib/after-mutations.js
define
called by 41
packages/skatejs/src/define.js
b
called by 28
site/fills/ce-sd-fill.js
prop
called by 25
packages/ssr/register/util.js
define
called by 25
packages/ssr/register/CustomElementRegistry.js
withLoading
called by 24
site/components/app.js
get
called by 23
packages/ssr/register/CustomElementRegistry.js
withComponent
called by 23
packages/skatejs/src/with-component.js

Shape

Function 270
Class 250
Method 179
Interface 1

Languages

TypeScript100%

Modules by API surface

site/fills/ce-sd-fill.js160 symbols
packages/skatejs/test/unit/with-update.spec.js26 symbols
projector.js21 symbols
packages/skatejs/src/with-update.js20 symbols
packages/sk-router/src/index.js15 symbols
site/components/code.js14 symbols
packages/ssr/register/History.js13 symbols
packages/renderer-react/src/__tests__/index.js13 symbols
packages/renderer-preact/src/__tests__/index.js13 symbols
site/components/primitives.js12 symbols
packages/ssr/example/pages/nametag.js12 symbols
packages/ssr/register/MutationObserver.js10 symbols

Dependencies from manifests, versioned

@skatejs/bore4.0.3 · 1×
@skatejs/renderer-lit-html0.2.1 · 1×
@skatejs/renderer-preact0.3.3 · 1×
@skatejs/renderer-react0.3.1 · 1×
@skatejs/sk-marked0.0.1 · 1×
@skatejs/sk-router0.2.0 · 1×
@skatejs/val0.4.0 · 1×
babel-cli6.26.0 · 1×
babel-eslint8.2.2 · 1×
babel-loader7.1.4 · 1×
babel-plugin-dynamic-import-node1.2.0 · 1×
babel-plugin-modules-map1.0.0 · 1×

For agents

$ claude mcp add skatejs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact