@domql/element 3.6.3 → 3.6.4
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/README.md +57 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -34,4 +34,60 @@ const MyComponent = {
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`el.html` takes priority when both are set. `props.html` is used as a fallback when `el.html` is not defined.
|
|
37
|
+
`el.html` takes priority when both are set. `props.html` is used as a fallback when `el.html` is not defined.
|
|
38
|
+
|
|
39
|
+
## REGISTRY (`mixins/registry.js`)
|
|
40
|
+
|
|
41
|
+
The `REGISTRY` object defines which keys are recognized as framework properties (rather than child elements). Any key **not** in REGISTRY and starting with an uppercase letter is treated as a child element.
|
|
42
|
+
|
|
43
|
+
**Every framework-level key must be listed here.** If a key like `childExtend` is missing from REGISTRY, it gets interpreted as a child element name, causing silent rendering failures (e.g., cart components not rendering in Archy).
|
|
44
|
+
|
|
45
|
+
Current framework keys that must remain in REGISTRY:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
extends, children, content,
|
|
49
|
+
childExtend (deprecated), childExtends,
|
|
50
|
+
childExtendRecursive (deprecated), childExtendsRecursive,
|
|
51
|
+
props, if, define,
|
|
52
|
+
__name, __ref, __hash, __text, key, tag, query, parent, node,
|
|
53
|
+
variables, on, component, context
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Plus mixin handlers: `attr`, `style`, `text`, `html`, `data`, `classlist`, `state`, `scope`, `deps`.
|
|
57
|
+
|
|
58
|
+
> **v3 note:** `childExtend` (singular) is deprecated v2 syntax — use `childExtends` (plural) in new code. The singular forms remain in REGISTRY for backwards compatibility with older projects. If a key is missing from REGISTRY, it gets interpreted as a child element name, causing silent rendering failures.
|
|
59
|
+
|
|
60
|
+
## set.js — Content Setting
|
|
61
|
+
|
|
62
|
+
### Fragment forwarding
|
|
63
|
+
|
|
64
|
+
When `set()` receives content with `tag: 'fragment'`, the fragment itself doesn't create a DOM node — its children are inserted directly. This means:
|
|
65
|
+
|
|
66
|
+
1. **childExtends forwarding** — The parent's `childExtends` must be forwarded to the fragment's params so that fragment children inherit the correct extends:
|
|
67
|
+
```javascript
|
|
68
|
+
if (tag === 'fragment') {
|
|
69
|
+
const elementChildExtends = element.childExtends || element.childExtend
|
|
70
|
+
if (!childExtends && elementChildExtends) {
|
|
71
|
+
params.childExtends = elementChildExtends
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
(Also checks deprecated `childExtend` for backwards compatibility with v2 projects.)
|
|
76
|
+
|
|
77
|
+
2. **childProps forwarding** — Similarly, `childProps` from the parent must be explicitly passed through the fragment to its children.
|
|
78
|
+
|
|
79
|
+
3. **ignoreChildProps** — When forwarding `childProps` through a fragment, set `props.ignoreChildProps = true` on the fragment itself to prevent the fragment from inheriting the parent's `childProps` via `inheritParentProps`. The `childProps` are already forwarded explicitly for the fragment's children.
|
|
80
|
+
|
|
81
|
+
### Infinite loop guard
|
|
82
|
+
|
|
83
|
+
`set()` includes a re-entrancy guard via `ref.__settingContent`. Without this, define handlers (like `$router`) that call `el.set()` can trigger infinite recursion when content-setting triggers another content-set cycle.
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
if (ref.__settingContent) return element
|
|
87
|
+
ref.__settingContent = true
|
|
88
|
+
try {
|
|
89
|
+
return _setInner(params, options, element)
|
|
90
|
+
} finally {
|
|
91
|
+
ref.__settingContent = false
|
|
92
|
+
}
|
|
93
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"build:iife": "cross-env NODE_ENV=$NODE_ENV esbuild index.js --bundle --target=es2020 --format=iife --global-name=DomqlElement --outfile=dist/iife/index.js --define:process.env.NODE_ENV=process.env.NODE_ENV"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@domql/report": "^3.6.
|
|
50
|
-
"@domql/state": "^3.6.
|
|
51
|
-
"@domql/utils": "^3.6.
|
|
52
|
-
"attrs-in-props": "^3.6.
|
|
49
|
+
"@domql/report": "^3.6.4",
|
|
50
|
+
"@domql/state": "^3.6.4",
|
|
51
|
+
"@domql/utils": "^3.6.4",
|
|
52
|
+
"attrs-in-props": "^3.6.4"
|
|
53
53
|
},
|
|
54
54
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
55
55
|
"devDependencies": {
|