@thi.ng/rdom 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +11 -7
- package/compile.js +5 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-04-
|
|
3
|
+
- **Last updated**: 2024-04-26T13:32:20Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [1.3.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@1.3.3) (2024-04-26)
|
|
13
|
+
|
|
14
|
+
#### 🩹 Bug fixes
|
|
15
|
+
|
|
16
|
+
- update $compile() async-iterable attrib handling ([f977556](https://github.com/thi-ng/umbrella/commit/f977556))
|
|
17
|
+
|
|
12
18
|
## [1.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@1.3.0) (2024-04-20)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -119,8 +119,8 @@ please consult the docs for these packages to learn more about the available
|
|
|
119
119
|
constructs and patterns. Most of _rdom_ only deals with either subscribing to
|
|
120
120
|
reactive values, async iterables and/or wrapping/transforming existing
|
|
121
121
|
subscriptions, either explicitly using the provided control components (e.g.
|
|
122
|
-
[`$async()`](https://docs.thi.ng/umbrella/rdom/functions/_async.html)),
|
|
123
|
-
[`$sub()`](https://docs.thi.ng/umbrella/rdom/functions/_sub.html), or using
|
|
122
|
+
[`$async()`](https://docs.thi.ng/umbrella/rdom/functions/_async-1.html)),
|
|
123
|
+
[`$sub()`](https://docs.thi.ng/umbrella/rdom/functions/_sub-1.html), or using
|
|
124
124
|
[`$compile()`](https://docs.thi.ng/umbrella/rdom/functions/_compile.html) to
|
|
125
125
|
auto-wrap such values embedded in an hiccup tree.
|
|
126
126
|
|
|
@@ -171,10 +171,10 @@ for the implementation of common UI structures (e.g. item lists of any kind).
|
|
|
171
171
|
The following links lead to the documentation of these wrappers, incl. small
|
|
172
172
|
code examples:
|
|
173
173
|
|
|
174
|
-
- [$async](https://docs.thi.ng/umbrella/rdom/functions/_async.html)
|
|
174
|
+
- [$async](https://docs.thi.ng/umbrella/rdom/functions/_async-1.html)
|
|
175
175
|
- [$klist](https://docs.thi.ng/umbrella/rdom/functions/_klist.html)
|
|
176
176
|
- [$list](https://docs.thi.ng/umbrella/rdom/functions/_list.html)
|
|
177
|
-
- [$lazy](https://docs.thi.ng/umbrella/rdom/functions/_lazy.html)
|
|
177
|
+
- [$lazy](https://docs.thi.ng/umbrella/rdom/functions/_lazy-1.html)
|
|
178
178
|
- [$object](https://docs.thi.ng/umbrella/rdom/functions/_object-1.html)
|
|
179
179
|
- [$promise](https://docs.thi.ng/umbrella/rdom/functions/_promise-1.html)
|
|
180
180
|
- [$refresh](https://docs.thi.ng/umbrella/rdom/functions/_refresh.html)
|
|
@@ -248,7 +248,9 @@ $compile([
|
|
|
248
248
|
|
|
249
249
|
Work is underway to better support [built-in
|
|
250
250
|
AsyncIterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)
|
|
251
|
-
(possibly entirely in-lieu of rstream constructs). Currently, they can only be
|
|
251
|
+
(possibly entirely in-lieu of rstream constructs). Currently, they can only be
|
|
252
|
+
directly used for simple text or attribute values (also see the [rdom-async
|
|
253
|
+
example](https://github.com/thi-ng/umbrella/blob/develop/examples/rdom-async)):
|
|
252
254
|
|
|
253
255
|
```ts
|
|
254
256
|
import { $compile } from "@thi.ng/rdom";
|
|
@@ -257,7 +259,8 @@ import { range, source } from "@thi.ng/transducers-async";
|
|
|
257
259
|
// infinite 1Hz counter
|
|
258
260
|
const counter = range(1000);
|
|
259
261
|
|
|
260
|
-
// manually updated click counter (
|
|
262
|
+
// manually updated click counter (an async iterable with extended API)
|
|
263
|
+
// see: https://docs.thi.ng/umbrella/transducers-async/functions/source-1.html
|
|
261
264
|
const clicks = source(0);
|
|
262
265
|
|
|
263
266
|
// event handler to update click count
|
|
@@ -312,7 +315,7 @@ Browser ESM import:
|
|
|
312
315
|
|
|
313
316
|
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
314
317
|
|
|
315
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 4.
|
|
318
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 4.24 KB
|
|
316
319
|
|
|
317
320
|
## Dependencies
|
|
318
321
|
|
|
@@ -337,6 +340,7 @@ directory are using this package:
|
|
|
337
340
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/blurhash.jpg" width="240"/> | Interactive & reactive image blurhash generator | [Demo](https://demo.thi.ng/umbrella/blurhash/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/blurhash) |
|
|
338
341
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/canvas-recorder.png" width="240"/> | Self-modifying, animated typographic grid with emergent complex patterns | [Demo](https://demo.thi.ng/umbrella/canvas-recorder/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/canvas-recorder) |
|
|
339
342
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/color-themes.png" width="240"/> | Probabilistic color theme generator | [Demo](https://demo.thi.ng/umbrella/color-themes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/color-themes) |
|
|
343
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/csp-bus.png" width="240"/> | CSP channel-based event handling, async transducers & reactive UI components | [Demo](https://demo.thi.ng/umbrella/csp-bus/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/csp-bus) |
|
|
340
344
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/dominant-colors.png" width="240"/> | Color palette generation via dominant color extraction from uploaded images | [Demo](https://demo.thi.ng/umbrella/dominant-colors/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/dominant-colors) |
|
|
341
345
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/ellipse-proximity.png" width="240"/> | Interactive visualization of closest points on ellipses | [Demo](https://demo.thi.ng/umbrella/ellipse-proximity/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/ellipse-proximity) |
|
|
342
346
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/fiber-basics.png" width="240"/> | Fiber-based cooperative multitasking basics | [Demo](https://demo.thi.ng/umbrella/fiber-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/fiber-basics) |
|
package/compile.js
CHANGED
|
@@ -33,15 +33,18 @@ const isComplexComponent = (x) => {
|
|
|
33
33
|
const complexComponent = (tree) => ({
|
|
34
34
|
async mount(parent, index = -1) {
|
|
35
35
|
this.subs = [];
|
|
36
|
+
const attribs = { ...tree[1] };
|
|
36
37
|
walk((x, path) => {
|
|
37
38
|
if (isSubscribable(x)) {
|
|
38
39
|
this.subs.push(x.subscribe(new $SubA(this, path)));
|
|
39
40
|
} else if (isAsyncIterable(x)) {
|
|
40
41
|
$asyncA(x, this, path);
|
|
42
|
+
if (path.length === 1)
|
|
43
|
+
delete attribs[path[0]];
|
|
41
44
|
}
|
|
42
|
-
},
|
|
45
|
+
}, attribs);
|
|
43
46
|
this.children = [];
|
|
44
|
-
this.el = $el(tree[0],
|
|
47
|
+
this.el = $el(tree[0], attribs, null, parent, index);
|
|
45
48
|
for (let i = 2; i < tree.length; i++) {
|
|
46
49
|
const child = $compile(tree[i]);
|
|
47
50
|
child.mount(this.el, i - 2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rdom",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Lightweight, reactive, VDOM-less UI/DOM components with async lifecycle and @thi.ng/hiccup compatible",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@thi.ng/api": "^8.11.1",
|
|
41
41
|
"@thi.ng/checks": "^3.6.3",
|
|
42
42
|
"@thi.ng/errors": "^2.5.6",
|
|
43
|
-
"@thi.ng/hiccup": "^5.
|
|
43
|
+
"@thi.ng/hiccup": "^5.2.0",
|
|
44
44
|
"@thi.ng/paths": "^5.1.80",
|
|
45
45
|
"@thi.ng/prefixes": "^2.3.18",
|
|
46
|
-
"@thi.ng/rstream": "^8.4.
|
|
46
|
+
"@thi.ng/rstream": "^8.4.3",
|
|
47
47
|
"@thi.ng/strings": "^3.7.32"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
],
|
|
146
146
|
"year": 2020
|
|
147
147
|
},
|
|
148
|
-
"gitHead": "
|
|
148
|
+
"gitHead": "0bec55821066c18eb977a7eabd42c0bb2b096d98\n"
|
|
149
149
|
}
|