@thi.ng/hiccup
Advanced tools
Comparing version 0.1.7 to 1.0.0
@@ -6,2 +6,18 @@ # Change Log | ||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@0.1.7...@thi.ng/hiccup@1.0.0) (2018-02-03) | ||
### Features | ||
* **hiccup:** skip fn exec for event attribs, update tests, readme ([7ae706e](https://github.com/thi-ng/umbrella/commit/7ae706e)) | ||
### BREAKING CHANGES | ||
* **hiccup:** event attribs w/ function values will be omitted, see readme for details/examples | ||
<a name="0.1.7"></a> | ||
@@ -8,0 +24,0 @@ ## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@0.1.6...@thi.ng/hiccup@0.1.7) (2018-02-02) |
{ | ||
"name": "@thi.ng/hiccup", | ||
"version": "0.1.7", | ||
"version": "1.0.0", | ||
"description": "HTML/SVG/XML serialization of nested data structures, iterables & closures", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -120,2 +120,5 @@ # @thi.ng/hiccup | ||
**BREAKING CHANGE since 1.0.0:** Function values for event attributes (any | ||
attrib name starting with "on") WILL BE OMITTED from output. | ||
```js | ||
@@ -129,2 +132,18 @@ ["div#foo", { bar: (attribs) => attribs.id + "-bar" }] | ||
```js | ||
["div#foo", { onclick: () => alert("foo") }, "click me!"] | ||
``` | ||
```html | ||
<div id="foo">click me!</div> | ||
``` | ||
```js | ||
["div#foo", { onclick: "alert('foo')" }, "click me!"] | ||
``` | ||
```html | ||
<div id="foo" onclick="alert('foo')">click me!</div> | ||
``` | ||
### Simple components | ||
@@ -131,0 +150,0 @@ |
@@ -92,6 +92,6 @@ "use strict"; | ||
if (attribs.hasOwnProperty(a)) { | ||
let v = attribs[a]; | ||
let v = attribs[a], isEvent = /^on\w+/.test(a); | ||
if (v != null) { | ||
if (is_function_1.isFunction(v)) { | ||
if ((v = v(attribs)) == null) { | ||
if (isEvent || (v = v(attribs)) == null) { | ||
continue; | ||
@@ -98,0 +98,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
35575
1
387