diff --git a/examples/README.md b/examples/README.md
index 801959a6f5..1007040b42 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -17,21 +17,23 @@ If you want to [contribute](../CONTRIBUTING.md) an example, please get in touch
| 9 | [hdom-basics](./hdom-basics) | Hello world | hdom, hiccup | basic |
| 10 | [hdom-benchmark](./hdom-benchmark) | hdom rendering perf / stress test, FPS counter | hdom, rstream, transducers | intermediate |
| 11 | [hdom-canvas-clock](./hdom-canvas-clock) | hdom-canvas rendered clock | hdom, hdom-canvas, transducers | basic |
-| 12 | [hdom-canvas-shapes](./hdom-canvas-shapes) | various hdom-canvas shape tests | hdom, hdom-canvas, rstream, transducers | basic |
-| 13 | [hdom-theme-adr-0003](./hdom-theme-adr-0003) | hdom themed components proposal | hdom | intermediate |
-| 14 | [hmr-basics](./hmr-basics) | hdom & hot module replacement | hdom, memoize | basic |
-| 15 | [hydrate-basics](./hydrate-basics) | hiccup / hdom DOM hydration | hiccup, hdom | intermediate |
-| 16 | [interceptor-basics](./interceptor-basics) | Event handling w/ interceptors and side effects | atom, hdom, interceptors | intermediate |
-| 17 | [json-components](./json-components) | JSON->component transformation, live editor | hdom, transducers | intermediate |
-| 18 | [login-form](./login-form) | Basic SPA without router | atom, hdom | intermediate |
-| 19 | [pointfree-svg](./pointfree-svg) | Generate SVG using pointfree DSL | hiccup, hiccup-svg, pointfree-lang | intermediate |
-| 20 | [router-basics](./router-basics) | Complete mini SPA | atom, hdom, interceptors, router | advanced |
-| 21 | [rstream-dataflow](./rstream-dataflow) | Dataflow graph | atom, hdom, rstream, rstream-gestures, rstream-graph, transducers | intermediate |
-| 22 | [rstream-grid](./rstream-grid) | Dataflow graph SVG grid | atom, hdom, hiccup-svg, interceptors, rstream-graph, transducers | advanced |
-| 23 | [rstream-hdom](./rstream-hdom) | rstream based UI updates & state handling | hdom, rstream, transducers | intermediate |
-| 24 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |
-| 25 | [svg-waveform](./svg-waveform) | hdom SVG generation / undo history | atom, hdom, hiccup-svg, interceptors, iterators | intermediate |
-| 26 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |
-| 27 | [transducers-hdom](./transducers-hdom) | Transducer & rstream based hdom UI updates | hdom, rstream, transducers-hdom | basic |
-| 28 | [triple-query](./triple-query) | Triple store query results & sortable table | atom, hdom, hdom-components, rstream-query, transducers | intermediate |
-| 29 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |
\ No newline at end of file
+| 12 | [hdom-canvas-draw](./hdom-canvas-draw) | hdom-canvas mouse / touch gesture drawing | hdom, hdom-canvas, transducers | intermediate |
+| 13 | [hdom-canvas-shapes](./hdom-canvas-shapes) | various hdom-canvas shape tests | hdom, hdom-canvas, rstream, transducers | basic |
+| 14 | [hdom-theme-adr-0003](./hdom-theme-adr-0003) | hdom themed components proposal | hdom | intermediate |
+| 15 | [hmr-basics](./hmr-basics) | hdom & hot module replacement | hdom, memoize | basic |
+| 16 | [hydrate-basics](./hydrate-basics) | hiccup / hdom DOM hydration | hiccup, hdom | intermediate |
+| 17 | [interceptor-basics](./interceptor-basics) | Event handling w/ interceptors and side effects | atom, hdom, interceptors | intermediate |
+| 18 | [json-components](./json-components) | JSON->component transformation, live editor | hdom, transducers | intermediate |
+| 19 | [login-form](./login-form) | Basic SPA without router | atom, hdom | intermediate |
+| 20 | [pointfree-svg](./pointfree-svg) | Generate SVG using pointfree DSL | hiccup, hiccup-svg, pointfree-lang | intermediate |
+| 21 | [router-basics](./router-basics) | Complete mini SPA | atom, hdom, interceptors, router | advanced |
+| 22 | [rstream-dataflow](./rstream-dataflow) | Dataflow graph | atom, hdom, rstream, rstream-gestures, rstream-graph, transducers | intermediate |
+| 23 | [rstream-grid](./rstream-grid) | Dataflow graph SVG grid | atom, hdom, hiccup-svg, interceptors, rstream-graph, transducers | advanced |
+| 24 | [rstream-hdom](./rstream-hdom) | rstream based UI updates & state handling | hdom, rstream, transducers | intermediate |
+| 25 | [svg-barchart](./svg-barchart) | hdom SVG barchart component | hdom, transducers | basic |
+| 26 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |
+| 27 | [svg-waveform](./svg-waveform) | hdom SVG generation / undo history | atom, hdom, hiccup-svg, interceptors, iterators | intermediate |
+| 28 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |
+| 29 | [transducers-hdom](./transducers-hdom) | Transducer & rstream based hdom UI updates | hdom, rstream, transducers-hdom | basic |
+| 30 | [triple-query](./triple-query) | Triple store query results & sortable table | atom, hdom, hdom-components, rstream-query, transducers | intermediate |
+| 31 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |
diff --git a/examples/crypto-chart/README.md b/examples/crypto-chart/README.md
index 7b53a3b8f4..99d2d52d05 100644
--- a/examples/crypto-chart/README.md
+++ b/examples/crypto-chart/README.md
@@ -9,7 +9,7 @@ Price data provided by [cryptocompare.com](https://min-api.cryptocompare.com/).
This example demonstrates how to use
[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)
&
-[@thi.ng/transducer](https://github.com/thi-ng/umbrella/tree/master/packages/transducer)
+[@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers)
constructs to create a basic crypto-currency candle chart with multiple
moving averages plots. Unlike most other examples in this repo, there's
no additional state handling used (e.g. via
diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md
index 627f601886..9ed7ea26dd 100644
--- a/packages/api/CHANGELOG.md
+++ b/packages/api/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [4.2.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@4.2.0...@thi.ng/api@4.2.1) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/api
+
+
+
+
+
# [4.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@4.1.1...@thi.ng/api@4.2.0) (2018-09-22)
diff --git a/packages/api/README.md b/packages/api/README.md
index 4c69810c82..3e44252346 100644
--- a/packages/api/README.md
+++ b/packages/api/README.md
@@ -2,6 +2,8 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/api.svg)](https://www.npmjs.com/package/@thi.ng/api)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/api.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
+
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/api/package.json b/packages/api/package.json
index bd56028e96..30720fcae4 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/api",
- "version": "4.2.0",
+ "version": "4.2.1",
"description": "Common, generic types & interfaces for thi.ng projects",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,7 +28,7 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/errors": "^0.1.8"
+ "@thi.ng/errors": "^0.1.9"
},
"keywords": [
"compare",
diff --git a/packages/associative/CHANGELOG.md b/packages/associative/CHANGELOG.md
index 36784192b3..d83bf05f48 100644
--- a/packages/associative/CHANGELOG.md
+++ b/packages/associative/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.6.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@0.6.7...@thi.ng/associative@0.6.8) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/associative
+
+
+
+
+
## [0.6.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@0.6.7-alpha.1...@thi.ng/associative@0.6.7) (2018-09-22)
diff --git a/packages/associative/README.md b/packages/associative/README.md
index ae3bab980e..3178bf73ad 100644
--- a/packages/associative/README.md
+++ b/packages/associative/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/associative.svg)](https://www.npmjs.com/package/@thi.ng/associative)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/associative.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/associative/package.json b/packages/associative/package.json
index b3bbaff460..9383a0446e 100644
--- a/packages/associative/package.json
+++ b/packages/associative/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/associative",
- "version": "0.6.7",
+ "version": "0.6.8",
"description": "Alternative Set & Map data type implementations with customizable equality semantics & supporting operations",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,13 +28,13 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/compare": "^0.1.8",
- "@thi.ng/dcons": "^1.1.7",
- "@thi.ng/equiv": "^0.1.10",
- "@thi.ng/errors": "^0.1.8",
- "@thi.ng/transducers": "^2.1.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/compare": "^0.1.9",
+ "@thi.ng/dcons": "^1.1.8",
+ "@thi.ng/equiv": "^0.1.11",
+ "@thi.ng/errors": "^0.1.9",
+ "@thi.ng/transducers": "^2.1.3"
},
"keywords": [
"data structures",
diff --git a/packages/atom/CHANGELOG.md b/packages/atom/CHANGELOG.md
index 69f48278a0..efde5b5251 100644
--- a/packages/atom/CHANGELOG.md
+++ b/packages/atom/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.5.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@1.5.3...@thi.ng/atom@1.5.4) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/atom
+
+
+
+
+
## [1.5.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@1.5.3-alpha.1...@thi.ng/atom@1.5.3) (2018-09-22)
diff --git a/packages/atom/README.md b/packages/atom/README.md
index 68308269f0..83687f3739 100644
--- a/packages/atom/README.md
+++ b/packages/atom/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/atom.svg)](https://www.npmjs.com/package/@thi.ng/atom)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/atom.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/atom/package.json b/packages/atom/package.json
index a0d97f5cda..d1a9fa720d 100644
--- a/packages/atom/package.json
+++ b/packages/atom/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/atom",
- "version": "1.5.3",
+ "version": "1.5.4",
"description": "Mutable wrapper for immutable values",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,11 +28,11 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/equiv": "^0.1.10",
- "@thi.ng/errors": "^0.1.8",
- "@thi.ng/paths": "^1.6.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/equiv": "^0.1.11",
+ "@thi.ng/errors": "^0.1.9",
+ "@thi.ng/paths": "^1.6.3"
},
"keywords": [
"cursor",
diff --git a/packages/bench/CHANGELOG.md b/packages/bench/CHANGELOG.md
index 2af1471229..6e7645f07a 100644
--- a/packages/bench/CHANGELOG.md
+++ b/packages/bench/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@0.2.2...@thi.ng/bench@0.2.3) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/bench
+
+
+
+
+
## [0.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@0.2.1...@thi.ng/bench@0.2.2) (2018-09-22)
diff --git a/packages/bench/README.md b/packages/bench/README.md
index 12304f8490..5380968ec8 100644
--- a/packages/bench/README.md
+++ b/packages/bench/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/bench.svg)](https://www.npmjs.com/package/@thi.ng/bench)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/bench.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -28,6 +29,34 @@ None
```ts
import { timed, bench } from "@thi.ng/bench";
+
+// test functions
+const fib = (n) => n > 2 ? fib(n - 1) + fib(n - 2) : n > 0 ? 1 : 0;
+
+const fib2 = (n) => {
+ const res = [0, 1];
+ for(let i = 2; i <= n; i++) {
+ res[i] = res[i - 1] + res[i - 2];
+ }
+ return res[n];
+};
+
+// measure single execution time
+timed(() => fib(40));
+// 714ms
+// 102334155
+timed(() => fib2(40));
+// 0ms
+// 102334155
+
+// measure 1mil iterations (default)
+bench(() => fib(10), 1e6);
+// 395ms
+// 55
+
+bench(() => fib2(10), 1e6);
+// 53ms
+// 55
```
## Authors
diff --git a/packages/bench/package.json b/packages/bench/package.json
index c7ce4c2b2e..b85148ac32 100644
--- a/packages/bench/package.json
+++ b/packages/bench/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/bench",
- "version": "0.2.2",
+ "version": "0.2.3",
"description": "Basic benchmarking helpers",
"main": "./index.js",
"typings": "./index.d.ts",
diff --git a/packages/bitstream/CHANGELOG.md b/packages/bitstream/CHANGELOG.md
index 57e1dacaab..6ecd1c5859 100644
--- a/packages/bitstream/CHANGELOG.md
+++ b/packages/bitstream/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.4.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@0.4.17...@thi.ng/bitstream@0.4.18) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/bitstream
+
+
+
+
+
## [0.4.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@0.4.16...@thi.ng/bitstream@0.4.17) (2018-09-22)
diff --git a/packages/bitstream/README.md b/packages/bitstream/README.md
index 89ad138289..cbe4f7ed85 100644
--- a/packages/bitstream/README.md
+++ b/packages/bitstream/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/bitstream.svg)](https://www.npmjs.com/package/@thi.ng/bitstream)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/bitstream.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/bitstream/package.json b/packages/bitstream/package.json
index 3af2100af9..dfd2e59231 100644
--- a/packages/bitstream/package.json
+++ b/packages/bitstream/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/bitstream",
- "version": "0.4.17",
+ "version": "0.4.18",
"description": "ES6 iterator based read/write bit streams & support for variable word widths",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -20,7 +20,7 @@
"test": "rm -rf build && tsc -p test && nyc mocha build/test/*.js"
},
"dependencies": {
- "@thi.ng/errors": "^0.1.8"
+ "@thi.ng/errors": "^0.1.9"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
diff --git a/packages/cache/CHANGELOG.md b/packages/cache/CHANGELOG.md
index 82eb421aea..5e357915c8 100644
--- a/packages/cache/CHANGELOG.md
+++ b/packages/cache/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@0.2.24...@thi.ng/cache@0.2.25) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/cache
+
+
+
+
+
## [0.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@0.2.24-alpha.1...@thi.ng/cache@0.2.24) (2018-09-22)
diff --git a/packages/cache/README.md b/packages/cache/README.md
index 7b1292ef17..573cf90cd3 100644
--- a/packages/cache/README.md
+++ b/packages/cache/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/cache.svg)](https://www.npmjs.com/package/@thi.ng/cache)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/cache.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/cache/package.json b/packages/cache/package.json
index 4262027a13..ad665eb3e8 100644
--- a/packages/cache/package.json
+++ b/packages/cache/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/cache",
- "version": "0.2.24",
+ "version": "0.2.25",
"description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,9 +28,9 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/dcons": "^1.1.7",
- "@thi.ng/transducers": "^2.1.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/dcons": "^1.1.8",
+ "@thi.ng/transducers": "^2.1.3"
},
"keywords": [
"cache",
diff --git a/packages/checks/CHANGELOG.md b/packages/checks/CHANGELOG.md
index 8210cfbf75..f796805803 100644
--- a/packages/checks/CHANGELOG.md
+++ b/packages/checks/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.5.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@1.5.10...@thi.ng/checks@1.5.11) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/checks
+
+
+
+
+
## [1.5.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@1.5.9...@thi.ng/checks@1.5.10) (2018-09-22)
diff --git a/packages/checks/README.md b/packages/checks/README.md
index 8d1326fb4d..14ec1889da 100644
--- a/packages/checks/README.md
+++ b/packages/checks/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/checks.svg)](https://www.npmjs.com/package/@thi.ng/checks)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/checks.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/checks/package.json b/packages/checks/package.json
index 25c876f39f..9aecbff357 100644
--- a/packages/checks/package.json
+++ b/packages/checks/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/checks",
- "version": "1.5.10",
+ "version": "1.5.11",
"description": "Single-function sub-modules for type, feature & value checks",
"main": "./index.js",
"typings": "./index.d.ts",
diff --git a/packages/compare/CHANGELOG.md b/packages/compare/CHANGELOG.md
index 5d5abc360e..a3a4bc7c6e 100644
--- a/packages/compare/CHANGELOG.md
+++ b/packages/compare/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@0.1.8...@thi.ng/compare@0.1.9) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/compare
+
+
+
+
+
## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@0.1.7...@thi.ng/compare@0.1.8) (2018-09-22)
diff --git a/packages/compare/README.md b/packages/compare/README.md
index 44506ee1dc..75fbc245fa 100644
--- a/packages/compare/README.md
+++ b/packages/compare/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/compare.svg)](https://www.npmjs.com/package/@thi.ng/compare)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/compare.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/compare/package.json b/packages/compare/package.json
index de9145e5c6..a3540fa5bf 100644
--- a/packages/compare/package.json
+++ b/packages/compare/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/compare",
- "version": "0.1.8",
+ "version": "0.1.9",
"description": "Comparator with optional delegation for types implementing @thi.ng/api/ICompare interface",
"main": "./index.js",
"typings": "./index.d.ts",
diff --git a/packages/compose/CHANGELOG.md b/packages/compose/CHANGELOG.md
index 8cc6e27a0a..6301293c69 100644
--- a/packages/compose/CHANGELOG.md
+++ b/packages/compose/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@0.1.3...@thi.ng/compose@0.1.4) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/compose
+
+
+
+
+
## [0.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@0.1.2...@thi.ng/compose@0.1.3) (2018-09-22)
diff --git a/packages/compose/README.md b/packages/compose/README.md
index 43597cb0d5..accff7d6d9 100644
--- a/packages/compose/README.md
+++ b/packages/compose/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/compose.svg)](https://www.npmjs.com/package/@thi.ng/compose)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/compose.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/compose/package.json b/packages/compose/package.json
index 23c6081785..3570ea9b12 100644
--- a/packages/compose/package.json
+++ b/packages/compose/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/compose",
- "version": "0.1.3",
+ "version": "0.1.4",
"description": "Functional composition helpers",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,8 +28,8 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/errors": "^0.1.8"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/errors": "^0.1.9"
},
"keywords": [
"composition",
diff --git a/packages/csp/CHANGELOG.md b/packages/csp/CHANGELOG.md
index 81c5cdb076..d7aeda7e4a 100644
--- a/packages/csp/CHANGELOG.md
+++ b/packages/csp/CHANGELOG.md
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.3.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@0.3.63...@thi.ng/csp@0.3.64) (2018-09-24)
+
+
+### Performance Improvements
+
+* **csp:** `State` => const enum ([c3e8d68](https://github.com/thi-ng/umbrella/commit/c3e8d68))
+
+
+
+
+
## [0.3.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@0.3.63-alpha.1...@thi.ng/csp@0.3.63) (2018-09-22)
diff --git a/packages/csp/README.md b/packages/csp/README.md
index 1aff267865..3c063d0160 100644
--- a/packages/csp/README.md
+++ b/packages/csp/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/csp.svg)](https://www.npmjs.com/package/@thi.ng/csp)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/csp.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/csp/package.json b/packages/csp/package.json
index da12962977..b23784230d 100644
--- a/packages/csp/package.json
+++ b/packages/csp/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/csp",
- "version": "0.3.63",
+ "version": "0.3.64",
"description": "ES6 promise based CSP implementation",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -32,11 +32,11 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/dcons": "^1.1.7",
- "@thi.ng/errors": "^0.1.8",
- "@thi.ng/transducers": "^2.1.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/dcons": "^1.1.8",
+ "@thi.ng/errors": "^0.1.9",
+ "@thi.ng/transducers": "^2.1.3"
},
"keywords": [
"async",
diff --git a/packages/csp/src/api.ts b/packages/csp/src/api.ts
index 446e74698f..12326397bc 100644
--- a/packages/csp/src/api.ts
+++ b/packages/csp/src/api.ts
@@ -2,12 +2,17 @@ import { IID, ILength, IRelease } from "@thi.ng/api/api";
import { Channel } from "./channel";
-export enum State {
+export const enum State {
OPEN,
CLOSED,
DONE,
}
+/**
+ * Reverse lookup for `State` enums
+ */
+export const __State = (exports).State;
+
export interface ChannelItem {
value: () => Promise;
resolve: (success: boolean) => void;
diff --git a/packages/dcons/CHANGELOG.md b/packages/dcons/CHANGELOG.md
index 51fab06abf..29bc7bcd12 100644
--- a/packages/dcons/CHANGELOG.md
+++ b/packages/dcons/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@1.1.7...@thi.ng/dcons@1.1.8) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/dcons
+
+
+
+
+
## [1.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@1.1.7-alpha.1...@thi.ng/dcons@1.1.7) (2018-09-22)
diff --git a/packages/dcons/README.md b/packages/dcons/README.md
index e521e9605f..bf7737e5a1 100644
--- a/packages/dcons/README.md
+++ b/packages/dcons/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/dcons.svg)](https://www.npmjs.com/package/@thi.ng/dcons)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/dcons.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/dcons/package.json b/packages/dcons/package.json
index 7082ffd19e..0e484ad8dc 100644
--- a/packages/dcons/package.json
+++ b/packages/dcons/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dcons",
- "version": "1.1.7",
+ "version": "1.1.8",
"description": "Comprehensive doubly linked list structure w/ iterator support",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,12 +28,12 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/compare": "^0.1.8",
- "@thi.ng/equiv": "^0.1.10",
- "@thi.ng/errors": "^0.1.8",
- "@thi.ng/transducers": "^2.1.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/compare": "^0.1.9",
+ "@thi.ng/equiv": "^0.1.11",
+ "@thi.ng/errors": "^0.1.9",
+ "@thi.ng/transducers": "^2.1.3"
},
"keywords": [
"datastructure",
diff --git a/packages/defmulti/CHANGELOG.md b/packages/defmulti/CHANGELOG.md
index e61fa7e8be..b2bd426006 100644
--- a/packages/defmulti/CHANGELOG.md
+++ b/packages/defmulti/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.3.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@0.3.10...@thi.ng/defmulti@0.3.11) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/defmulti
+
+
+
+
+
## [0.3.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@0.3.9...@thi.ng/defmulti@0.3.10) (2018-09-22)
diff --git a/packages/defmulti/README.md b/packages/defmulti/README.md
index c62135ca85..2ffae5bc39 100644
--- a/packages/defmulti/README.md
+++ b/packages/defmulti/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/defmulti.svg)](https://www.npmjs.com/package/@thi.ng/defmulti)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/defmulti.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/defmulti/package.json b/packages/defmulti/package.json
index ee25fd1a8f..b94d32c73f 100644
--- a/packages/defmulti/package.json
+++ b/packages/defmulti/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/defmulti",
- "version": "0.3.10",
+ "version": "0.3.11",
"description": "Dynamically extensible multiple dispatch via user supplied dispatch function.",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,8 +28,8 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/errors": "^0.1.8"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/errors": "^0.1.9"
},
"keywords": [
"ES6",
diff --git a/packages/dgraph/CHANGELOG.md b/packages/dgraph/CHANGELOG.md
index e2e9f2419b..90a3b677e0 100644
--- a/packages/dgraph/CHANGELOG.md
+++ b/packages/dgraph/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@0.2.19...@thi.ng/dgraph@0.2.20) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/dgraph
+
+
+
+
+
## [0.2.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@0.2.19-alpha.1...@thi.ng/dgraph@0.2.19) (2018-09-22)
diff --git a/packages/dgraph/README.md b/packages/dgraph/README.md
index ef9c28ba28..b4c752082e 100644
--- a/packages/dgraph/README.md
+++ b/packages/dgraph/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/dgraph.svg)](https://www.npmjs.com/package/@thi.ng/dgraph)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/dgraph.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
## About
diff --git a/packages/dgraph/package.json b/packages/dgraph/package.json
index ad39294a43..ed69d7442d 100644
--- a/packages/dgraph/package.json
+++ b/packages/dgraph/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dgraph",
- "version": "0.2.19",
+ "version": "0.2.20",
"description": "Type-agnostic directed acyclic graph (DAG) & graph operations",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,11 +28,11 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/associative": "^0.6.7",
- "@thi.ng/equiv": "^0.1.10",
- "@thi.ng/errors": "^0.1.8",
- "@thi.ng/transducers": "^2.1.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/associative": "^0.6.8",
+ "@thi.ng/equiv": "^0.1.11",
+ "@thi.ng/errors": "^0.1.9",
+ "@thi.ng/transducers": "^2.1.3"
},
"keywords": [
"data structure",
diff --git a/packages/diff/CHANGELOG.md b/packages/diff/CHANGELOG.md
index 82c95b3d11..e72898ca1e 100644
--- a/packages/diff/CHANGELOG.md
+++ b/packages/diff/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@1.1.1...@thi.ng/diff@1.1.2) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/diff
+
+
+
+
+
## [1.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@1.1.0...@thi.ng/diff@1.1.1) (2018-09-22)
diff --git a/packages/diff/README.md b/packages/diff/README.md
index a40eb87568..cdd80a7ca5 100644
--- a/packages/diff/README.md
+++ b/packages/diff/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/diff.svg)](https://www.npmjs.com/package/@thi.ng/diff)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/diff.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/diff/package.json b/packages/diff/package.json
index 2c10157b6c..f244daeb09 100644
--- a/packages/diff/package.json
+++ b/packages/diff/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/diff",
- "version": "1.1.1",
+ "version": "1.1.2",
"description": "Array & object Diff",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -26,8 +26,8 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/equiv": "^0.1.10"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/equiv": "^0.1.11"
},
"keywords": [
"array",
diff --git a/packages/dot/CHANGELOG.md b/packages/dot/CHANGELOG.md
index c5e4c9f64d..0c13cfa4d1 100644
--- a/packages/dot/CHANGELOG.md
+++ b/packages/dot/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@0.1.14...@thi.ng/dot@0.1.15) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/dot
+
+
+
+
+
## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@0.1.14-alpha.0...@thi.ng/dot@0.1.14) (2018-09-22)
diff --git a/packages/dot/README.md b/packages/dot/README.md
index d517c4ba1c..6da2d1195a 100644
--- a/packages/dot/README.md
+++ b/packages/dot/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/dot.svg)](https://www.npmjs.com/package/@thi.ng/dot)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/dot.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/dot/package.json b/packages/dot/package.json
index 30ed861624..0d0a4f4b9d 100644
--- a/packages/dot/package.json
+++ b/packages/dot/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dot",
- "version": "0.1.14",
+ "version": "0.1.15",
"description": "Graphviz DOM abstraction as vanilla JS objects & serialization to DOT format",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,8 +28,8 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11"
},
"keywords": [
"ES6",
diff --git a/packages/equiv/CHANGELOG.md b/packages/equiv/CHANGELOG.md
index e669a808f3..b0e21dacd9 100644
--- a/packages/equiv/CHANGELOG.md
+++ b/packages/equiv/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@0.1.10...@thi.ng/equiv@0.1.11) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/equiv
+
+
+
+
+
## [0.1.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@0.1.9...@thi.ng/equiv@0.1.10) (2018-09-22)
diff --git a/packages/equiv/README.md b/packages/equiv/README.md
index 240fbf59b5..a96a6536f7 100644
--- a/packages/equiv/README.md
+++ b/packages/equiv/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/equiv.svg)](https://www.npmjs.com/package/@thi.ng/equiv)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/equiv.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -17,6 +18,8 @@ Extensible deep equivalence checking for any data types. Supports:
- Date
- RegExp
- types with `.equiv()` implementations
+ ([IEquiv](https://github.com/thi-ng/umbrella/tree/master/packages/api/src/api.ts#L213)
+ interface)
This feature was previously part of the
[@thi.ng/api](https://github.com/thi-ng/umbrella/tree/master/packages/api)
diff --git a/packages/equiv/package.json b/packages/equiv/package.json
index 1d4cf84bb2..2d286d5ff4 100644
--- a/packages/equiv/package.json
+++ b/packages/equiv/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/equiv",
- "version": "0.1.10",
+ "version": "0.1.11",
"description": "Extensible deep equivalence checking for any data types",
"main": "./index.js",
"typings": "./index.d.ts",
diff --git a/packages/errors/CHANGELOG.md b/packages/errors/CHANGELOG.md
index 2635c94a5f..ca6bd52a00 100644
--- a/packages/errors/CHANGELOG.md
+++ b/packages/errors/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@0.1.8...@thi.ng/errors@0.1.9) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/errors
+
+
+
+
+
## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@0.1.7...@thi.ng/errors@0.1.8) (2018-09-22)
diff --git a/packages/errors/README.md b/packages/errors/README.md
index ad47435bbc..b93e0f4ba1 100644
--- a/packages/errors/README.md
+++ b/packages/errors/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/errors.svg)](https://www.npmjs.com/package/@thi.ng/errors)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/errors.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/errors/package.json b/packages/errors/package.json
index 621495fcf5..ec817aa873 100644
--- a/packages/errors/package.json
+++ b/packages/errors/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/errors",
- "version": "0.1.8",
+ "version": "0.1.9",
"description": "Custom error types and helper fns.",
"main": "./index.js",
"typings": "./index.d.ts",
diff --git a/packages/hdom-canvas/CHANGELOG.md b/packages/hdom-canvas/CHANGELOG.md
index 10b7c41aff..a953d26a1e 100644
--- a/packages/hdom-canvas/CHANGELOG.md
+++ b/packages/hdom-canvas/CHANGELOG.md
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@0.1.1...@thi.ng/hdom-canvas@0.1.2) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/hdom-canvas
+
+
+
+
+
+
+## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@0.1.0...@thi.ng/hdom-canvas@0.1.1) (2018-09-23)
+
+**Note:** Version bump only for package @thi.ng/hdom-canvas
+
+
+
+
+
# [0.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@0.1.0-alpha.1...@thi.ng/hdom-canvas@0.1.0) (2018-09-22)
diff --git a/packages/hdom-canvas/README.md b/packages/hdom-canvas/README.md
index 7c6adb197e..38cf38a584 100644
--- a/packages/hdom-canvas/README.md
+++ b/packages/hdom-canvas/README.md
@@ -1,6 +1,8 @@
# @thi.ng/hdom-canvas
[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/hdom-canvas.svg)](https://www.npmjs.com/package/@thi.ng/hdom-canvas)
+![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hdom-canvas.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/hdom-canvas/package.json b/packages/hdom-canvas/package.json
index d23a371ce1..bc35c61122 100644
--- a/packages/hdom-canvas/package.json
+++ b/packages/hdom-canvas/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hdom-canvas",
- "version": "0.1.0",
+ "version": "0.1.2",
"description": "Declarative canvas scenegraph & visualization for @thi.ng/hdom",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,10 +28,10 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/diff": "^1.1.1",
- "@thi.ng/hdom": "^5.0.0"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/diff": "^1.1.2",
+ "@thi.ng/hdom": "^5.0.2"
},
"keywords": [
"ES6",
diff --git a/packages/hdom-components/CHANGELOG.md b/packages/hdom-components/CHANGELOG.md
index 919ab68804..ac72686151 100644
--- a/packages/hdom-components/CHANGELOG.md
+++ b/packages/hdom-components/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [2.2.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@2.2.6...@thi.ng/hdom-components@2.2.7) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/hdom-components
+
+
+
+
+
## [2.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@2.2.6-alpha.1...@thi.ng/hdom-components@2.2.6) (2018-09-22)
diff --git a/packages/hdom-components/README.md b/packages/hdom-components/README.md
index 5899482729..a9dbe40645 100644
--- a/packages/hdom-components/README.md
+++ b/packages/hdom-components/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/hdom-components.svg)](https://www.npmjs.com/package/@thi.ng/hdom-components)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hdom-components.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/hdom-components/package.json b/packages/hdom-components/package.json
index 424eab2c22..3f061d396d 100644
--- a/packages/hdom-components/package.json
+++ b/packages/hdom-components/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hdom-components",
- "version": "2.2.6",
+ "version": "2.2.7",
"description": "Raw, skinnable UI & SVG components for @thi.ng/hdom",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,9 +28,9 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/transducers": "^2.1.2",
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/transducers": "^2.1.3",
"@types/webgl2": "^0.0.4"
},
"keywords": [
diff --git a/packages/hdom/CHANGELOG.md b/packages/hdom/CHANGELOG.md
index 5d2b5ff128..694be3c7cf 100644
--- a/packages/hdom/CHANGELOG.md
+++ b/packages/hdom/CHANGELOG.md
@@ -3,39 +3,58 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-# [5.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.0-alpha.1...@thi.ng/hdom@5.0.0) (2018-09-22)
+
+## [5.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.1...@thi.ng/hdom@5.0.2) (2018-09-24)
+**Note:** Version bump only for package @thi.ng/hdom
-### Features
-* **hdom:** add renderOnce() ([5ef9cf0](https://github.com/thi-ng/umbrella/commit/5ef9cf0))
-### Performance Improvements
-* **hdom:** minor updates ([de17db8](https://github.com/thi-ng/umbrella/commit/de17db8))
+
+## [5.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.0...@thi.ng/hdom@5.0.1) (2018-09-23)
+**Note:** Version bump only for package @thi.ng/hdom
-
-# [5.0.0-alpha.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.0-alpha.0...@thi.ng/hdom@5.0.0-alpha.1) (2018-09-17)
-**Note:** Version bump only for package @thi.ng/hdom
+
+# [5.0.0](https://github.com/thi-ng/umbrella/compare/525d90d5...@thi.ng/hdom@5.0.0) (2018-09-22)
+### Features
+* **hdom:** generalize diffElement() ([#4](https://github.com/thi-ng/umbrella/issues/4)) ([525d90d](https://github.com/thi-ng/umbrella/commit/525d90d))
+* **hdom:** update normalizeTree, add to HDOMImplementation ([59bb19c](https://github.com/thi-ng/umbrella/commit/59bb19c))
+* **hdom:** reorg & extend HDOMImplementation ([1ac245f](https://github.com/thi-ng/umbrella/commit/1ac245f))
+* **hdom:** add `.toHiccup()` interface support ([54ba0ce](https://github.com/thi-ng/umbrella/commit/54ba0ce))
+* **hdom:** add renderOnce() ([5ef9cf0](https://github.com/thi-ng/umbrella/commit/5ef9cf0))
+### Bug fixes
-
-# [5.0.0-alpha.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@5.0.0-alpha...@thi.ng/hdom@5.0.0-alpha.0) (2018-09-17)
+* **hdom:** minor fix (hydrateDOM) ([e4f780c](https://github.com/thi-ng/umbrella/commit/e4f780c))
+* **hdom:** exclude hdom control attribs in setAttrib() ([0592063](https://github.com/thi-ng/umbrella/commit/0592063))
+* **hdom:** delegate diffTree() to branch impl ([6c33901](https://github.com/thi-ng/umbrella/commit/6c33901))
-**Note:** Version bump only for package @thi.ng/hdom
+### Performance Improvements
+* **hdom:** add opt `__release` attrib to disable releaseDeep() ([2e3fb66](https://github.com/thi-ng/umbrella/commit/2e3fb66))
+* **hdom:** update diffTree(), inline node type checks ([382c45c](https://github.com/thi-ng/umbrella/commit/382c45c))
+* **hdom:** minor updates ([de17db8](https://github.com/thi-ng/umbrella/commit/de17db8))
+
+
+### BREAKING CHANGES
+* **hdom:** new names & call signatures for:
+ - normalizeTree
+ - diffElement => diffTree
+ - createDOM
+ - hydrateDOM
+ - replaceChild
diff --git a/packages/hdom/README.md b/packages/hdom/README.md
index e7aa14d541..344bd23b57 100644
--- a/packages/hdom/README.md
+++ b/packages/hdom/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/hdom.svg)](https://www.npmjs.com/package/@thi.ng/hdom)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hdom.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -37,6 +38,7 @@ This project is part of the
- [Dependencies](#dependencies)
- [API & Usage](#api--usage)
- [start()](#start)
+ - [renderOnce()](#renderonce)
- [HDOMOpts config options](#hdomopts-config-options)
- [normalizeTree()](#normalizetree)
- [diffTree()](#difftree)
@@ -52,8 +54,8 @@ This project is part of the
## About
-Extensible, abstract, hierarchical UI component tree definition syntax &
-differential tree updates using only vanilla JS data structures (arrays,
+Lightweight UI component tree definition syntax, DOM creation and
+differential updates using only vanilla JS data structures (arrays,
iterators, closures, attribute objects or objects with life cycle
functions, closures). By default targets the browser's native DOM, but
supports other arbitrary target implementations in a branch-local
@@ -66,7 +68,7 @@ Benefits:
- Use the full expressiveness of ES6 / TypeScript to define user interfaces
- No enforced opinion about state handling, very flexible
- Clean, functional component composition & reuse
-- No source pre-processing, pre-compilation or string interpolation
+- No source pre-processing, transpiling or string interpolation
- Less verbose than HTML / JSX, resulting in smaller file sizes
- Supports arbitrary elements (incl. SVG), attributes and events in
uniform, S-expression based syntax
@@ -74,9 +76,9 @@ Benefits:
non-DOM) target data structures to which tree diffs are applied to
- Suitable for server-side rendering and then "hydrating" listeners and
components with life cycle methods on the client side
-- Static components (or component templates) can be distributed as JSON
-- Optional user context injection (an arbitrary object passed to all
- component functions embedded in the tree)
+- Can use JSON for static components (or component templates)
+- Optional user context injection (an arbitrary object/value passed to
+ all component functions embedded in the tree)
- Default implementation supports CSS conversion from JS objects for
`style` attribs (also see:
[@thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-css))
@@ -96,7 +98,7 @@ import * as hdom from "@thi.ng/hdom";
// stateless component w/ params
// the first arg is an auto-injected context object
-// (not used here, details further below)
+// (not used here, see dedicated section in readme further below)
const greeter = (_, name) => ["h1.title", "hello ", name];
// component w/ local state
@@ -115,12 +117,12 @@ const app = () => {
hdom.start(app(), { root: document.body });
// alternatively create DOM tree only once
-hdom.createDOM({}, document.body, hdom.normalizeTree(app()));
+hdom.renderOnce(app(), { root: document.body });
```
-Alternatively, use the same component function for browser or server
-side HTML serialization (Note: does not emit attributes w/ functions as
-values, e.g. a button's `onclick` attrib).
+Alternatively, use the same component for browser or server side HTML
+serialization (Note: does not emit attributes w/ functions as values,
+e.g. a button's `onclick` attrib).
```ts
import { serialize } from "@thi.ng/hiccup";
@@ -187,6 +189,9 @@ needed.
[Live demo](http://demo.thi.ng/umbrella/interceptor-basics/) |
[Source code](https://github.com/thi-ng/umbrella/tree/master/examples/interceptor-basics)
+[Live demo](http://demo.thi.ng/umbrella/interceptor-basics2/) |
+[Source code](https://github.com/thi-ng/umbrella/tree/master/examples/interceptor-basics2) (extended version)
+
```ts
import { Atom } from "@thi.ng/atom";
import { start } from "@thi.ng/hdom";
@@ -237,8 +242,8 @@ start(
},
`clicks: ${state.value.clicks}`] :
null,
- // hdom options incl.
- // arbitrary user context object passed to all components
+ // hdom options, here including an arbitrary user context object
+ // passed to all components
{ ctx: { state, bus } }
);
@@ -250,10 +255,11 @@ bus.dispatch(["init"]);
This example uses the
[@thi.ng/hdom-canvas](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-canvas)
-component to support the inclusion of (virtual, non-DOM targets) shape
+component to support the inclusion of (virtual / non-DOM targets) shape
elements as part of the normal HTML component tree. A description of the
actual mechanism can be found further below and in the hdom-canvas
-readme.
+readme. In short, all canvas child elements will be translated into
+canvas API draw calls.
Related examples:
@@ -289,30 +295,34 @@ start(() =>
### The hdom data flow
-The usual hdom update process is based on the creation of an up-to-date
-component tree, which is first normalized (expanded into a canonical
-format) and the used to compute minimal edit set of the recursive
-difference to previous DOM tree.
+The usual hdom update process is as follows: First the user app creates
+an up-to-date UI component tree, which is then passed to hdom, will be
+normalized (expanded into a canonical format) and then used to
+recursively compute the minimal edit set of the difference to the
+previous DOM tree.
**Important**:
-- hdom uses a RAF render loop only by default, but is in absolutely
-no way tied to this
-- hdom used the browser DOM only by default, but supports custom target
- implementations, which can be defined on branch-local basis in the
+- hdom uses a RAF render loop only by default, but is in absolutely no
+ way tied to this (see
+ [@thi.ng/transducers-hdom](https://github.com/thi-ng/umbrella/tree/master/packages/transducers-hdom)
+ for a possible alternative)
+- hdom uses the browser DOM only by default, but supports custom target
+ implementations, which can modify other target data structures. These
+ custom implementations can be triggered on branch-local basis in the
tree
- hdom NEVER tracks the real DOM, only its own trees (previous & current)
- hdom can be used **without** diffing, i.e. for compact, one-off DOM
- creation
+ creation (see [`renderOnce()`](#renderonce))
![hdom dataflow](https://raw.githubusercontent.com/thi-ng/umbrella/master/assets/hdom-dataflow.png)
The syntax is inspired by Clojure's
[Hiccup](https://github.com/weavejester/hiccup) and
[Reagent](http://reagent-project.github.io/) projects, which themselves
-were influenced on [prior art by Phil
+were influenced by [prior art by Phil
Wadler](http://homepages.inf.ed.ac.uk/wadler/papers/next700/next700.pdf)
-at Edinburgh University who pioneered this approach in Lisp back in
+at Edinburgh University, who pioneered this approach in Lisp back in
1999. hdom offers several additional features to these established
approaches.
@@ -349,10 +359,12 @@ Equivalent HTML:
### Attribute objects
-Attributes objects are used to define arbitrary attributes, CSS
-properties and event listeners. The latter always have to be prefixed
-with `on` and their values always must be functions (naturally). CSS
-props are assigned to the `style` attribute, but given as JS object.
+Attributes objects are optional, but if present always given as the 2nd
+element in an element array and are used to define arbitrary attributes,
+CSS properties and event listeners. The latter always have to be
+prefixed with `on` and their values always must be functions
+(naturally). CSS props are assigned to the `style` attribute, but given
+as JS object.
```ts
["a", {
@@ -372,16 +384,19 @@ props are assigned to the `style` attribute, but given as JS object.
Say Hi
```
-Attribute values can be functions themselves and if so will be called
-with the entire attributes object as sole argument. Same goes for CSS
-property function values (which receive the entire `style` object). In
-both cases, this supports the creation of derived values based on other
+With the exception of event listeners (which are always functions),
+others attribute values can be functions too and if so will be called
+with the entire attributes object as sole argument and their return
+value used as actual attribute value. Same goes for CSS property
+function values (which receive the entire `style` object). In both
+cases, this supports the creation of derived values based on other
attribs:
```ts
const btAttribs = {
- // event handler are always functions
+ // event handlers are always standard listener functions
onclick: (e)=> alert(e.target.id),
+ // these fns receive the entire attribs object
class: (attr) => `bt bt-${attr.id}`,
href: (attr) => `#${attr.id}`,
};
@@ -473,10 +488,11 @@ see [this issue
comment](https://github.com/thi-ng/umbrella/issues/42#issuecomment-420094339)
for potential pitfalls.
-Please see the
+The
[@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers)
-package, which provides 130+ functions to create, compose and work with
-iterator based pipelines.
+package provides 130+ functions to create, compose and work with
+iterator based pipelines. These are very powerful & handy for component
+construction as well!
```ts
import { map, range } from "@thi.ng/transducers";
@@ -510,8 +526,12 @@ repo, but also any user defined custom types:
```ts
class Foo {
+ constructor(val) {
+ this.value = val;
+ }
+
deref() {
- return ["div.deref"];
+ return ["div.deref", this.value];
}
}
@@ -519,18 +539,33 @@ class Foo {
// receives current user context as argument
// (see section further below)
class Bar {
+ constructor(val) {
+ this.value = val;
+ }
+
toHiccup(ctx) {
return ["div.hiccup", ctx && ctx.foo, this.value];
}
}
-["div", new Foo(), new Bar()]
+// to demonstrate usage of the user context we're using
+// @thi.ng/hiccup's serialize() function here, which too
+// supports user context handling, but produces an HTML string
+serialize(
+ ["div", new Foo(23), new Bar(42)],
+ // global user context with theming rules
+ // here only use tachyons css classes, but could be anything...
+ {
+ foo: { class: "bg-lightest-blue navy pa2 ma0" }
+ }
+);
```
```html
-
-
+
23
+
+
42
```
@@ -564,6 +599,13 @@ interface ILifecycle {
* determine if an `init` is necessary. `init` itself will be
* called from `diffTree`, `createDOM` or `hydrateDOM()` in a later
* phase of processing.
+ *
+ * `render` should ALWAYS return an array or another function,
+ * else the component's `init` or `release` fns will NOT be able
+ * to be called later. E.g. If the return value of `render`
+ * evaluates as a string or number, the return value should be
+ * wrapped as `["span", "foo"]`. If no `init` or `release` are
+ * used, this requirement is relaxed.
*/
render(ctx: any, ...args: any[]): any;
@@ -577,12 +619,12 @@ interface ILifecycle {
When the component is first used the order of execution is: `render` ->
`init`. The `release` method is only called when the component has been
-removed / replaced (basically if it's not present in the new tree
+removed / replaced (basically, if it's not present in the new tree
anymore). **The `release` implementation should NOT manually call
-`release()` on any children, since that's already handled by
+`release()` on any children, since that's already been handled by hdom's
`diffTree()`.**
-The rest `...args` provided are sourced from the component call site as
+Any remaining arguments are sourced from the component call site as
this simple example demonstrates:
```ts
@@ -605,29 +647,29 @@ const canvas = () => {
// inline initialization is okay here...
start(
[canvas(), { width: 100, height: 100 }, "Hello world"],
- { root: document.body }
);
// usage scenario #2: dynamic component
// in this example, the root component itself is given as function,
// which is evaluated each frame.
-// since `canvas()` is a higher order component it too produces
+// since `canvas()` is a higher order component it would produce
// a new instance with each call. therefore the canvas instance(s)
-// need to be created beforehand
+// need to be created beforehand...
const app = () => {
// pre-instantiate canvases
const c1 = canvas();
const c2 = canvas();
- // return root component function
- return () => ["div",
- // use canvas instances
- [c1, { width: 100, height: 100 }, "Hello world"],
- [c2, { width: 100, height: 100 }, "Goodbye world", "blue"]
- ];
+ // return actual root component function
+ return () =>
+ ["div",
+ // use canvas instances
+ [c1, { width: 100, height: 100 }, "Hello world"],
+ [c2, { width: 100, height: 100 }, "Goodbye world", "blue"]
+ ];
};
-start(app(), { root: document.body });
+start(app());
```
### Event & state handling options
@@ -822,9 +864,16 @@ pre-existing DOM and the hdom trees will cause undefined behavior.
`start` returns a function, which when called, immediately cancels the
update loop.
+### renderOnce()
+
+One-off hdom tree conversion & target DOM application. Takes same args
+as `start()`, but performs no diffing and only creates or hydrates
+target (DOM) once. The given tree is first normalized and no further
+action will be taken, if the normalized result is `null` or `undefined`.
+
### HDOMOpts config options
-Config options object passed to hdom's `start()` or
+Config options object passed to hdom's `start()`, `renderOnce()` or
[@thi.ng/transducers-hdom](https://github.com/thi-ng/umbrella/tree/master/packages/transducers-hdom)'s
`updateDOM()`:
@@ -856,6 +905,9 @@ its canonical form:
- resolves Emmet-style tags (e.g. from `div#id.foo.bar`)
- adds missing attribute objects (and `key` attribs)
+- merges Emmet-style classes with additional `class` attrib values (if
+ given), e.g. `["div.foo", { class: "bar" }]` => `["div", { class: "bar
+ foo" }]`
- evaluates embedded functions and replaces them with their result
- calls the `render` life cycle method on component objects and uses
result
@@ -865,7 +917,7 @@ its canonical form:
- calls `toHiccup()` on elements implementing the `IToHiccup` interface
and uses returned results
- calls `.toString()` on any other non-component value and by default
- wrapps it in `["span", x]`. The only exceptions to this are: `button`,
+ wraps it in `["span", x]`. The only exceptions to this are: `button`,
`option`, `textarea` and SVG `text` elements, for which spans are
never created.
@@ -972,19 +1024,21 @@ start(app, { ctx });
### Behavior control attributes
-The following special attributes can be added to elements to choose
-and/or control the branch-local behavior of the hdom implementation:
+The following special attributes can be added to elements to control the
+branch-local behavior of the hdom implementation:
#### __impl
-A custom implementation of the `HDOMImplementation` interface.
-Currently,
+If present, the element and all of its children will be processed by the
+given implementation of the `HDOMImplementation` interface. Currently,
[@thi.ng/hdom-canvas](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-canvas)
is the only example of a component using this feature.
#### __diff
-If `false`, disables diffing of the current branch and replaces the old one with current.
+If true (default), the element will be fully processed by `diffTree()`.
+If false, no diff will be computed and the `replaceChild()` operation
+will be called in the currently active hdom target implementation.
#### __normalize
@@ -994,14 +1048,14 @@ this when you're sure that all children are already in canonical format
#### __release
-If `false`, do not attempt to call `release()` lifecycle methods on this
-element or any of its children.
+If `false`, hdom will not attempt to call `release()` lifecycle methods
+on this element or any of its children.
#### __serialize
[@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup)
-only. If `false`, this element and its children will not be serialized
-to XML syntax.
+only. If `false`, this element and its children will be omitted from the
+serialized output.
### Benchmark
diff --git a/packages/hdom/package.json b/packages/hdom/package.json
index ee01f81031..f66e0f009a 100644
--- a/packages/hdom/package.json
+++ b/packages/hdom/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hdom",
- "version": "5.0.0",
+ "version": "5.0.2",
"description": "Lightweight vanilla ES6 UI component trees with customizable branch-local behaviors",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -20,7 +20,7 @@
"test": "rm -rf build && tsc -p test && nyc mocha build/test/*.js"
},
"devDependencies": {
- "@thi.ng/atom": "^1.5.3",
+ "@thi.ng/atom": "^1.5.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.5.5",
"mocha": "^5.2.0",
@@ -29,11 +29,11 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/diff": "^1.1.1",
- "@thi.ng/equiv": "^0.1.10",
- "@thi.ng/hiccup": "^2.3.0"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/diff": "^1.1.2",
+ "@thi.ng/equiv": "^0.1.11",
+ "@thi.ng/hiccup": "^2.4.1"
},
"keywords": [
"browser",
diff --git a/packages/hdom/src/api.ts b/packages/hdom/src/api.ts
index 6fc48cd792..09e2358d2f 100644
--- a/packages/hdom/src/api.ts
+++ b/packages/hdom/src/api.ts
@@ -1,8 +1,40 @@
import { IObjectOf } from "@thi.ng/api/api";
export interface ILifecycle {
+ /**
+ * Component init method. Called with the actual DOM element,
+ * hdom user context and any other args when the component is
+ * first used, but **after** `render()` has been called once already.
+ */
init?(el: Element, ctx: any, ...args: any[]);
+
+ /**
+ * Returns the hdom tree of this component.
+ * Note: Always will be called first (prior to `init`/`release`)
+ * to obtain the actual component definition used for diffing.
+ * Therefore might have to include checks if any local state
+ * has already been initialized via `init`. This is the only
+ * mandatory method which MUST be implemented.
+ *
+ * `render` is executed before `init` because `normalizeTree()`
+ * must obtain the component's hdom tree first before it can
+ * determine if an `init` is necessary. `init` itself will be
+ * called from `diffTree`, `createDOM` or `hydrateDOM()` in a later
+ * phase of processing.
+ *
+ * `render` should ALWAYS return an array or another function,
+ * else the component's `init` or `release` fns will NOT be able
+ * to be called later. E.g. If the return value of `render`
+ * evaluates as a string or number, the return value should be
+ * wrapped as `["span", "foo"]`. If no `init` or `release` are
+ * used, this requirement is relaxed.
+ */
render(ctx: any, ...args: any[]): any;
+
+ /**
+ * Called when the underlying DOM of this component is removed
+ * (or replaced). Intended for cleanup tasks.
+ */
release?(ctx: any, ...args: any[]);
}
@@ -11,7 +43,7 @@ export interface HDOMBehaviorAttribs {
* HDOM behavior control attribute. If true (default), the element
* will be fully processed by `diffTree()`. If false, no diff will
* be computed and the `replaceChild()` operation will be called in
- * the currently active hdom target.
+ * the currently active hdom target implementation.
*/
__diff?: boolean;
/**
@@ -21,11 +53,16 @@ export interface HDOMBehaviorAttribs {
*/
__impl?: HDOMImplementation;
/**
- * HDOM behavior control attribute.
+ * HDOM behavior control attribute. If `false`, the current
+ * element's children will not be normalized. Use this when you're
+ * sure that all children are already in canonical format (incl.
+ * `key` attributes). See `normalizeTree()` for details.
*/
__normalize?: boolean;
/**
- * HDOM behavior control attribute.
+ * HDOM behavior control attribute. If `false`, hdom will not
+ * attempt to call `release()` lifecycle methods on this element or
+ * any of its children.
*/
__release?: boolean;
}
diff --git a/packages/hdom/src/normalize.ts b/packages/hdom/src/normalize.ts
index 18cd399239..190e5a39e2 100644
--- a/packages/hdom/src/normalize.ts
+++ b/packages/hdom/src/normalize.ts
@@ -61,26 +61,35 @@ export const normalizeElement = (spec: any[], keys: boolean) => {
/**
* Calling this function is a prerequisite before passing a component
- * tree to `diffTree`. Recursively expands given hiccup component
- * tree into its canonical form by:
+ * tree to `diffTree()`. Recursively expands given hiccup component tree
+ * into its canonical form:
*
- * - resolving Emmet-style tags (e.g. from `div#id.foo.bar`)
- * - evaluating embedded functions and replacing them with their result
- * - calling `render` life cycle method on component objects and using
+ * ```
+ * ["tag", { attribs }, ...body]
+ * ```
+ *
+ * - resolves Emmet-style tags (e.g. from `div#id.foo.bar`)
+ * - adds missing attribute objects (and `key` attribs)
+ * - merges Emmet-style classes with additional `class` attrib values
+ * (if given), e.g. `["div.foo", { class: "bar" }]` => `["div", {
+ * class: "bar foo" }]`
+ * - evaluates embedded functions and replaces them with their result
+ * - calls the `render` life cycle method on component objects and uses
* result
- * - consuming iterables and normalizing results
- * - calling `deref()` on elements implementing `IDeref` interface and
- * using returned result
- * - calling `.toString()` on any other non-component value `x` and by
- * default wrapping it in `["span", x]`. The only exceptions to this
- * are: `option`, `textarea` and SVG `text` elements, for which spans
- * are always skipped.
+ * - consumes iterables and normalizes their individual values
+ * - calls `deref()` on elements implementing the `IDeref` interface and
+ * uses returned results
+ * - calls `toHiccup()` on elements implementing the `IToHiccup`
+ * interface and uses returned results
+ * - calls `.toString()` on any other non-component value and by default
+ * wraps it in `["span", x]`. The only exceptions to this are:
+ * `button`, `option`, `textarea` and SVG `text` elements, for which
+ * spans are never created.
*
- * Additionally, unless `keys` is set to false, an unique `key`
- * attribute is created for each node in the tree. This attribute is
- * used by `diffTree` to determine if a changed node can be patched
- * or will need to be replaced/removed. The `key` values are defined by
- * the `path` array arg.
+ * Additionally, unless the `keys` option is explicitly set to false, an
+ * unique `key` attribute is created for each node in the tree. This
+ * attribute is used by `diffElement` to determine if a changed node can
+ * be patched or will need to be moved, replaced or removed.
*
* In terms of life cycle methods: `render` should ALWAYS return an
* array or another function, else the component's `init` or `release`
@@ -89,9 +98,6 @@ export const normalizeElement = (spec: any[], keys: boolean) => {
* wrapped as `["span", "foo"]`. If no `init` or `release` are used,
* this requirement is relaxed.
*
- * For normal usage only the first 2 args should be specified and the
- * rest kept at their defaults.
- *
* See `normalizeElement` for further details about canonical form.
*
* @param tree
diff --git a/packages/hdom/src/render-once.ts b/packages/hdom/src/render-once.ts
index aff3e7ca79..65bdd042c9 100644
--- a/packages/hdom/src/render-once.ts
+++ b/packages/hdom/src/render-once.ts
@@ -1,11 +1,11 @@
-import { isString } from "@thi.ng/checks/is-string";
import { HDOMImplementation, HDOMOpts } from "./api";
import { DEFAULT_IMPL } from "./default";
+import { resolveRoot } from "./utils";
/**
* One-off hdom tree conversion & target DOM application. Takes same
* options as `start()`, but performs no diffing and only creates or
- * hydrates target once. The given tree is first normalized and not
+ * hydrates target once. The given tree is first normalized and no
* further action will be taken, if the normalized result is `null` or
* `undefined`.
*
@@ -15,9 +15,7 @@ import { DEFAULT_IMPL } from "./default";
*/
export const renderOnce = (tree: any, opts?: Partial, impl: HDOMImplementation = DEFAULT_IMPL) => {
opts = { root: "app", ...opts };
- const root = isString(opts.root) ?
- document.getElementById(opts.root) :
- opts.root;
+ const root = resolveRoot(opts.root);
tree = impl.normalizeTree(opts, tree);
if (!tree) return;
opts.hydrate ?
diff --git a/packages/hdom/src/start.ts b/packages/hdom/src/start.ts
index 3726b5ee10..043af9e915 100644
--- a/packages/hdom/src/start.ts
+++ b/packages/hdom/src/start.ts
@@ -1,7 +1,6 @@
-import { isString } from "@thi.ng/checks/is-string";
-
import { HDOMImplementation, HDOMOpts } from "./api";
import { DEFAULT_IMPL } from "./default";
+import { resolveRoot } from "./utils";
/**
* Takes an hiccup tree (array, function or component object w/ life
@@ -45,9 +44,7 @@ export const start = (tree: any, opts?: Partial, impl: HDOMImplementat
opts = { root: "app", ...opts };
let prev = [];
let isActive = true;
- const root = isString(opts.root) ?
- document.getElementById(opts.root) :
- opts.root;
+ const root = resolveRoot(opts.root);
const update = () => {
if (isActive) {
const curr = impl.normalizeTree(opts, tree);
diff --git a/packages/hdom/src/utils.ts b/packages/hdom/src/utils.ts
new file mode 100644
index 0000000000..01c9a39797
--- /dev/null
+++ b/packages/hdom/src/utils.ts
@@ -0,0 +1,6 @@
+import { isString } from "@thi.ng/checks/is-string";
+
+export const resolveRoot = (root: any) =>
+ isString(root) ?
+ document.getElementById(root) :
+ root;
\ No newline at end of file
diff --git a/packages/heaps/CHANGELOG.md b/packages/heaps/CHANGELOG.md
index 7a55ccaf75..87b30449d6 100644
--- a/packages/heaps/CHANGELOG.md
+++ b/packages/heaps/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@0.2.18...@thi.ng/heaps@0.2.19) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/heaps
+
+
+
+
+
## [0.2.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@0.2.17...@thi.ng/heaps@0.2.18) (2018-09-22)
diff --git a/packages/heaps/README.md b/packages/heaps/README.md
index c01078544f..fcc509ffd6 100644
--- a/packages/heaps/README.md
+++ b/packages/heaps/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/heaps.svg)](https://www.npmjs.com/package/@thi.ng/heaps)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/heaps.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/heaps/package.json b/packages/heaps/package.json
index f161b97f4a..c74b7c0b44 100644
--- a/packages/heaps/package.json
+++ b/packages/heaps/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/heaps",
- "version": "0.2.18",
+ "version": "0.2.19",
"description": "Generic binary heap & d-ary heap implementations with customizable ordering",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,8 +28,8 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/compare": "^0.1.8"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/compare": "^0.1.9"
},
"keywords": [
"data structure",
diff --git a/packages/hiccup-css/CHANGELOG.md b/packages/hiccup-css/CHANGELOG.md
index 1ca2e50f10..5ab23e7314 100644
--- a/packages/hiccup-css/CHANGELOG.md
+++ b/packages/hiccup-css/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@0.2.22...@thi.ng/hiccup-css@0.2.23) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/hiccup-css
+
+
+
+
+
## [0.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@0.2.22-alpha.1...@thi.ng/hiccup-css@0.2.22) (2018-09-22)
diff --git a/packages/hiccup-css/README.md b/packages/hiccup-css/README.md
index 8c485063d8..cc99bcc994 100644
--- a/packages/hiccup-css/README.md
+++ b/packages/hiccup-css/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/hiccup-css.svg)](https://www.npmjs.com/package/@thi.ng/hiccup-css)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hiccup-css.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
diff --git a/packages/hiccup-css/package.json b/packages/hiccup-css/package.json
index ffdd2f843e..b33d830cf1 100644
--- a/packages/hiccup-css/package.json
+++ b/packages/hiccup-css/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hiccup-css",
- "version": "0.2.22",
+ "version": "0.2.23",
"description": "CSS from nested JS data structures",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,10 +28,10 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/api": "^4.2.0",
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/errors": "^0.1.8",
- "@thi.ng/transducers": "^2.1.2"
+ "@thi.ng/api": "^4.2.1",
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/errors": "^0.1.9",
+ "@thi.ng/transducers": "^2.1.3"
},
"keywords": [
"clojure",
diff --git a/packages/hiccup-svg/CHANGELOG.md b/packages/hiccup-svg/CHANGELOG.md
index 7bbe99cef1..1e0f5fed39 100644
--- a/packages/hiccup-svg/CHANGELOG.md
+++ b/packages/hiccup-svg/CHANGELOG.md
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [2.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@2.0.1...@thi.ng/hiccup-svg@2.0.2) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/hiccup-svg
+
+
+
+
+
+
+## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@2.0.0...@thi.ng/hiccup-svg@2.0.1) (2018-09-23)
+
+**Note:** Version bump only for package @thi.ng/hiccup-svg
+
+
+
+
+
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@2.0.0-alpha.1...@thi.ng/hiccup-svg@2.0.0) (2018-09-22)
diff --git a/packages/hiccup-svg/README.md b/packages/hiccup-svg/README.md
index 7c455b990e..afd9026745 100644
--- a/packages/hiccup-svg/README.md
+++ b/packages/hiccup-svg/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/hiccup-svg.svg)](https://www.npmjs.com/package/@thi.ng/hiccup-svg)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hiccup-svg.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -32,6 +33,22 @@ svg.svg(svg.circle([0, 0], 100, { fill: "red" }));
[svg.svg, [svg.circle, [0, 0], 100, { fill: "red" }]]
```
+### SVG conversion of hdom-canvas shape trees
+
+Since v2.0.0 this package provides a conversion utility to translate the
+more compact syntax used for
+[@thi.ng/hdom-canvas](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-canvas)
+shape trees (designed for more performant realtime canvas drawing) into
+a SVG serializable hiccup format.
+
+The `convertTree()` function takes a normalized hiccup tree of
+hdom-canvas shape definitions and recursively converts it into an hiccup
+flavor which is ready for SVG serialization. This conversion also
+involves translation & re-organization of various attributes. The
+function returns a new tree. The original remains untouched, as will any
+unrecognized tree/shape nodes (those will be transferred as-is to the
+result tree). See example below.
+
## Installation
```bash
@@ -49,7 +66,8 @@ import * as svg from "@thi.ng/hiccup-svg";
import { serialize } from "@thi.ng/hiccup";
import * as fs from "fs";
-fs.writeFileSync("hello.svg",
+fs.writeFileSync(
+ "hello.svg",
serialize(
svg.svg(
{width: 100, height: 100},
@@ -60,6 +78,54 @@ fs.writeFileSync("hello.svg",
));
```
+Minimal example showing SVG conversion of a hdom-canvas scene:
+
+```ts
+// scene tree defined for hdom-canvas
+const scene = [
+ ["defs", {},
+ ["radialGradient",
+ { id: "bg", from: [150, 280], to: [150, 300], r1: 300, r2: 100 },
+ [[0, "#07f"], [0.5, "#0ef"], [0.8, "#efe"], [1, "#af0"]]],
+ ["radialGradient",
+ { id: "sun", from: [110, 120], to: [110, 120], r1: 5, r2: 50 },
+ [[0, "#fff"], [1, "rgba(255,255,192,0)"]]]
+ ],
+ ["circle", { fill: "$bg" }, [150, 150], 130],
+ ["circle", { fill: "$sun" }, [110, 120], 50],
+];
+
+fs.writeFileSync(
+ "radialgradient.svg",
+ serialize(
+ svg.svg({ width: 300, height: 300 }, svg.convertTree(scene))
+ )
+);
+```
+
+Result:
+
+```xml
+
+```
+
## Authors
- Karsten Schmidt
diff --git a/packages/hiccup-svg/package.json b/packages/hiccup-svg/package.json
index dc2b6a30a4..75f92415d0 100644
--- a/packages/hiccup-svg/package.json
+++ b/packages/hiccup-svg/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hiccup-svg",
- "version": "2.0.0",
+ "version": "2.0.2",
"description": "SVG element functions for @thi.ng/hiccup & @thi.ng/hdom",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,7 +28,7 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/hiccup": "^2.3.0"
+ "@thi.ng/hiccup": "^2.4.1"
},
"keywords": [
"components",
diff --git a/packages/hiccup/CHANGELOG.md b/packages/hiccup/CHANGELOG.md
index c3657552d5..d2d75155d5 100644
--- a/packages/hiccup/CHANGELOG.md
+++ b/packages/hiccup/CHANGELOG.md
@@ -3,6 +3,27 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [2.4.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@2.4.0...@thi.ng/hiccup@2.4.1) (2018-09-24)
+
+**Note:** Version bump only for package @thi.ng/hiccup
+
+
+
+
+
+
+# [2.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@2.3.0...@thi.ng/hiccup@2.4.0) (2018-09-23)
+
+
+### Features
+
+* **hiccup:** emmet class & class attrib merging in normalize() ([1d8eeb4](https://github.com/thi-ng/umbrella/commit/1d8eeb4))
+
+
+
+
+
# [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@2.2.1-alpha.1...@thi.ng/hiccup@2.3.0) (2018-09-22)
diff --git a/packages/hiccup/README.md b/packages/hiccup/README.md
index 587398a6dc..82526e8c29 100644
--- a/packages/hiccup/README.md
+++ b/packages/hiccup/README.md
@@ -2,6 +2,7 @@
[![npm version](https://img.shields.io/npm/v/@thi.ng/hiccup.svg)](https://www.npmjs.com/package/@thi.ng/hiccup)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hiccup.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
This project is part of the
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -11,6 +12,7 @@ This project is part of the
- [About](#about)
- [Features](#features)
- [Use cases](#use-cases)
+ - [Related packages](#related-packages)
- [No special sauce needed (or wanted)](#no-special-sauce-needed-or-wanted)
- [What is Hiccup?](#what-is-hiccup)
- [Installation](#installation)
@@ -67,6 +69,13 @@ serialization time. Examples below...
- Serverside rendering
- Static site, feed generation
- SVG asset generation
+- Shape trees for declarative canvas API drawing
+
+### Related packages
+
+- [@thi.ng/hdom](https://github.com/thi-ng/umbrella/tree/master/packages/hdom)
+- [@thi.ng/hdom-canvas](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-canvas)
+- [@thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-svg)
### No special sauce needed (or wanted)
@@ -272,6 +281,10 @@ serialize([div, {id: "foo"}, "bar"]);
### SVG generation, generators & lazy composition
+Also see
+[@thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-svg)
+for related functionality.
+
```ts
const fs = require("fs");
diff --git a/packages/hiccup/package.json b/packages/hiccup/package.json
index 66d04d6adb..78ea6154f3 100644
--- a/packages/hiccup/package.json
+++ b/packages/hiccup/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hiccup",
- "version": "2.3.0",
+ "version": "2.4.1",
"description": "HTML/SVG/XML serialization of nested data structures, iterables & closures",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -20,7 +20,7 @@
"test": "rm -rf build && tsc -p test && nyc mocha build/test/*.js"
},
"devDependencies": {
- "@thi.ng/atom": "^1.5.3",
+ "@thi.ng/atom": "^1.5.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.5.5",
"mocha": "^5.2.0",
@@ -29,8 +29,8 @@
"typescript": "^3.0.1"
},
"dependencies": {
- "@thi.ng/checks": "^1.5.10",
- "@thi.ng/errors": "^0.1.8"
+ "@thi.ng/checks": "^1.5.11",
+ "@thi.ng/errors": "^0.1.9"
},
"keywords": [
"clojure",
diff --git a/packages/hiccup/src/serialize.ts b/packages/hiccup/src/serialize.ts
index 0740403afe..db9114e166 100644
--- a/packages/hiccup/src/serialize.ts
+++ b/packages/hiccup/src/serialize.ts
@@ -222,8 +222,10 @@ const _serializeIter = (iter: Iterable, ctx: any, esc: boolean, span: boole
}
const normalize = (tag: any[]) => {
- let el = tag[0], match, id, clazz;
- const attribs: any = {};
+ let el = tag[0];
+ let match, id, clazz;
+ const hasAttribs = isPlainObject(tag[1]);
+ const attribs: any = hasAttribs ? { ...tag[1] } : {};
if (!isString(el) || !(match = TAG_REGEXP.exec(el))) {
illegalArgs(`"${el}" is not a valid tag name`);
}
@@ -234,19 +236,18 @@ const normalize = (tag: any[]) => {
attribs.id = id;
}
if (clazz) {
- attribs.class = clazz.replace(/\./g, " ");
+ clazz = clazz.replace(/\./g, " ");
+ if (attribs.class) {
+ attribs.class += " " + clazz;
+ } else {
+ attribs.class = clazz;
+ }
}
if (tag.length > 1) {
- let i = 1;
- const att = tag[1];
- if (isPlainObject(att)) {
- Object.assign(attribs, att);
- i++;
- }
if (isPlainObject(attribs.style)) {
attribs.style = css(attribs.style);
}
- tag = tag.slice(i).filter((x) => x != null);
+ tag = tag.slice(hasAttribs ? 2 : 1).filter((x) => x != null);
if (tag.length > 0) {
return [el, attribs, tag];
}
diff --git a/packages/hiccup/test/index.ts b/packages/hiccup/test/index.ts
index 4ad8069ab6..4a83c9e6fb 100644
--- a/packages/hiccup/test/index.ts
+++ b/packages/hiccup/test/index.ts
@@ -46,7 +46,13 @@ describe("serialize", () => {
check(
"div w/ id, class & attrib",
["div#foo.bar.baz", { extra: 23 }, "foo"],
- `