@domql/element 2.5.134 → 2.5.136
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/create.js +5 -5
- package/dist/cjs/create.js +6 -6
- package/package.json +2 -3
package/create.js
CHANGED
|
@@ -213,7 +213,7 @@ const addElementIntoParentChildren = (element, parent) => {
|
|
|
213
213
|
const visitedElements = new WeakMap()
|
|
214
214
|
const renderElement = (element, parent, options, attachOptions) => {
|
|
215
215
|
if (visitedElements.has(element)) {
|
|
216
|
-
if (ENV === 'test' || ENV === 'development') console.warn('Cyclic rendering detected:', element.__ref.
|
|
216
|
+
if (ENV === 'test' || ENV === 'development') console.warn('Cyclic rendering detected:', element.__ref.path)
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
visitedElements.set(element, true)
|
|
@@ -222,13 +222,13 @@ const renderElement = (element, parent, options, attachOptions) => {
|
|
|
222
222
|
|
|
223
223
|
// CREATE a real NODE
|
|
224
224
|
try {
|
|
225
|
-
const isInfiniteLoopDetected = detectInfiniteLoop(ref.
|
|
225
|
+
const isInfiniteLoopDetected = detectInfiniteLoop(ref.path)
|
|
226
226
|
if (ref.__uniqId || isInfiniteLoopDetected) return
|
|
227
227
|
createNode(element, options)
|
|
228
228
|
ref.__uniqId = Math.random()
|
|
229
229
|
} catch (e) {
|
|
230
230
|
if (ENV === 'test' || ENV === 'development') {
|
|
231
|
-
const path = ref.
|
|
231
|
+
const path = ref.path
|
|
232
232
|
if (path.includes('ComponentsGrid')) path.splice(0, path.indexOf('ComponentsGrid') + 2)
|
|
233
233
|
if (path.includes('demoComponent')) path.splice(0, path.indexOf('demoComponent') + 1)
|
|
234
234
|
const isDemoComponent = element.lookup(el => el.state.key)?.state?.key
|
|
@@ -327,8 +327,8 @@ const addCaching = (element, parent) => {
|
|
|
327
327
|
// set the PATH array
|
|
328
328
|
// if (ENV === 'test' || ENV === 'development') {
|
|
329
329
|
if (!parentRef) parentRef = parent.ref = {}
|
|
330
|
-
if (!parentRef.
|
|
331
|
-
ref.
|
|
330
|
+
if (!parentRef.path) parentRef.path = []
|
|
331
|
+
ref.path = parentRef.path.concat(element.key)
|
|
332
332
|
// }
|
|
333
333
|
}
|
|
334
334
|
|
package/dist/cjs/create.js
CHANGED
|
@@ -171,19 +171,19 @@ const renderElement = (element, parent, options, attachOptions) => {
|
|
|
171
171
|
var _a, _b;
|
|
172
172
|
if (visitedElements.has(element)) {
|
|
173
173
|
if (ENV === "test" || ENV === "development")
|
|
174
|
-
console.warn("Cyclic rendering detected:", element.__ref.
|
|
174
|
+
console.warn("Cyclic rendering detected:", element.__ref.path);
|
|
175
175
|
}
|
|
176
176
|
visitedElements.set(element, true);
|
|
177
177
|
const { __ref: ref, key } = element;
|
|
178
178
|
try {
|
|
179
|
-
const isInfiniteLoopDetected = (0, import_utils.detectInfiniteLoop)(ref.
|
|
179
|
+
const isInfiniteLoopDetected = (0, import_utils.detectInfiniteLoop)(ref.path);
|
|
180
180
|
if (ref.__uniqId || isInfiniteLoopDetected)
|
|
181
181
|
return;
|
|
182
182
|
(0, import_node.default)(element, options);
|
|
183
183
|
ref.__uniqId = Math.random();
|
|
184
184
|
} catch (e) {
|
|
185
185
|
if (ENV === "test" || ENV === "development") {
|
|
186
|
-
const path = ref.
|
|
186
|
+
const path = ref.path;
|
|
187
187
|
if (path.includes("ComponentsGrid"))
|
|
188
188
|
path.splice(0, path.indexOf("ComponentsGrid") + 2);
|
|
189
189
|
if (path.includes("demoComponent"))
|
|
@@ -260,9 +260,9 @@ const addCaching = (element, parent) => {
|
|
|
260
260
|
ref.root = hasRoot ? element : parentRef.root;
|
|
261
261
|
if (!parentRef)
|
|
262
262
|
parentRef = parent.ref = {};
|
|
263
|
-
if (!parentRef.
|
|
264
|
-
parentRef.
|
|
265
|
-
ref.
|
|
263
|
+
if (!parentRef.path)
|
|
264
|
+
parentRef.path = [];
|
|
265
|
+
ref.path = parentRef.path.concat(element.key);
|
|
266
266
|
};
|
|
267
267
|
const onlyResolveExtends = (element, parent, key, options) => {
|
|
268
268
|
const { __ref: ref } = element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.136",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -27,12 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@domql/event": "^2.5.134",
|
|
30
|
-
"@domql/node": "^2.5.0",
|
|
31
30
|
"@domql/render": "^2.5.134",
|
|
32
31
|
"@domql/state": "^2.5.134",
|
|
33
32
|
"@domql/utils": "^2.5.134"
|
|
34
33
|
},
|
|
35
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "3180ed884beb91ea31b5e5f5ddccfb06d850b172",
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@babel/core": "^7.12.0"
|
|
38
37
|
}
|