SkateJSWeb 组件规范功能抽象
SkateJS 是一个 Web 组件库,旨在提供扩充 Web 组件规范能力,它重点关注功能渲染管道、清理 attribute/property 语义和较小的占用空间。
抽象能力包括:
-
生成跨框架兼容组件。
-
通过 props 或原生类型,抽象出常见的 attribute/property 语义,例如属性 reflection 和 coercion。
-
添加一些生命周期回调以响应 prop 更新、渲染,以及管理内部组件状态的方法。
-
提供一组基本的 mixin,它们 hook 渲染器,如 @skatejs/renderer-preact。
使用 Skate 与 Preact 可以这样写 Web 组件:
// @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);
评论
xspecWEB 组件规范
xspec是一系列基于WEBCOMPONENTS的组件规范,致力于借助规范的力量让组件发挥更大的价值。什么是X-SPEC它是一系列WEB组件的规范集合,基于最新的WEBCOMPONENTS,从WEB组
xspecWEB 组件规范
0
GLViewOpenGL功能封装组件
GLView封装了很多OpenGL的功能,能够让开发者很方便地在iOS编程中使用OpenGL来处理图像、三维模型以及视频。其中GLImage和GLImageView能够方便地加载和显示PVR格式的图像
GLViewOpenGL功能封装组件
0