Skip to content

Commit

Permalink
updated all dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Giammarchi committed Apr 10, 2019
1 parent ee3a3ea commit 9b64d25
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 44 deletions.
15 changes: 11 additions & 4 deletions esm.js

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var hyperHTML = (function (document) {
var hOP = Object.hasOwnProperty;
var proto = WeakMap.prototype;

proto.delete = function (key) {
proto["delete"] = function (key) {
return this.has(key) && delete key[this._];
};

Expand Down Expand Up @@ -77,7 +77,7 @@ var hyperHTML = (function (document) {
return this.hasOwnProperty.call(object, this._);
};

proto.delete = function (object) {
proto["delete"] = function (object) {
return this.has(object) && delete object[this._];
};

Expand Down Expand Up @@ -107,7 +107,7 @@ var hyperHTML = (function (document) {
var k = [];
var v = [];
return {
delete: function _delete(key) {
"delete": function _delete(key) {
var had = contains(key);

if (had) {
Expand Down Expand Up @@ -589,7 +589,7 @@ var hyperHTML = (function (document) {
// to automatically relate data/context to children components
// If not created yet, the new Component(context) is weakly stored
// and after that same instance would always be returned.
for: {
"for": {
configurable: true,
value: function value(context, id) {
return get(this, children.get(context) || set(context), context, id == null ? 'default' : id);
Expand Down Expand Up @@ -866,7 +866,7 @@ var hyperHTML = (function (document) {

function dispatchTarget(node, event, type, counter) {
if (observer.has(node) && !dispatched[type].has(node)) {
dispatched[counter].delete(node);
dispatched[counter]["delete"](node);
dispatched[type].add(node);
node.dispatchEvent(event);
/*
Expand Down Expand Up @@ -899,13 +899,14 @@ var hyperHTML = (function (document) {

/*! (c) Andrea Giammarchi - ISC */
var importNode = function (document, appendChild, cloneNode, createTextNode, importNode) {
var native = importNode in document; // IE 11 has problems with cloning templates:
var _native = importNode in document; // IE 11 has problems with cloning templates:
// it "forgets" empty childNodes. This feature-detects that.


var fragment = document.createDocumentFragment();
fragment[appendChild](document[createTextNode]('g'));
fragment[appendChild](document[createTextNode](''));
var content = native ? document[importNode](fragment, true) : fragment[cloneNode](true);
var content = _native ? document[importNode](fragment, true) : fragment[cloneNode](true);
return content.childNodes.length < 2 ? function importNode(node, deep) {
var clone = node[cloneNode]();

Expand All @@ -914,7 +915,7 @@ var hyperHTML = (function (document) {
}

return clone;
} : native ? document[importNode] : function (node, deep) {
} : _native ? document[importNode] : function (node, deep) {
return node[cloneNode](!!deep);
};
}(document, 'appendChild', 'cloneNode', 'createTextNode', 'importNode');
Expand Down Expand Up @@ -1325,7 +1326,7 @@ var hyperHTML = (function (document) {
}([].slice);

// Node.CONSTANTS
var DOCUMENT_FRAGMENT_NODE$1 = 11; // SVG related constants
var DOCUMENT_FRAGMENT_NODE = 11; // SVG related constants

var OWNER_SVG_ELEMENT = 'ownerSVGElement'; // Custom Elements / MutationObserver constants

Expand Down Expand Up @@ -1578,7 +1579,7 @@ var hyperHTML = (function (document) {
}
}
} else if (canDiff(value)) {
childNodes = domdiff(node.parentNode, childNodes, value.nodeType === DOCUMENT_FRAGMENT_NODE$1 ? slice.call(value.childNodes) : [value], diffOptions);
childNodes = domdiff(node.parentNode, childNodes, value.nodeType === DOCUMENT_FRAGMENT_NODE ? slice.call(value.childNodes) : [value], diffOptions);
} else if (isPromise_ish(value)) {
value.then(anyContent);
} else if ('placeholder' in value) {
Expand Down
15 changes: 11 additions & 4 deletions min.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@
"url": "https://github.com/WebReflection/hyperhtml/issues"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.0",
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"ascjs": "^3.0.0",
"basichtml": "^0.22.0",
"coveralls": "^3.0.2",
"drop-babel-typeof": "^1.0.1",
"coveralls": "^3.0.3",
"drop-babel-typeof": "^1.0.3",
"istanbul": "^0.4.5",
"npm-dollar": "^2.1.3",
"rollup": "^1.2.2",
"rollup-plugin-babel": "^4.1.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup": "^1.9.3",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-node-resolve": "^4.2.2",
"tressa": "^0.3.1",
"uglify-js": "^2.8.29"
"uglify-js": "^3.5.4"
},
"greenkeeper": {
"ignore": [
Expand Down
28 changes: 14 additions & 14 deletions test/ie/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@
tressa.assert(div.querySelector('p').getAttribute('attr') === 'test', 'the <p attr=test> is defined');
p.render().click();
tressa.assert(p.clicked, 'the event worked');
render(_templateObject101(), [hyperHTML.Component.for.call(Rect, {
render(_templateObject101(), [hyperHTML.Component["for"].call(Rect, {
x: 789,
y: 123
})]);
Expand Down Expand Up @@ -2775,7 +2775,7 @@
var _this3 = this;

return this.setState(props, false).html(_templateObject118(), props.items.map(function (item, i) {
return MenuItem.for(_this3, i).render(item);
return MenuItem["for"](_this3, i).render(item);
}));
}
}]);
Expand All @@ -2800,7 +2800,7 @@
var _this4 = this;

return this.setState(props, false).html(_templateObject119(), props.items.map(function (item) {
return MenuItem.for(_this4, item).render(item);
return MenuItem["for"](_this4, item).render(item);
}));
}
}]);
Expand Down Expand Up @@ -2831,15 +2831,15 @@

var a = document.createElement('div');
var b = document.createElement('div');
var method = hyperHTML.Component.for;
var method = hyperHTML.Component["for"];

if (!MenuSimple.for) {
MenuSimple.for = method;
MenuWeakMap.for = method;
MenuItem.for = method;
if (!MenuSimple["for"]) {
MenuSimple["for"] = method;
MenuWeakMap["for"] = method;
MenuItem["for"] = method;
}

hyperHTML.bind(a)(_templateObject121(), MenuSimple.for(a).render({
hyperHTML.bind(a)(_templateObject121(), MenuSimple["for"](a).render({
items: [{
name: 'item 1'
}, {
Expand All @@ -2848,8 +2848,8 @@
name: 'item 3'
}]
}));
tressa.assert(MenuSimple.for(a) === MenuSimple.for(a), 'same simple menu');
hyperHTML.bind(b)(_templateObject122(), MenuWeakMap.for(b).render({
tressa.assert(MenuSimple["for"](a) === MenuSimple["for"](a), 'same simple menu');
hyperHTML.bind(b)(_templateObject122(), MenuWeakMap["for"](b).render({
items: [{
name: 'item 1'
}, {
Expand All @@ -2858,9 +2858,9 @@
name: 'item 3'
}]
}));
tressa.assert(MenuWeakMap.for(a) === MenuWeakMap.for(a), 'same weakmap menu');
tressa.assert(MenuSimple.for(a) !== MenuWeakMap.for(a), 'different from simple');
tressa.assert(MenuSimple.for(a) === MenuSimple.for(a), 'same as simple');
tressa.assert(MenuWeakMap["for"](a) === MenuWeakMap["for"](a), 'same weakmap menu');
tressa.assert(MenuSimple["for"](a) !== MenuWeakMap["for"](a), 'different from simple');
tressa.assert(MenuSimple["for"](a) === MenuSimple["for"](a), 'same as simple');
tressa.assert(a.outerHTML === b.outerHTML, 'same layout');
}).then(function () {
tressa.log('## Component.dispatch');
Expand Down
26 changes: 26 additions & 0 deletions test/svgclass.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="../index.js"></script>
<script>
const {bind, wire} = hyperHTML;
todo(document.body);
function todo(node, items = []) {
let texts = ['a', 'b'];
bind(node)`
<svg width="200" height="200">
<g class="foo">
${texts.map((t, i) => wire(null, `svg:${i}`)`
<rect x=${20 * i} y="35" width=10 height=10 class=${t}></rect>
</g>`)}
</svg>`;
}
</script>
</body>
</html>
Loading

0 comments on commit 9b64d25

Please sign in to comment.