Comparing version 0.9.1 to 0.10.0-rc1
@@ -9,26 +9,14 @@ 'use strict'; | ||
var _mainLoop = require('main-loop'); | ||
var _h = require('snabbdom-tdumitrescu/h'); | ||
var _mainLoop2 = _interopRequireDefault(_mainLoop); | ||
var _h2 = _interopRequireDefault(_h); | ||
var _createElement = require('virtual-dom/create-element'); | ||
var _webcomponent = require('webcomponent'); | ||
var _createElement2 = _interopRequireDefault(_createElement); | ||
var _webcomponent2 = _interopRequireDefault(_webcomponent); | ||
var _diff = require('virtual-dom/diff'); | ||
var _domPatcher = require('./dom-patcher'); | ||
var _diff2 = _interopRequireDefault(_diff); | ||
var _domPatcher2 = _interopRequireDefault(_domPatcher); | ||
var _patch = require('virtual-dom/patch'); | ||
var _patch2 = _interopRequireDefault(_patch); | ||
var _virtualHyperscript = require('virtual-dom/virtual-hyperscript'); | ||
var _virtualHyperscript2 = _interopRequireDefault(_virtualHyperscript); | ||
var _webcomponent = require('webcomponent'); | ||
var _webcomponent2 = _interopRequireDefault(_webcomponent); | ||
var _router = require('./router'); | ||
@@ -48,3 +36,3 @@ | ||
var DOCUMENT_FRAGMENT_NODE = 11; | ||
var EMPTY_DIV = (0, _virtualHyperscript2.default)('div'); | ||
var EMPTY_DIV = (0, _h2.default)('div'); | ||
@@ -98,3 +86,3 @@ /** | ||
* to be created | ||
* @param {object} [attrs={}] - HTML attributes to assign to the child | ||
* @param {object} [config={}] - snabbdom node config (second argument of h()) | ||
* @returns {object} virtual-dom node | ||
@@ -105,7 +93,6 @@ * @example | ||
value: function child(tagName) { | ||
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var config = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
attrs = Object.assign({}, attrs); | ||
attrs.attributes = Object.assign({}, attrs.attributes, { 'panel-parent': this.panelID }); | ||
return (0, _virtualHyperscript2.default)(tagName, attrs); | ||
config.attrs = Object.assign({}, config.attrs, { 'panel-parent': this.panelID }); | ||
return (0, _h2.default)(tagName, config); | ||
} | ||
@@ -292,6 +279,2 @@ | ||
this.loop = (0, _mainLoop2.default)(this.state, this._render.bind(this), { create: _createElement2.default, diff: _diff2.default, patch: _patch2.default }); | ||
this.el.appendChild(this.loop.target); | ||
this.initialized = true; | ||
if (Object.keys(this.getConfig('routes')).length) { | ||
@@ -301,2 +284,6 @@ this.router = new _router2.default(this, { historyMethod: this.historyMethod }); | ||
} | ||
this.domPatcher = new _domPatcher2.default(this.state, this._render.bind(this)); | ||
this.el.appendChild(this.domPatcher.el); | ||
this.initialized = true; | ||
} | ||
@@ -345,3 +332,3 @@ }, { | ||
if (this.initialized && this.shouldUpdate(state)) { | ||
this.loop.update(state); | ||
this.domPatcher.update(state); | ||
var _iteratorNormalCompletion = true; | ||
@@ -348,0 +335,0 @@ var _didIteratorError = false; |
@@ -12,5 +12,5 @@ 'use strict'; | ||
var _virtualHyperscript = require('virtual-dom/virtual-hyperscript'); | ||
var _h = require('snabbdom-tdumitrescu/h'); | ||
var _virtualHyperscript2 = _interopRequireDefault(_virtualHyperscript); | ||
var _h2 = _interopRequireDefault(_h); | ||
@@ -29,12 +29,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports. | ||
/** {@link Component} class, to be subclassed by apps */ | ||
Component = _component2.default; | ||
exports. | ||
/** | ||
* [virtual-dom]{@link https://github.com/Matt-Esch/virtual-dom} function to create Hyperscript nodes, | ||
* exported here for user convenience | ||
*/ | ||
h = _virtualHyperscript2.default; | ||
exports.Component = _component2.default; | ||
exports.h = _h2.default; |
@@ -1,8 +0,5 @@ | ||
import MainLoop from 'main-loop'; | ||
import create from 'virtual-dom/create-element'; | ||
import diff from 'virtual-dom/diff'; | ||
import patch from 'virtual-dom/patch'; | ||
import h from 'virtual-dom/virtual-hyperscript'; | ||
import h from 'snabbdom-tdumitrescu/h'; | ||
import WebComponent from 'webcomponent'; | ||
import DOMPatcher from './dom-patcher'; | ||
import Router from './router'; | ||
@@ -73,3 +70,3 @@ | ||
* to be created | ||
* @param {object} [attrs={}] - HTML attributes to assign to the child | ||
* @param {object} [config={}] - snabbdom node config (second argument of h()) | ||
* @returns {object} virtual-dom node | ||
@@ -79,6 +76,5 @@ * @example | ||
*/ | ||
child(tagName, attrs={}) { | ||
attrs = Object.assign({}, attrs); | ||
attrs.attributes = Object.assign({}, attrs.attributes, {'panel-parent': this.panelID}); | ||
return h(tagName, attrs); | ||
child(tagName, config={}) { | ||
config.attrs = Object.assign({}, config.attrs, {'panel-parent': this.panelID}); | ||
return h(tagName, config); | ||
} | ||
@@ -244,6 +240,2 @@ | ||
this.loop = MainLoop(this.state, this._render.bind(this), {create, diff, patch}); | ||
this.el.appendChild(this.loop.target); | ||
this.initialized = true; | ||
if (Object.keys(this.getConfig('routes')).length) { | ||
@@ -253,2 +245,6 @@ this.router = new Router(this, {historyMethod: this.historyMethod}); | ||
} | ||
this.domPatcher = new DOMPatcher(this.state, this._render.bind(this)); | ||
this.el.appendChild(this.domPatcher.el); | ||
this.initialized = true; | ||
} | ||
@@ -289,3 +285,3 @@ | ||
if (this.initialized && this.shouldUpdate(state)) { | ||
this.loop.update(state); | ||
this.domPatcher.update(state); | ||
for (let child of this.$panelChildren) { | ||
@@ -292,0 +288,0 @@ child.updateSelfAndChildren(state); |
@@ -12,3 +12,3 @@ /** | ||
import Component from './component'; | ||
import h from 'virtual-dom/virtual-hyperscript'; | ||
import h from 'snabbdom-tdumitrescu/h'; | ||
@@ -21,3 +21,3 @@ export { | ||
/** | ||
* [virtual-dom]{@link https://github.com/Matt-Esch/virtual-dom} function to create Hyperscript nodes, | ||
* [snabbdom]{@link https://github.com/snabbdom/snabbdom} function to create Hyperscript nodes, | ||
* exported here for user convenience | ||
@@ -24,0 +24,0 @@ */ |
{ | ||
"name": "panel", | ||
"version": "0.9.1", | ||
"version": "0.10.0-rc1", | ||
"description": "Web Components with Virtual DOM: lightweight composable web apps", | ||
@@ -22,3 +22,3 @@ "main": "build/index.js", | ||
"web components", | ||
"virtual-dom", | ||
"virtual dom", | ||
"react", | ||
@@ -35,6 +35,6 @@ "jade", | ||
"dependencies": { | ||
"html-element": "^2.1.1", | ||
"main-loop": "3.2.0", | ||
"raf": "^3.2.0", | ||
"virtual-dom": "2.1.1", | ||
"html-element": "2.2.0", | ||
"raf": "3.2.0", | ||
"snabbdom-delayed-class": "0.1.1", | ||
"snabbdom-tdumitrescu": "0.6.1", | ||
"webcomponent": "0.1.2" | ||
@@ -54,3 +54,3 @@ }, | ||
"mocha": "^2.5.3", | ||
"web-component-tester": "4.2.2", | ||
"web-component-tester": "5.0.0", | ||
"webcomponents.js": "0.7.22", | ||
@@ -57,0 +57,0 @@ "webpack": "1.13.0" |
@@ -38,4 +38,4 @@ # panel | ||
.controls | ||
button.decr(onclick=$helpers.decr) - | ||
button.incr(onclick=$helpers.incr) + | ||
button.decr(on={click: $helpers.decr}) - | ||
button.incr(on={click: $helpers.incr}) + | ||
``` | ||
@@ -42,0 +42,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60
2201
1563730
+ Addedsnabbdom-delayed-class@0.1.1
+ Addedsnabbdom-tdumitrescu@0.6.1
+ Addedhtml-element@2.2.0(transitive)
+ Addedperformance-now@0.2.0(transitive)
+ Addedraf@3.2.0(transitive)
+ Addedsnabbdom-delayed-class@0.1.1(transitive)
+ Addedsnabbdom-tdumitrescu@0.6.1(transitive)
- Removedmain-loop@3.2.0
- Removedvirtual-dom@2.1.1
- Removedbrowser-split@0.0.1(transitive)
- Removedcamelize@1.0.1(transitive)
- Removeddom-walk@0.1.2(transitive)
- Removederror@4.4.0(transitive)
- Removedev-store@7.0.0(transitive)
- Removedglobal@4.4.0(transitive)
- Removedhtml-element@2.3.1(transitive)
- Removedindividual@3.0.0(transitive)
- Removedis-object@1.0.2(transitive)
- Removedmain-loop@3.2.0(transitive)
- Removedmin-document@2.19.0(transitive)
- Removednext-tick@0.2.2(transitive)
- Removedperformance-now@0.1.42.1.0(transitive)
- Removedprocess@0.11.10(transitive)
- Removedraf@2.0.43.4.1(transitive)
- Removedstring-template@0.2.1(transitive)
- Removedvirtual-dom@2.1.1(transitive)
- Removedx-is-array@0.1.0(transitive)
- Removedx-is-string@0.1.0(transitive)
- Removedxtend@4.0.2(transitive)
Updatedhtml-element@2.2.0
Updatedraf@3.2.0