@domql/element 2.28.69 → 2.28.71

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/dist/cjs/node.js CHANGED
@@ -43,10 +43,8 @@ const createNode = async (element, options) => {
43
43
  } else node = element.node = (0, import_render.cacheNode)(element);
44
44
  await (0, import_event.triggerEventOn)("attachNode", element, options);
45
45
  }
46
- if ((0, import_env.isNotProduction)() || options.alowRefReference) {
47
- node.ref = element;
48
- if ((0, import_utils.isFunction)(node.setAttribute)) node.setAttribute("key", element.key);
49
- }
46
+ node.ref = element;
47
+ if ((0, import_utils.isFunction)(node.setAttribute)) node.setAttribute("key", element.key);
50
48
  (0, import_iterate.throughExecProps)(element);
51
49
  await (0, import_iterate.throughInitialDefine)(element);
52
50
  await (0, import_iterate.throughInitialExec)(element);
@@ -66,7 +64,12 @@ const createNode = async (element, options) => {
66
64
  const { hasDefine, hasContextDefine } = isElement;
67
65
  if (value && isElement && !hasDefine && !hasContextDefine) {
68
66
  const createAsync = async () => {
69
- await (0, import_create.create)(await (0, import_utils.exec)(value, element), element, param, options);
67
+ try {
68
+ const val = await (0, import_utils.exec)(value, element);
69
+ await (0, import_create.create)(val, element, param, options);
70
+ } catch (error) {
71
+ element.error("An unexpected error occurred:", error);
72
+ }
70
73
  };
71
74
  if (element.props && element.props.lazyLoad || options.lazyLoad) {
72
75
  window.requestAnimationFrame(async () => {
package/dist/esm/node.js CHANGED
@@ -29,10 +29,8 @@ const createNode = async (element, options) => {
29
29
  } else node = element.node = cacheNode(element);
30
30
  await triggerEventOn("attachNode", element, options);
31
31
  }
32
- if (isNotProduction() || options.alowRefReference) {
33
- node.ref = element;
34
- if (isFunction(node.setAttribute)) node.setAttribute("key", element.key);
35
- }
32
+ node.ref = element;
33
+ if (isFunction(node.setAttribute)) node.setAttribute("key", element.key);
36
34
  throughExecProps(element);
37
35
  await throughInitialDefine(element);
38
36
  await throughInitialExec(element);
@@ -52,7 +50,12 @@ const createNode = async (element, options) => {
52
50
  const { hasDefine, hasContextDefine } = isElement;
53
51
  if (value && isElement && !hasDefine && !hasContextDefine) {
54
52
  const createAsync = async () => {
55
- await create(await exec(value, element), element, param, options);
53
+ try {
54
+ const val = await exec(value, element);
55
+ await create(val, element, param, options);
56
+ } catch (error) {
57
+ element.error("An unexpected error occurred:", error);
58
+ }
56
59
  };
57
60
  if (element.props && element.props.lazyLoad || options.lazyLoad) {
58
61
  window.requestAnimationFrame(async () => {
package/node.js CHANGED
@@ -43,10 +43,10 @@ export const createNode = async (element, options) => {
43
43
  }
44
44
  // node.dataset // .key = element.key
45
45
 
46
- if (isNotProduction() || options.alowRefReference) {
47
- node.ref = element
48
- if (isFunction(node.setAttribute)) node.setAttribute('key', element.key)
49
- }
46
+ // if (isNotProduction() || options.alowRefReference) {
47
+ node.ref = element
48
+ if (isFunction(node.setAttribute)) node.setAttribute('key', element.key)
49
+ // }
50
50
 
51
51
  // iterate through exec props
52
52
  throughExecProps(element)
@@ -85,7 +85,13 @@ export const createNode = async (element, options) => {
85
85
 
86
86
  if (value && isElement && !hasDefine && !hasContextDefine) {
87
87
  const createAsync = async () => {
88
- await create(await exec(value, element), element, param, options)
88
+ try {
89
+ const val = await exec(value, element)
90
+ await create(val, element, param, options)
91
+ } catch (error) {
92
+ // Handle other potential errors
93
+ element.error('An unexpected error occurred:', error)
94
+ }
89
95
  }
90
96
 
91
97
  if ((element.props && element.props.lazyLoad) || options.lazyLoad) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.28.69",
3
+ "version": "2.28.71",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -27,12 +27,12 @@
27
27
  "prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
28
28
  },
29
29
  "dependencies": {
30
- "@domql/event": "^2.28.69",
31
- "@domql/render": "^2.28.69",
32
- "@domql/state": "^2.28.69",
33
- "@domql/utils": "^2.28.69"
30
+ "@domql/event": "^2.28.71",
31
+ "@domql/render": "^2.28.71",
32
+ "@domql/state": "^2.28.71",
33
+ "@domql/utils": "^2.28.71"
34
34
  },
35
- "gitHead": "1f59bb47b71dd8e8d2c0f3fa9fdeb2ff5c6de8d4",
35
+ "gitHead": "654ec2d144d0d3cd508eee43b4c8fbdfd43cf5a0",
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.27.1"
38
38
  }