All Projects → mixpanel → Panel

mixpanel / Panel

Web Components + Virtual DOM: web standards for powerful UIs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Panel

cwco
Powerful and Fast Web Component Library with a Simple API
Stars: ✭ 27 (-86.89%)
Mutual labels:  components, webcomponents, web-components
blockml-component
A component-based virtual DOM system (similar to React) for blockml.
Stars: ✭ 23 (-88.83%)
Mutual labels:  virtual-dom, components, web-components
Switzerland
🇨🇭Switzerland takes a functional approach to Web Components by applying middleware to your components. Supports Redux, attribute mutations, CSS variables, React-esque setState/state, etc… out-of-the-box, along with Shadow DOM for style encapsulation and Custom Elements for interoperability.
Stars: ✭ 261 (+26.7%)
Mutual labels:  virtual-dom, components, webcomponents
lego
🚀 Web-components made lightweight & Future-Proof.
Stars: ✭ 69 (-66.5%)
Mutual labels:  virtual-dom, webcomponents, web-components
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+5799.51%)
Mutual labels:  virtual-dom, web-components, webcomponents
anywhere-webcomponents
A UI work in progress based on custom elements (web components) for use in anywhere.
Stars: ✭ 17 (-91.75%)
Mutual labels:  components, webcomponents, web-components
Diffhtml
diffHTML is a web framework that helps you build applications and other interactive content
Stars: ✭ 788 (+282.52%)
Mutual labels:  virtual-dom, components, web-components
Calcite Components
Web Components for the Calcite Design System. Built with Stencil JS. Currently in Beta!
Stars: ✭ 96 (-53.4%)
Mutual labels:  components, webcomponents
Polymer3 Webpack Starter
Polymer 3 starter built with Vaadin components and Vaadin.Router library, using webpack and modern tools
Stars: ✭ 99 (-51.94%)
Mutual labels:  web-components, webcomponents
Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (-46.12%)
Mutual labels:  web-components, webcomponents
Torus
Torus is an event-driven model-view UI framework for the web, focused on being tiny, efficient, and free of dependencies.
Stars: ✭ 136 (-33.98%)
Mutual labels:  virtual-dom, components
Aybolit
Lightweight web components library built with LitElement.
Stars: ✭ 90 (-56.31%)
Mutual labels:  web-components, webcomponents
Funcy.js
funcy.js - a functional web components wrapper
Stars: ✭ 87 (-57.77%)
Mutual labels:  web-components, webcomponents
Vanilla Hamburger
Animated hamburger menu icons for modern web apps (1.8 KB) 🍔
Stars: ✭ 110 (-46.6%)
Mutual labels:  web-components, webcomponents
Wired Elements
Collection of custom elements that appear hand drawn. Great for wireframes or a fun look.
Stars: ✭ 8,848 (+4195.15%)
Mutual labels:  web-components, webcomponents
Ebayui Core
Collection of Marko widgets; considered to be the core building blocks for all eBay components, pages & apps
Stars: ✭ 134 (-34.95%)
Mutual labels:  components, web-components
Webcomponents From Zero To Hero
An introduction to writing raw web components.
Stars: ✭ 70 (-66.02%)
Mutual labels:  web-components, webcomponents
Smart Webcomponents
Web Components & Custom Elements for Professional Web Applications
Stars: ✭ 110 (-46.6%)
Mutual labels:  web-components, webcomponents
Redux React Starter
DEPRECATED use the new https://github.com/didierfranc/react-webpack-4
Stars: ✭ 137 (-33.5%)
Mutual labels:  virtual-dom, components
Virtual Dom
关于Vue,React,Preact和Omi等框架源码的解读
Stars: ✭ 139 (-32.52%)
Mutual labels:  virtual-dom, web-components

panel

Build Status NPM version

Build Status

Apps made of composable, manageable Web Components. UIs with supercharged web standards!

import { Component } from 'panel';
import counterTemplate from './counter.jade';

customElements.define('counter-app', class extends Component {
  get config() {
    return {
      defaultState: {count: 1},

      helpers: {
        decr: () => this.changeCounter(-1),
        incr: () => this.changeCounter(1),
      },

      template: counterTemplate,
    };
  }

  changeCounter(offset) {
    this.update({count: this.state.count + offset});
  }
});

document.body.appendChild(document.createElement('counter-app'));
.counter
  .val Counter: #{count}
  .controls
    button.decr(on={click: $helpers.decr}) -
    button.incr(on={click: $helpers.incr}) +

Motivation and technologies

Panel makes Web Components suitable for constructing full web UIs, not just low-level building blocks. It does so by providing an easy-to-use state management and rendering layer built on Virtual DOM (the basis of the core rendering technology of React). Through use of the Snabbdom Virtual DOM library and first-class support for multiple templating formats, Panel offers simple yet powerful APIs for rendering, animation, styling, and DOM lifecycle.

Each Panel application is a Web Component, composed of DOM elements and potentially arbitrarily nested child components, each of which can technically be an app in its own right. Parent and child components can share state, in the form of Plain Old JavaScript Objects which are passed to templates for rendering. When update() is called on a component with state changes, the DOM gets updated according to the diff. Templates can be in any format that produces Snabbdom-compatible hyperscript, including raw Hyperscript code or Jade or JSX.

The architecture of Panel draws upon aspects of and technologies from Mercury, Polymer, React, Redux, Cycle, and Backbone, with an emphasis on simple pragmatism over functional purity thanks to Henrik Joreteg's "Feather" app demo. Panel eschews opaque abstractions and data flow management layers to provide a straightforward state-based rendering cycle. There are no built-in data flow abstractions like Mercury's channels, Flux/React's stores, Cycle's observables, Backbone's event soup and DOM dependencies. More complex state management systems such as Redux and RxJS can plug in to Panel seamlessly if desired (hint: in most apps, you just don't need it). A built-in router (based on the Backbone Router) can sync URL updates and HTML5 History with a Panel app's state for automatic updating and view-swapping.

Since early 2016, Panel and Web Components have powered Mixpanel's most advanced new UIs in production, including Insights, Dashboards, Signal, and JQL Console.

Installation

npm install --save panel

If your target environment does not implement HTML custom elements natively, you must supply a polyfill, such as webcomponents.js.

Documentation and examples

API docs can be found at http://mixpanel.github.io/panel/.

For some sample apps with explanations see examples/. These include demonstrations of using Panel with JSX and Redux.

A brief tutorial is available in the examples/tutorial directory. The sample app accompanying the tutorial features routing, Jade templating, and infrastructure for practical usage such as Webpack/Babel configuration and inclusion of a Web Components polyfill.

A Panel implementation of the TodoMVC app spec is available at https://github.com/tdumitrescu/todomvc-panel.

Running tests

Browser tests run with Selenium through web-component-tester. Server-side rendering tests use mocha and chai directly.

Run with locally installed browsers

npm test

Tunnel to Sauce Labs

npm run build-test && npm run test-browser-sauce

Set credentials with environment variables SAUCE_USERNAME and SAUCE_ACCESS_KEY. The default browser/OS matrix is defined in wct.conf.json.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].